Class NodeQueryImpl

java.lang.Object
org.aksw.jenax.facete.treequery2.impl.NodeQueryBase
org.aksw.jenax.facete.treequery2.impl.NodeQueryImpl
All Implemented Interfaces:
FacetTraversable<NodeQuery>, HasSlice, NodeQuery, Selection, Sortable<NodeQuery>, org.aksw.jenax.path.core.HasFacetPath

public class NodeQueryImpl extends NodeQueryBase implements NodeQuery
A root node corresponds to a variable of a graph pattern.
  • Field Details

    • relationQuery

      protected RelationQuery relationQuery
    • var

      protected org.apache.jena.sparql.core.Var var
    • reachingStep

      protected org.aksw.jenax.path.core.FacetStep reachingStep
    • children

      protected Map<org.aksw.jenax.path.core.FacetStep,RelationQuery> children
      Facet steps with type TUPLE point to relations
    • subPaths

      protected Map<org.aksw.jenax.path.core.FacetStep,NodeQuery> subPaths
      Facet steps with a specific target node
    • constraintRoot

      protected ConstraintNode<NodeQuery> constraintRoot
    • filterRelation

      protected Fragment1 filterRelation
      Upon query generation, inject the given graph pattern
    • injectRelations

      protected List<MappedFragment<org.apache.jena.graph.Node>> injectRelations
      Extra sparql fragments injected at this node FIXME Each relation must carry a mapping for how its variables map to facet paths
  • Constructor Details

    • NodeQueryImpl

      public NodeQueryImpl(RelationQueryImpl relationQuery, org.apache.jena.sparql.core.Var var, org.aksw.jenax.path.core.FacetStep reachingStep)
  • Method Details

    • addFragment

      public NodeQuery addFragment()
      Specified by:
      addFragment in interface NodeQuery
    • addInjectFragment

      public NodeQuery addInjectFragment(MappedFragment<org.apache.jena.graph.Node> relation)
      Description copied from interface: NodeQuery
      Inject a relation to this node. TODO Consolidate with GraphQlToSparqlConverter; currently the variable mapping is done there
      Specified by:
      addInjectFragment in interface NodeQuery
      Returns:
    • getInjectFragments

      public List<MappedFragment<org.apache.jena.graph.Node>> getInjectFragments()
      Specified by:
      getInjectFragments in interface NodeQuery
    • getParent

      public NodeQuery getParent()
      Specified by:
      getParent in interface FacetTraversable<NodeQuery>
      Specified by:
      getParent in interface Selection
    • setFilterFragment

      public NodeQuery setFilterFragment(Fragment1 filterRelation)
      Description copied from interface: NodeQuery
      Sets a graph pattern which is used to 'filter' the values of this node. If the filter pattern can be evaluated to a result set then it results in a set intersection between that result set's column and this node's result set column. If the filter pattern is a filter, then this node's result set is filtered by it.
      Specified by:
      setFilterFragment in interface NodeQuery
    • getFilterFragment

      public Fragment1 getFilterFragment()
      Specified by:
      getFilterFragment in interface NodeQuery
    • constraints

      public ConstraintNode<NodeQuery> constraints()
      Specified by:
      constraints in interface NodeQuery
    • sort

      public NodeQuery sort(int sortDirection)
      Description copied from interface: Sortable
      Updates or adds the first sort condition of this query node's variable in the list of sort conditions
      Specified by:
      sort in interface Sortable<NodeQuery>
    • getSortDirection

      public int getSortDirection()
      Description copied from interface: Sortable
      Returns the direction of the first sort condition that matches this query node's variable
      Specified by:
      getSortDirection in interface Sortable<NodeQuery>
    • children

      public Map<org.aksw.jenax.path.core.FacetStep,RelationQuery> children()
      Specified by:
      children in interface NodeQuery
    • getChildren

      public Collection<NodeQuery> getChildren()
      Description copied from interface: NodeQuery
      A collection of sub-paths of this node
      Specified by:
      getChildren in interface NodeQuery
    • reachingStep

      public org.aksw.jenax.path.core.FacetStep reachingStep()
      Specified by:
      reachingStep in interface NodeQuery
    • resolve

      public NodeQuery resolve(org.aksw.jenax.path.core.FacetPath facetPath)
      The empty path resolves to this node
      Specified by:
      resolve in interface FacetTraversable<NodeQuery>
      Specified by:
      resolve in interface NodeQuery
    • getOrCreateChild

      public NodeQuery getOrCreateChild(org.aksw.jenax.path.core.FacetStep step)
      Description copied from interface: FacetTraversable
      Returns null if there is no child reachable with the given step.
      Specified by:
      getOrCreateChild in interface FacetTraversable<NodeQuery>
    • relationQuery

      public RelationQuery relationQuery()
      Description copied from interface: NodeQuery
      Return the RelationQuery of which this NodeQuery is a view of.
      Specified by:
      relationQuery in interface NodeQuery
    • var

      public org.apache.jena.sparql.core.Var var()
      Description copied from interface: NodeQuery
      Get the variable of the underlying RelationQuery of which this NodeQuery is a view of.
      Specified by:
      var in interface NodeQuery
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • newRoot

      public static NodeQuery newRoot()
      Create a node query rooted in variables ?s of a relation based on an empty graph pattern. The underlying relationQuery is non-null so that projections can be created.
      Returns: