Class AggObjectGraph

java.lang.Object
org.aksw.jena_sparql_api.rx.AggObjectGraph
All Implemented Interfaces:
org.aksw.commons.collector.domain.Aggregator<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.sparql.function.FunctionEnv,org.apache.jena.graph.Graph>

public class AggObjectGraph extends Object implements org.aksw.commons.collector.domain.Aggregator<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.sparql.function.FunctionEnv,org.apache.jena.graph.Graph>
An aggregator whose accumulators create RDF graphs (triples) from the bindings passed to them. At the core this is exactly that of SPARQL construct query, however this class supports an extension: Blank nodes of the template can be remapped via a custom function based on the binding. Template blank nodes that aree not remapped by the function will be mapped to fresh blank nodes on every binding.
Author:
raven
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected Supplier<org.apache.jena.graph.Graph>
     
    protected Map<org.apache.jena.graph.Node,? extends Function<? super org.apache.jena.sparql.engine.binding.Binding,? extends org.apache.jena.graph.Node>>
    Mapping of a subset of the bnodes in the template to functions that generate a local id from a binding passed to this accumulator
    protected org.apache.jena.sparql.syntax.Template
     
    protected Set<? extends org.apache.jena.graph.Node>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AggObjectGraph(org.apache.jena.sparql.syntax.Template template, Set<? extends org.apache.jena.graph.Node> trackedTemplateNodes, Supplier<org.apache.jena.graph.Graph> graphSupplier, Map<org.apache.jena.graph.Node,? extends Function<? super org.apache.jena.sparql.engine.binding.Binding,? extends org.apache.jena.graph.Node>> nodeIdGenMap)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.aksw.commons.collector.domain.Aggregator

    accumulateAll, accumulateAll, accumulateAll, finish
  • Field Details

    • template

      protected org.apache.jena.sparql.syntax.Template template
    • nodeIdGenMap

      protected Map<org.apache.jena.graph.Node,? extends Function<? super org.apache.jena.sparql.engine.binding.Binding,? extends org.apache.jena.graph.Node>> nodeIdGenMap
      Mapping of a subset of the bnodes in the template to functions that generate a local id from a binding passed to this accumulator
    • graphSupplier

      protected Supplier<org.apache.jena.graph.Graph> graphSupplier
    • trackedTemplateNodes

      protected Set<? extends org.apache.jena.graph.Node> trackedTemplateNodes
  • Constructor Details

    • AggObjectGraph

      public AggObjectGraph(org.apache.jena.sparql.syntax.Template template, Set<? extends org.apache.jena.graph.Node> trackedTemplateNodes, Supplier<org.apache.jena.graph.Graph> graphSupplier, Map<org.apache.jena.graph.Node,? extends Function<? super org.apache.jena.sparql.engine.binding.Binding,? extends org.apache.jena.graph.Node>> nodeIdGenMap)
  • Method Details

    • createAccumulator

      public AggObjectGraph.AccObjectGraph createAccumulator()
      Specified by:
      createAccumulator in interface org.aksw.commons.collector.domain.Aggregator<org.apache.jena.sparql.engine.binding.Binding,org.apache.jena.sparql.function.FunctionEnv,org.apache.jena.graph.Graph>