Class RelationletJoinerImpl<T extends Relationlet>
java.lang.Object
org.aksw.jena_sparql_api.relationlet.RelationletBase
org.aksw.jena_sparql_api.relationlet.RelationletBaseWithMutableFixedVars
org.aksw.jena_sparql_api.relationlet.RelationletJoinerImpl<T>
- 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 Summary
FieldsModifier and TypeFieldDescriptionprotected List<org.apache.jena.sparql.expr.Expr>Filter expressions such as for theta-joins TODO Not yet supportedprotected Map<String,RelationletEntry<? extends T>> protected Function<? super org.apache.jena.sparql.syntax.ElementGroup,? extends org.apache.jena.sparql.syntax.Element> Fields inherited from class org.aksw.jena_sparql_api.relationlet.RelationletBaseWithMutableFixedVars
exposedVars, fixedVars -
Constructor Summary
ConstructorsConstructorDescriptionRelationletJoinerImpl(Function<? super org.apache.jena.sparql.syntax.ElementGroup, ? extends org.apache.jena.sparql.syntax.Element> postProcessor) -
Method Summary
Modifier and TypeMethodDescription<U extends T>
RelationletEntry<U><U extends T>
RelationletEntry<U>add(U item) voidaddJoin(String lhsAlias, List<org.apache.jena.sparql.core.Var> lhsVars, String rhsAlias, List<org.apache.jena.sparql.core.Var> rhsVars) voidvoidfind(RelationletEntry<?> entry) 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 otherwisestatic Stream<org.apache.jena.sparql.syntax.Element>static org.apache.jena.sparql.syntax.Elementflatten(org.apache.jena.sparql.syntax.Element e) voidYield the set of variables that at least two members have in commen (TODO add condition: and are not being joined on?!)RelationletEntry<? extends T>getMemberByLabel(String label) voidYield the set of variables that are unqiue to a single member, hence a request to it is unambiguous.Function<? super org.apache.jena.sparql.syntax.ElementGroup,? extends org.apache.jena.sparql.syntax.Element> Set<org.apache.jena.sparql.core.Var>Create a snapshot of any referenced relationletstatic VarRefStaticresolveMat(Map<String, RelationletSimple> map, VarRefStatic varRef) resolveMatCore(Map<String, RelationletSimple> map, VarRefStatic varRef) Resolve a variable against a map of materialized relationletsvoidsetMaterializeElementPostProcessor(Function<? super org.apache.jena.sparql.syntax.ElementGroup, ? extends org.apache.jena.sparql.syntax.Element> postProcessor) Methods inherited from class org.aksw.jena_sparql_api.relationlet.RelationletBaseWithMutableFixedVars
getExposedVars, getNestedVarMap, getPinnedVarsMethods inherited from class org.aksw.jena_sparql_api.relationlet.RelationletBase
setPinnedVarMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aksw.jena_sparql_api.relationlet.Relationlet
isPinned, pinAllVars, pinAllVars, pinVar, resolve
-
Field Details
-
labelToRe
-
postProcessor
protected Function<? super org.apache.jena.sparql.syntax.ElementGroup,? extends org.apache.jena.sparql.syntax.Element> postProcessor -
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
-
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
-
expose
-
add
-
add
-
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
-
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
-
toVarRefs
-
addJoin
-
addJoin
-
effective
-
getMemberByLabel
-
resolveMat
-
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
Create a snapshot of any referenced relationlet -
getVarsMentioned
-