Select to view content in your preferred language

Building Cypher Query using spatial relations?

1505
6
Jump to solution
04-08-2022 11:19 PM
xingchenc
Frequent Contributor

When I look closely at the supply chain demo shown at Esri 2022 developer summit(Plenary | 2022 Esri Developer Summit - Esri Videos: GIS, Events, ArcGIS Products & Industries), I noticed that inside the Cypher Query, it compares the spatial relationship between the two entities and returned the path that has the correct relationship(in this case, "Intersect").  

xingchenc_2-1649484594968.png

xingchenc_1-1649484462529.png

The capability to query entities using spatial relations is a huge bonus when extracting information from the Knowledge Graph. However, when I was looking for detailed explanations regarding how this is done in the ArcGIS Pro help, I found nothing. I was wondering if anyone know where should I look? 

@MeganBanaski1 Hi Megan, I was wondering if you have more information on this stuff?

 

0 Kudos
1 Solution

Accepted Solutions
MeganBanaski1
Esri Contributor

@xingchenc Currently, supported spatial relation operators are esri.graph.ST_Equals(<geom>, <geom>), esri.graph.ST_Intersects(<geom>, <geom>), and esri.graph.ST_Contains(<geom>, <geom>).

For spatial utility, there is esri.graph.ST_GeoDistance(<geom>, <geom>) and for spatial construction there is esri.graph.ST_SKTToGeometry(string).

View solution in original post

6 Replies
MeganBanaski1
Esri Contributor

@xingchenc Currently, supported spatial relation operators are esri.graph.ST_Equals(<geom>, <geom>), esri.graph.ST_Intersects(<geom>, <geom>), and esri.graph.ST_Contains(<geom>, <geom>).

For spatial utility, there is esri.graph.ST_GeoDistance(<geom>, <geom>) and for spatial construction there is esri.graph.ST_SKTToGeometry(string).

xingchenc
Frequent Contributor

Hi Megan,

Thanks a lot, this is really helpful!

BTW, can you elaborate on the esri.graph.ST_SKTToGeometry(string) method?

0 Kudos
MeganBanaski1
Esri Contributor

Apologies there was a typo in there, it is esri.graph.ST_WKTToGeometry(string). It constructs a geometry from the OGC simple feature access well-known text format.

0 Kudos
xingchenc
Frequent Contributor

Thanks Megan!

0 Kudos
xingchenc
Frequent Contributor

@MeganBanaski1 

Hi Megan, could you please share with us the newest suppoted spatial funtions on a Neo4j /ArangoDB knowledge graphs?

specifically, we currently would like to use cypher query to return an entity's Length and Area, is there a way to achieve it?

0 Kudos
MeganBanaski1
Esri Contributor

Hello, there is not currently a spatial function in openCypher to return an entity's Length or Area. You could use other tools to calculate these and populate them as properties on the entities, then in the query return the values in those properties.

0 Kudos