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

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Virtuoso 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    org.apache.jena.sparql.algebra.Op
    transform(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • preventEmptyTable

      protected boolean preventEmptyTable
      Virtuoso 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:
      transform in interface org.apache.jena.sparql.algebra.Transform
      Overrides:
      transform in class org.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: