You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A)
\time --format='Elapsed time: %e seconds' kgtk --debug query -i $GRAPH_CKG_GEO --as geo --force --import 'pygeos as pg'
--match 'geo: (:h4v9)-[r1:h4r2]->(v1), (y)-[r2:h4r2]->(v2) '
--where 'y != "h4v9"'
--return '"h4v9" as node1, y as node2, v1, v2, pycall("pg.Geometry", v1) as geo1, pycall("pg.Geometry", v2) as geo2, pycall("pg.intersects", geo1, geo2) as hasIntersection'
-o /app/kgtk/data/H4/CKG-H4-K7-geo.tsv
B)
\time --format='Elapsed time: %e seconds' kgtk --debug query -i $GRAPH_CKG_GEO --as geo --force --import 'pygeos as pg'
--match 'geo: (:h4v9)-[r1:h4r2]->(v1), (y)-[r2:h4r2]->(v2) '
--where 'y != "h4v9"'
--return '"h4v9" as node1, y as node2, pycall("pg.intersection", v1, v2) as hasIntersection'
-o /app/kgtk/data/H4/CKG-H4-K7-geo.tsv
Expected behavior
Return True or False from the pg.intersects function but it returns no values. Or at least return intersection points from pg.intersection function.
I created a function in python that receives two strings, turns them into geometry, checks the intersection, returns True or False as a string but I am also not getting the kgtk query to recognize.
kgtk --debug query -i $GRAPH_CKG_GEO --as geo --force --import 'geo_functions.py' --match 'geo: (:h4v9)-[r1:h4r2]->(v1), (y)-[r2:h4r2]->(v2) ' --where 'y != "h4v9"' --return '"h4v9" as node1, y as node2, pycall("geo_intersection", v1, v2) as hasIntersection'
Traceback (most recent call last):
File "/app/kgtk/miniconda3/bin/kgtk", line 8, in
sys.exit(cli_entry())
File "/app/kgtk/miniconda3/lib/python3.9/site-packages/kgtk/cli_entry.py", line 478, in cli_entry
subp = mod.parser()
AttributeError: module 'kgtk.cli.geo_functions' has no attribute 'parser'
Command exited with non-zero status 1
Elapsed time: 0.69 seconds
Describe the bug
I want to manipulate geometry data of node2 from my kgtk file using pygeos (python library)
To Reproduce
CKG-H4-geo.txt
export GRAPH_CKG_GEO=/app/kgtk/data/H4/CKG-H4-geo.tsv
A)
\time --format='Elapsed time: %e seconds' kgtk --debug query -i $GRAPH_CKG_GEO --as geo --force --import 'pygeos as pg'
--match 'geo: (:h4v9)-[r1:h4r2]->(v1), (y)-[r2:h4r2]->(v2) '
--where 'y != "h4v9"'
--return '"h4v9" as node1, y as node2, v1, v2, pycall("pg.Geometry", v1) as geo1, pycall("pg.Geometry", v2) as geo2, pycall("pg.intersects", geo1, geo2) as hasIntersection'
-o /app/kgtk/data/H4/CKG-H4-K7-geo.tsv
B)
\time --format='Elapsed time: %e seconds' kgtk --debug query -i $GRAPH_CKG_GEO --as geo --force --import 'pygeos as pg'
--match 'geo: (:h4v9)-[r1:h4r2]->(v1), (y)-[r2:h4r2]->(v2) '
--where 'y != "h4v9"'
--return '"h4v9" as node1, y as node2, pycall("pg.intersection", v1, v2) as hasIntersection'
-o /app/kgtk/data/H4/CKG-H4-K7-geo.tsv
Expected behavior
Return True or False from the pg.intersects function but it returns no values. Or at least return intersection points from pg.intersection function.
CKG-H4-K7-geo.txt
The text was updated successfully, but these errors were encountered: