sparql-view-unfold
    Preparing search index...
    • Floats every BIND in op as high as the plan allows and deletes the ones nothing above reads.

      Works on a subtree as happily as on a whole query, the invariant being anchored per swap.

      Type Parameters

      • T extends Operation

      Parameters

      Returns T

      the rewritten operation

      // Before: SELECT * WHERE { { ?s ?p ?o . BIND(<ex://a> AS ?x) } { ?a ?b ?c } }
      // After: SELECT * WHERE { ?s ?p ?o . ?a ?b ?c . BIND(<ex://a> AS ?x) }
      // Before: SELECT ?y WHERE { ?y <ex://p> ?o . BIND(<ex://a> AS ?x) }
      // After (nothing projects ?x, so the bind is deleted):
      // SELECT ?y WHERE { ?y <ex://p> ?o }