Pushes every assertion filter in rootOp as deep as possible, and into every branch that permits it -
for a join, that may be both sides at once.
Takes the root of a query, not a subtree of one. Materialising a shape coins variables for the
positions nothing names, and the only thing keeping a coined name off a variable of the query is that
every variable of the query was collected before the pass ran. Nothing else in the pass cares, the
licences being read per operation, so this is the one precondition it has.
// Before: // SELECT * WHERE { { ?x :p ?y } UNION { ?z :q ?w } FILTER(sameTerm(?x, <ex://a>)) } // After (the right branch can never bind ?x, so it becomes empty): // SELECT * WHERE { // { <ex://a> <ex://p> ?y BIND(<ex://a> AS ?x) } UNION { ?z <ex://q> ?w FILTER(false) } // }
Example
// Before: SELECT * WHERE { ?s ?p ?o FILTER(sameTerm(?s, ?o)) } // After: SELECT * WHERE { ?o ?p ?o . BIND(?o AS ?s) }
Pushes every assertion filter in
rootOpas deep as possible, and into every branch that permits it - for a join, that may be both sides at once.Takes the root of a query, not a subtree of one. Materialising a shape coins variables for the positions nothing names, and the only thing keeping a coined name off a variable of the query is that every variable of the query was collected before the pass ran. Nothing else in the pass cares, the licences being read per operation, so this is the one precondition it has.