Class RelationletJoinerImpl<T extends Relationlet>

Type Parameters:
T -
All Implemented Interfaces:
Relationlet
Direct Known Subclasses:
PathletJoinerImpl

public class RelationletJoinerImpl<T extends Relationlet> extends RelationletBaseWithMutableFixedVars
We need to take care to distinguish between relationlets and relationlet entries: The some relationlet object can appear in a tree under different paths of aliases. (With Jena, we previously copied algebraic expressions -- Op trees -- in order to ensure no two sub-expressions are equal by reference) In our case, it is the RelationletEntry objects that are unique. There can be a VarRef to an PathletEntrys' targetVar - but not to the target
Author:
raven
  • Field Details

    • labelToRe

      protected Map<String,RelationletEntry<? extends T extends Relationlet>> labelToRe
    • postProcessor

      protected Function<? super org.apache.jena.sparql.syntax.ElementGroup,? extends org.apache.jena.sparql.syntax.Element> postProcessor
    • exprs

      protected List<org.apache.jena.sparql.expr.Expr> exprs
      Filter expressions such as for theta-joins TODO Not yet supported
  • Constructor Details

    • RelationletJoinerImpl

      public RelationletJoinerImpl()
    • RelationletJoinerImpl

      public RelationletJoinerImpl(Function<? super org.apache.jena.sparql.syntax.ElementGroup,? extends org.apache.jena.sparql.syntax.Element> postProcessor)
  • Method Details

    • flatten

      public static Stream<org.apache.jena.sparql.syntax.Element> flatten(Stream<org.apache.jena.sparql.syntax.Element> stream)
    • flatten

      public static org.apache.jena.sparql.syntax.Element flatten(org.apache.jena.sparql.syntax.Element e)
    • getPostProcessor

      public Function<? super org.apache.jena.sparql.syntax.ElementGroup,? extends org.apache.jena.sparql.syntax.Element> getPostProcessor()
    • setMaterializeElementPostProcessor

      public void setMaterializeElementPostProcessor(Function<? super org.apache.jena.sparql.syntax.ElementGroup,? extends org.apache.jena.sparql.syntax.Element> postProcessor)
    • getLabelForRelationlet

      public String getLabelForRelationlet(Object obj)
    • expose

      public void expose(String exposedName, String alias, String varName)
    • add

      public <U extends T> RelationletEntry<U> add(U item)
    • add

      public <U extends T> RelationletEntry<U> add(String label, U item)
    • getConflictingVars

      public void getConflictingVars()
      Yield the set of variables that at least two members have in commen (TODO add condition: and are not being joined on?!)
    • getNonConflictingVars

      public void getNonConflictingVars()
      Yield the set of variables that are unqiue to a single member, hence a request to it is unambiguous.
    • find

      public List<String> find(RelationletEntry<?> entry)
    • find

      public static org.aksw.commons.collections.stacks.NestedStack<String> find(RelationletEntry<?> entry, RelationletEntry<?> current, org.aksw.commons.collections.stacks.NestedStack<String> stack)
      Recursively search for a given relationlet entry and return its path of aliases if it exists - null otherwise
      Parameters:
      o -
      Returns:
    • matVarRef

      public VarRefStatic matVarRef(Object varRef)
    • toVarRefs

      public static List<VarRef> toVarRefs(String alias, List<org.apache.jena.sparql.core.Var> vars)
    • addJoin

      public void addJoin(VarRef lhsVarRef, VarRef rhsVarRef)
    • addJoin

      public void addJoin(String lhsAlias, List<org.apache.jena.sparql.core.Var> lhsVars, String rhsAlias, List<org.apache.jena.sparql.core.Var> rhsVars)
    • effective

      public Fragment effective()
    • getMemberByLabel

      public RelationletEntry<? extends T> getMemberByLabel(String label)
    • resolveMat

      public static VarRefStatic resolveMat(Map<String,RelationletSimple> map, VarRefStatic varRef)
    • resolveMatCore

      public static Map.Entry<String,org.apache.jena.sparql.core.Var> resolveMatCore(Map<String,RelationletSimple> map, VarRefStatic varRef)
      Resolve a variable against a map of materialized relationlets
      Parameters:
      map -
      varRef -
      Returns:
    • materialize

      public RelationletSimple materialize()
      Create a snapshot of any referenced relationlet
    • getVarsMentioned

      public Set<org.apache.jena.sparql.core.Var> getVarsMentioned()