Class MergeFilterExistsIntoPrecedingGraphTransform

java.lang.Object
org.eclipse.rdf4j.queryrender.sparql.ir.util.transform.BaseTransform
org.eclipse.rdf4j.queryrender.sparql.ir.util.transform.MergeFilterExistsIntoPrecedingGraphTransform

public final class MergeFilterExistsIntoPrecedingGraphTransform extends BaseTransform
If a GRAPH block is immediately followed by a FILTER with an EXISTS body that itself wraps its content in a GRAPH of the same graph reference, move the FILTER EXISTS inside the preceding GRAPH and unwrap the inner GRAPH wrapper. Also introduce an explicit grouping scope around the GRAPH body so that the triple(s) and the FILTER are kept together in braces, matching the source query's grouping. Example: GRAPH { ?s ex:p ?o . } FILTER EXISTS { GRAPH { ?s !(ex:a|^ex:b) ?o . } } → GRAPH { { ?s ex:p ?o . FILTER EXISTS { ?s !(ex:a|^ex:b) ?o . } } }
  • Method Details