Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-15-2022 08:34 PM
Hi
Attached is the node in my graph database. I am trying run a cypher query to retrieve the node.
My queries were
match (a) where a.id=203
return a
Result :no records were retrieved
match (a) where a.rdf-schemaCreationSource='SURVEY'
return a
Result : Variable schemaCreationSource
not defined (line 1, column 23 (offset: 22))"match (a) where a.rdf-schemaCreationSource='SURVEY'"**
Please let me know the correct syntax.
Thanks
Shilpa
03-22-2022 03:37 AM
To retrieve a node via the internal id, that is the property with key <id>
,
you should execute this:
match (a) where id(a) =203
return a
Just for clarity, you could create a node with an id property, in that case you would have to match (a) where a.id = 203 return a
, but still that would be a different property than the id
created internally by Neo4j.
In the second case, the property rdf-schemaCreationSource
has a character -
,
therefore you have to escape it, using the backtick :
match (a) where a.`rdf-schemaCreationSource`='SURVEY'
return a
Anyway, I notice that the property value has square brackets,
so maybe the query should be:
match (a) where a.`rdf-schemaCreationSource`='[SURVEY]'
return a
03-22-2022 07:50 PM
Further to the above query. Below images shows the node labels in my database and the cypher query .
The result retrieved a null value.
Please le me know the correct query to retrieve data in the Resource node.
Thanks
Shilpa
03-26-2022 01:10 AM
Hi
I made some progress. Now
CALL n10s.inference.nodesLabelled('Resource')
yield node
return node.ContactPerson as Owner,node.Representation as Geometry,node.InteriorDiameter as Diameter, node.Material as Material
Is working as expected.
But I cannot retrieve individual nodes using match and return clauses. To be more specific.
Match (a:Resource)
Return a. InternalDiameter works well.
Match (a:Resource {NetworkValue Class:"XYX"})
Return a doesn't work. It says no records.
How to retrieve individual node based on a condition?
04-04-2022 02:08 AM
Hi, the syntax seems correct, that is (match :Node keyProperty:"valueProperty")
,
but maybe after pasting the query here, it is been formatted badly,
Match (a:Resource {NetworkValue Class:"XYX"})
,
with a whitespace between NetworkValue
and Class
throws a syntax exception.
You should write in this way if your property is NetworkValue Class
:
Match (a:Resource {`NetworkValue Class`:"XYX"})
or without the space, if your property is NetworkValueClass
.
Anyway, can you share the result of this query?
MATCH (n:Resource)
WITH DISTINCT KEYS(n) AS keys
UNWIND keys AS key
RETURN DISTINCT COLLECT(DISTINCT key)
All the sessions of the conference are now available online