Skip to content

Help with: Defining and using custom functions #705

@versant2612

Description

@versant2612

Describe the bug
I want to manipulate geometry data of node2 from my kgtk file using pygeos (python library)

To Reproduce

  1. pygeos instalation
  2. data definition
    CKG-H4-geo.txt
  3. query

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions