Class FragmentJoiner
java.lang.Object
org.aksw.jenax.sparql.fragment.impl.FragmentJoiner
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<org.apache.jena.sparql.core.Var>protected Fragmentprotected List<org.apache.jena.sparql.core.Var>protected Fragmentprotected booleanIdea 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 Summary
ConstructorsConstructorDescriptionFragmentJoiner(Fragment attrRelation, List<org.apache.jena.sparql.core.Var> attrJoinVars) FragmentJoiner(Fragment attrRelation, List<org.apache.jena.sparql.core.Var> attrJoinVars, boolean filterRelationFirst) -
Method Summary
Modifier and TypeMethodDescriptionaddAttrJoinVar(org.apache.jena.sparql.core.Var var) filterRelationFirst(boolean onOrOff) static FragmentJoinerstatic FragmentJoinerget()Perform variable renaming according the configuration and yield a resulting element.static <T> TprojectSrcVars(org.apache.jena.sparql.core.Var... vars) projectTgtVars(org.apache.jena.sparql.core.Var... vars) voidresolveConflicts(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) Join with null is a no-op - i.e.Only yield the renamed filter portion of a 'join': newFilter = attrRelation.joinOn(vars).yieldRenamedFilter(filter);
-
Field Details
-
attrRelation
-
attrJoinVars
-
filterRelation
-
filterJoinVars
-
filterRelationFirst
protected boolean filterRelationFirst -
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
-
FragmentJoiner
-
-
Method Details
-
from
-
from
-
addAttrJoinVar
-
filterRelationFirst
-
projectSrcVars
-
projectTgtVars
-
with
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
-
yieldRenamedFilter
-
yieldRenamedFilterCore
Only yield the renamed filter portion of a 'join': newFilter = attrRelation.joinOn(vars).yieldRenamedFilter(filter);- Returns:
-
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
-
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)
-