I'm using Neo4j with Bolt and the Neo4j driver in Java. When I tried to run
the following command:
DROP INDEX ON :SingleBoardComputer(id.id)
Note that the name of the property is actually "id.id" (basically with a dot).
I have the following error:
Neo.ClientError.Statement.SyntaxError: Invalid input '\': expected whitespace or a list of property key names (line 1, column 36 (offset: 35))
"DROP INDEX ON :SingleBoardComputer(id.id)"
Is there any way to drop an index using the driver?
I'm using Neo4j 3.3.5 and the neo4j driver 1.6.1
I'm surprised because I can create the index without problems.
Thanks
The solution is to escape the field:
DROP INDEX ON :SingleBoardComputer(`id.id`)
Related
This is what I am doing. I really don't know what I am doing wrong
CREATE INDEX index_user FOR (n:User) ON (n.id, n.username, n.email)
The Output is
Invalid input 'i': expected whitespace, comment, ON, '=', node labels,
MapLiteral, a parameter, a parameter (old syntax), a relationship
pattern, ',', FROM GRAPH, CONSTRUCT, LOAD CSV, START, MATCH, UNWIND,
MERGE, CREATE UNIQUE, CREATE, SET, DELETE, REMOVE, FOREACH, WITH,
CALL, RETURN, UNION, ';' or end of input (line 1, column 14 (offset:
13)) "CREATE INDEX index_user FOR (n:User)"
The syntax you are using was added to neo4j 4.x. It is not supported in older versions of neo4j.
In older versions that support composite indexes, like neo4j 3.5, the syntax for creating your index would be:
CREATE INDEX ON :User(id, username, email)
Note: This older syntax is currently still supported in version 4.0.4, but deprecated.
I am trying to install the reactome DB into Neo4j so I can make a graph from it. I keep getting the same error message regardless of my syntax. The DB folder is stored in neo4J\bin\reactome.
I have basically been using this cypher command and all sorts of permutations of it:
neo4j-admin restore --from=neo4j\bin\reactome --database= reactome.graphdb –force=true"
and, regardless of how I do it, I get this error leading me to think it is something more than the syntax:
Neo.ClientError.Statement.SyntaxError: Invalid input 'e': expected <init> (line 1, column 1 (offset: 0))
"eo4j-admin restore --from=neo4j\bin\reactome --database= reactome.graphdb –force=true""
^
The neo4j-admin tool must be run from the command line -- it is NOT a Cypher operation.
To install the Reactome DB with Neo4j, click on 'open folder/import' in Neo4j. Then go up one directory, and go to '/data/databases/graph.db/'. Dump all the contents of the Reactome graph DB folder (uncompressed) inside the directory.
I've quite a bit of exerience with Neo4J but a noob with graphql
I created my graphql schema by running:
CALL graphql.idl(null)
I have a node type with three labels. I tried to run the following query in graphiql and got the same error. Due to the stack, I wondered if graphiql was adding meta and moved to the neo4j browser - same error.
The query:
CALL graphql.execute('mutation { createArrival(uuid:"graphql")}')
The error:
Failed to invoke procedure `graphql.execute`: Caused by: java.lang.RuntimeException: Error executing GraphQL Query:
ExceptionWhileDataFetching{path=[createArrival]exception=org.neo4j.graphdb.QueryExecutionException: Invalid input 'n': expected whitespace, comment, '{', node labels, MapLiteral, a parameter, a relationship pattern, '(', '.', '=' or "+=" (line 1, column 69 (offset: 68))
"CREATE (node:Arrival) SET node = {properties} SET node:`Event`, SET node:`Configuration`"
^locations=[SourceLocation{line=1, column=12}]}
I'm probably doing something really obviously wrong but any help would be appreciated
Confirmed as a bug by #michael-hunger
I am trying to create a composite index as documented in http://neo4j.com/docs/developer-manual/current/cypher/schema/index/#create-a-composite-index
This is what I tried.
CREATE INDEX ON :Person(firstname, surname)
however I get the error
Invalid input ',': expected an identifier character, whitespace or ')' (line 1, column 34 (offset: 33))
"CREATE INDEX ON :Person(firstname, surname)"
Can anyone help?
Composite indexes are only available in Neo4j 3.2 which has been released a couple of days ago, make sure you run this version.
I just upgraded to Neo4j 2.1.2 from 2.0.1 and some of my cypher-queries stopped working.
I am using a self-defined Lucene index to find the startnodes, navigate via a typed relationship (Partner_PartnerMeta) to a typed Node(PartnerTyp). After that i just return a subset of these nodes.
My query previously used to check for the type of startnode (PartnerMeta). Since 2.1.2 the query
START partnermeta = node:PartnerTyp_Meta("Namen:wilhelm*")
MATCH (partner:PartnerTyp)-[:Partner_PartnerMeta]->(partnermeta:PartnerMeta)
RETURN DISTINCT partner SKIP 0 LIMIT 10
results in
Cannot add labels or properties on a node which is already bound (line 2, column 52)
"MATCH (partner:PartnerTyp)-[:Partner_PartnerMeta]->(partnermeta:PartnerMeta)"
^
This error can be suppressed by omitting the ":PartnerMeta" part of the query. As the type of the node returned from the index hasn't been checked yet, i would like to verify that it is of the type "PartnerMeta" (maybe i am too paranoid that way).
My question is:
Is there a possibility to check for the type of node after the usage of START in combination with a legacy index?
This is a regression in Cypher 2.1.2 which will be fixed. It was an attempt to avoid invalid combinations of label checks.
For now, can you try:
START partnermeta = node:PartnerTyp_Meta("Namen:wilhelm*")
MATCH (partner:PartnerTyp)-[:Partner_PartnerMeta]->(partnermeta)
WHERE partnermeta:PartnerMeta
RETURN DISTINCT partner SKIP 0 LIMIT 10