Skip to content

bug in translation when gathering FILTER expresssions #249

@pfps

Description

@pfps
FILTER expressions apply to the whole group graph pattern in which they appear. The algebra operators to perform filtering are added to the group after translation of each group element. We collect the filters together here and remove them from group, then [apply them to the whole translated group graph pattern](https://www.w3.org/TR/sparql12-query/#sparqlAddFilters).

In this step, we also translate graph patterns within FILTER expressions [EXISTS](https://www.w3.org/TR/sparql12-query/#func-filter-exists) and [NOT EXISTS](https://www.w3.org/TR/sparql12-query/#func-filter-not-exists).

Let FS := empty set
For each form FILTER(expr) in the group graph pattern
    In expr, replace NOT EXISTS{P} with fn:not(exists(translate(P))) 
    In expr, replace EXISTS{P} with exists(translate(P))
    FS := FS ∪ {expr}
    End

The set of filter expressions FS is [used later](https://www.w3.org/TR/sparql12-query/#sparqlAddFilters).

There is no definition of that in means here.

For example, why is the filter in the query below

SELECT ?x WHERE {
  ?x :a :b .
 MINUS { ?x :c :d . FILTER (?x = :w) }
}

not in the main group graph pattern of the SELECT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    spec:bugChange fixing a bug in the specification (class 3) –see also spec:substantive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions