Class FragmentJoiner

java.lang.Object
org.aksw.jenax.sparql.fragment.impl.FragmentJoiner

public class FragmentJoiner extends Object
  • Field Details

    • attrRelation

      protected Fragment attrRelation
    • attrJoinVars

      protected List<org.apache.jena.sparql.core.Var> attrJoinVars
    • filterRelation

      protected Fragment filterRelation
    • filterJoinVars

      protected List<org.apache.jena.sparql.core.Var> filterJoinVars
    • filterRelationFirst

      protected boolean filterRelationFirst
    • varToOrigin

      protected Map<org.apache.jena.sparql.core.Var,Boolean> varToOrigin
      Idea to create a new projection as part of the join creation: addSrcVar and addTgtVar add entries to the linked map varToOrigin origin==false means, use the variable from the lhs of the join origin==true means, use the variable from the rhs of the join
  • Constructor Details

    • FragmentJoiner

      public FragmentJoiner(Fragment attrRelation, List<org.apache.jena.sparql.core.Var> attrJoinVars)
    • FragmentJoiner

      public FragmentJoiner(Fragment attrRelation, List<org.apache.jena.sparql.core.Var> attrJoinVars, boolean filterRelationFirst)
  • Method Details

    • from

      public static FragmentJoiner from(Fragment r, org.apache.jena.sparql.core.Var... vars)
    • from

      public static FragmentJoiner from(Fragment r, List<org.apache.jena.sparql.core.Var> vars)
    • addAttrJoinVar

      public FragmentJoiner addAttrJoinVar(org.apache.jena.sparql.core.Var var)
    • filterRelationFirst

      public FragmentJoiner filterRelationFirst(boolean onOrOff)
    • projectSrcVars

      public FragmentJoiner projectSrcVars(org.apache.jena.sparql.core.Var... vars)
    • projectTgtVars

      public FragmentJoiner projectTgtVars(org.apache.jena.sparql.core.Var... vars)
    • with

      public Fragment with(Fragment c, org.apache.jena.sparql.core.Var... joinVars)
      Join with null is a no-op - i.e. it yields the original relation
      Parameters:
      c -
      joinVars - If empty, all vars of c will be used for the join
      Returns:
    • with

      public Fragment with(Fragment1 ur)
    • yieldRenamedFilter

      public Fragment yieldRenamedFilter(Fragment c)
    • yieldRenamedFilterCore

      public Fragment yieldRenamedFilterCore()
      Only yield the renamed filter portion of a 'join': newFilter = attrRelation.joinOn(vars).yieldRenamedFilter(filter);
      Returns:
    • get

      public Fragment get()
      Perform variable renaming according the configuration and yield a resulting element. By default, all variables of lhs are considered fixed, whereas all variables of rhs are subject to renaming. TODO This method could use some clean up. If we have { ?s ?p ?o }(?s) join { ?p ?s ?o }(?p) we not only have to map rhs.?p->?s, but also add rhs.?s -> freshVar So after having set up rhs join var map, for each rhs.var that maps to a var which is exists in rhs.mentionedVars, remap it to a fresh variable If we have { ?s ?p ?o }(?s, ?p) join { ?p ?s ?o }(?p, ?s) { ?s ?p ?o } { ?s ?p ?x }
      Returns:
    • pop

      public static <T> T pop(Iterable<T> items)
    • resolveConflicts

      public void resolveConflicts(Set<org.apache.jena.sparql.core.Var> rhsVarsMentioned, Set<org.apache.jena.sparql.core.Var> rhsFixedVars, Set<org.apache.jena.sparql.core.Var> conflictVars, Map<org.apache.jena.sparql.core.Var,org.apache.jena.sparql.core.Var> lhsMap, Map<org.apache.jena.sparql.core.Var,org.apache.jena.sparql.core.Var> rhsMap, org.aksw.commons.collections.generator.Generator<org.apache.jena.sparql.core.Var> gen)