Skip to content

GeoSPARQL relation triple after a path ending in a blank node returns every geometry for every row #54

Closed

Description

@MathiasVDA

Follow-up to #48, found in review of #53. It happens on main before #53 too.

?r a ex:R ; geo:hasGeometry ?rg . ?x a ex:P ; (ex:ref|ex:part)/geo:hasGeometry ?g . ?g geo:sfWithin ?rg gives 7,611,400 rows on the review probe (25 regions, 6,000 points). The same query with the path's end written out as ?m ((ex:ref|ex:part) ?m . ?m geo:hasGeometry ?g) gives 1,056.

It is wrong for ref?/, part*/, part+/, (ref|part)/ and (part/part?)?/ before geo:hasGeometry. It is right when the path ends on a variable.

Cause: the parser joins the path to a blank node with the BGP _:b geo:hasGeometry ?g . ?g geo:sfWithin ?rg. The spatial rewrite turns that BGP into a projection of its variables, which drops _:b, so the path is no longer joined to it.

Taking this in the query lane.

Activity

  1. added a commit that references this issue on Nov 19, 2026
    84be999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions