Geo Mapping. How to index/query a non-point geo property?
Hello, guys!
I've tried to query complex geoshape, but got empty response. What am I doing wrong?
My query:
transaction = client.submit(
f"""
g.V().has("location", geoWithin(Geoshape.circle({lat}, {lon}, {radius})))
"""
)
Index creation:
transaction = client.submit(
"""
mgmt = graph.openManagement()
location = mgmt.makePropertyKey('location').dataType(Geoshape.class).cardinality(Cardinality.SINGLE).make()
mgmt.buildIndex('byLocation', Vertex.class).addKey(location, Mapping.PREFIX_TREE.asParameter()).buildMixedIndex('search')
mgmt.commit()
"""
)
Vertex creation:
transaction = client.submit(
f"""
g.addV("place").property("location", {graph_geoshape.to_janus_graph_property()})
"""
)
Schema looks like this:
[ '------------------------------------------------------------------------------------------------\n'
'Vertex Label Name | Partitioned | Static |\n'
'---------------------------------------------------------------------------------------------------\n'
'place | false | false |\n'
'location | false | false |\n'
'---------------------------------------------------------------------------------------------------\n'
'Edge Label Name | Directed | Unidirected | Multiplicity |\n'
'---------------------------------------------------------------------------------------------------\n'
'---------------------------------------------------------------------------------------------------\n'
'Property Key Name | Cardinality | Data Type |\n'
'---------------------------------------------------------------------------------------------------\n'
'location | SINGLE | class org.janusgraph.core.attribute.Geoshape |\n'
'place | SINGLE | class org.janusgraph.core.attribute.Geoshape |\n'
'---------------------------------------------------------------------------------------------------\n'
'Graph Index (Vertex) | Type | Unique | Backing | Key: Status |\n'
'---------------------------------------------------------------------------------------------------\n'
'byLocation | Mixed | false | search | location: ENABLED |\n'
'---------------------------------------------------------------------------------------------------\n'
'Graph Index (Edge) | Type | Unique | Backing | Key: Status |\n'
'---------------------------------------------------------------------------------------------------\n'
'---------------------------------------------------------------------------------------------------\n'
'Relation Index (VCI) | Type | Direction | Sort Key | Order | Status |\n'
'---------------------------------------------------------------------------------------------------\n']