Class TransformFactorizeTableColumnsToExtend
java.lang.Object
org.apache.jena.sparql.algebra.TransformCopy
org.aksw.jena_sparql_api.algebra.transform.TransformFactorizeTableColumnsToExtend
- All Implemented Interfaces:
org.apache.jena.sparql.algebra.Transform
public class TransformFactorizeTableColumnsToExtend
extends org.apache.jena.sparql.algebra.TransformCopy
Given a table extract all variables that map to the same constant to a bind block:
Given:
VALUES (?x ?y) {
(a b1)
(a b2)
}
it becomes:
VALUES (?y) { b1 b2 )
BIND(a AS ?x)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanVirtuoso does not support an empty table - whereas jena does.Fields inherited from class org.apache.jena.sparql.algebra.TransformCopy
COPY_ALWAYS, COPY_ONLY_ON_CHANGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<org.apache.jena.sparql.core.Var,org.apache.jena.graph.Node> extractConstants(org.apache.jena.query.ResultSet rs) Yield all variable-value pairs where the variable is mapped to the same value across all given bindings.org.apache.jena.sparql.algebra.Optransform(org.apache.jena.sparql.algebra.op.OpTable opTable) Methods inherited from class org.apache.jena.sparql.algebra.TransformCopy
transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform
-
Field Details
-
preventEmptyTable
protected boolean preventEmptyTableVirtuoso does not support an empty table - whereas jena does. I.e. the following works with jena but not with virtuoso: SELECT * { VALUES () { () () () } BIND (<urn:x> AS ?x) }
-
-
Constructor Details
-
TransformFactorizeTableColumnsToExtend
public TransformFactorizeTableColumnsToExtend()
-
-
Method Details
-
transform
public org.apache.jena.sparql.algebra.Op transform(org.apache.jena.sparql.algebra.op.OpTable opTable) - Specified by:
transformin interfaceorg.apache.jena.sparql.algebra.Transform- Overrides:
transformin classorg.apache.jena.sparql.algebra.TransformCopy
-
extractConstants
public static Map<org.apache.jena.sparql.core.Var,org.apache.jena.graph.Node> extractConstants(org.apache.jena.query.ResultSet rs) Yield all variable-value pairs where the variable is mapped to the same value across all given bindings. The value may be null.- Parameters:
rs-- Returns:
-