Class ElementNode

java.lang.Object
org.aksw.jenax.graphql.sparql.v2.model.ElementNode
All Implemented Interfaces:
ConnectiveNode, RdfTraversable<ElementNode>, Selection, SparqlPathTraversable<ElementNode>

public class ElementNode extends Object implements Selection, SparqlPathTraversable<ElementNode>
The attributes of the node are static, but the children are mutable.
  • Field Details

    • label

      protected String label
      A label that serves as a basis for allocating names when a node becomes a child of another. May be null.
    • connective

      protected Connective connective
      Connective: graph pattern with default source and target vars. The defaults can be overridden.
    • offset

      protected Long offset
    • limit

      protected Long limit
    • identifier

      protected String identifier
      An RDF term that identifies this node. Should be suitable for use as a discriminator value when generating queries.
    • localTransforms

      protected List<ElementTransform> localTransforms
    • treeTransforms

      protected List<ElementTransform> treeTransforms
      List of transformations that apply to the whole subtree of the assembled query. For example, wrapping them in a GRAPH or SERVICE block. Transformers should declare any variables they introduce and they must not invalidate existing ones.
    • binds

      protected org.apache.jena.sparql.core.VarExprList binds
      Bind expressions, can reference variables in any ancestor.
    • localTargetVars

      protected List<org.apache.jena.sparql.core.Var> localTargetVars
  • Constructor Details

  • Method Details

    • getLocalTargetVars

      public List<org.apache.jena.sparql.core.Var> getLocalTargetVars()
    • setLocalTargetVars

      public ElementNode setLocalTargetVars(List<org.apache.jena.sparql.core.Var> localTargetVars)
    • getEffectiveTargetVars

      public List<org.apache.jena.sparql.core.Var> getEffectiveTargetVars()
    • getParentLink

      public ElementNode.ParentLink getParentLink()
    • findVarInAncestors

      public ElementNode findVarInAncestors(org.apache.jena.sparql.core.Var var)
      Starting from this node and moving up its ancestors, find the first node which declares var. Returns null if there is no match.
    • getSelections

      @Deprecated public List<Selection> getSelections()
      Deprecated.
    • getLabel

      public String getLabel()
    • isRoot

      public boolean isRoot()
    • setLabel

      public ElementNode setLabel(String label)
    • getAssignedName

      public String getAssignedName()
      Get the name by which this node is referenced by the parent. null for the root node.
    • getName

      public String getName()
      Specified by:
      getName in interface Selection
    • getConnective

      public Connective getConnective()
    • getJoinLink

      public ElementNode.JoinLink getJoinLink()
      Get link by which this node's variables joins to those of the parent. null if there is no parent.
    • getIdentifier

      public String getIdentifier()
    • setIdentifier

      public ElementNode setIdentifier(String identifier)
      The identifier is a string to that it can be used both as a prefix for variables as well as string literals in a result set.
    • getBinds

      public org.apache.jena.sparql.core.VarExprList getBinds()
    • accept

      public <T> T accept(ConnectiveVisitor<T> visitor)
      Specified by:
      accept in interface ConnectiveNode
    • toString

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

      public Map<String,ElementNode.JoinLink> getChildrenByName()
    • step

      public ElementNode step(org.apache.jena.sparql.path.Path path)
      Convenience function to produce a new ElementNode that is immediately attached to this node.
      Specified by:
      step in interface SparqlPathTraversable<ElementNode>
    • addChild

      public ElementNode addChild(ElementNode child)
    • prepareChild

      public ElementNode.ChildAdder prepareChild()
    • addChild

      public ElementNode addChild(List<org.apache.jena.sparql.core.Var> thisVars, ElementNode child)
      Parameters:
      child -
      thisVars - The variables of this to which the child's default source variables should join.
    • setLimit

      public ElementNode setLimit(Long limit)
    • getLimit

      public Long getLimit()
    • setOffset

      public ElementNode setOffset(Long offset)
    • getOffset

      public Long getOffset()
    • addChild

      public ElementNode addChild(List<org.apache.jena.sparql.core.Var> thisVars, ElementNode child, List<org.apache.jena.sparql.core.Var> childVars)
      Add a child with the given join condition. Returns this (not the child)
    • addChildInternal

      protected void addChildInternal(String finalName, List<org.apache.jena.sparql.core.Var> thisVars, ElementNode child, List<org.apache.jena.sparql.core.Var> childVars)
    • getLocalTransforms

      public List<ElementTransform> getLocalTransforms()
    • getTreeTransforms

      public List<ElementTransform> getTreeTransforms()
    • addLocalTransform

      public ElementNode addLocalTransform(ElementTransform elementTransform)
    • addTreeTransform

      public ElementNode addTreeTransform(ElementTransform elementTransform)
    • adaptName

      public static String adaptName(ElementNode parent, String label)
    • of

      public static ElementNode of(Connective connective)
    • of

      public static ElementNode of(String label, Connective connective)
    • clone

      public ElementNode clone()
      Adjusts the name in the builder
      Overrides:
      clone in class Object