Class QuerySolutionUtils

java.lang.Object
org.aksw.jenax.arq.util.binding.QuerySolutionUtils

public class QuerySolutionUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.jena.query.QuerySolution
    applyNodeTransformToKeys(org.apache.jena.sparql.graph.NodeTransform nodeTransform, org.apache.jena.query.QuerySolution qs)
    Applys a node transform to the variables acting as the keys of the query soluton.
    static Function<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.query.QuerySolution>
    newGraphAwareBindingMapper(org.apache.jena.query.Dataset dataset, String nodeVarName, String graphVarName)
    static Function<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.query.QuerySolution>
    newGraphAwareBindingMapper(org.apache.jena.query.Dataset dataset, Map<org.apache.jena.sparql.core.Var,org.apache.jena.sparql.core.Var> nodeVarToGraphVar)
    By default, jena places all rdf nodes in query solutions in the default graph.
    static org.apache.jena.query.QuerySolution
    renameKeys(org.apache.jena.query.QuerySolution qs, Map<org.apache.jena.sparql.core.Var,org.apache.jena.sparql.core.Var> varMap)
     

    Methods inherited from class java.lang.Object

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

    • QuerySolutionUtils

      public QuerySolutionUtils()
  • Method Details

    • applyNodeTransformToKeys

      public static org.apache.jena.query.QuerySolution applyNodeTransformToKeys(org.apache.jena.sparql.graph.NodeTransform nodeTransform, org.apache.jena.query.QuerySolution qs)
      Applys a node transform to the variables acting as the keys of the query soluton. At present always returns a new QuerySolutionMap which retains the original RDFNodes and their models. In principle if the argument is a ResultBinding we could use node transform on the Binding, but unfortunately ResultBinding does not provide a public method to retrieve the model
    • renameKeys

      public static org.apache.jena.query.QuerySolution renameKeys(org.apache.jena.query.QuerySolution qs, Map<org.apache.jena.sparql.core.Var,org.apache.jena.sparql.core.Var> varMap)
    • newGraphAwareBindingMapper

      public static Function<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.query.QuerySolution> newGraphAwareBindingMapper(org.apache.jena.query.Dataset dataset, String nodeVarName, String graphVarName)
    • newGraphAwareBindingMapper

      public static Function<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.query.QuerySolution> newGraphAwareBindingMapper(org.apache.jena.query.Dataset dataset, Map<org.apache.jena.sparql.core.Var,org.apache.jena.sparql.core.Var> nodeVarToGraphVar)
      By default, jena places all rdf nodes in query solutions in the default graph. This prohibits changing information of a resource in its originating graph. This mapper allows to specify a mapping where a variable is mapped to another one whose values represents graph names. If a variable is mapped to null then the default graph is used.
      Parameters:
      dataset -
      nodeVarToGraphVar -
      Returns: