public class RdfViewSystem2 extends Object implements RdfViewSystem
| Constructor and Description |
|---|
RdfViewSystem2() |
| Modifier and Type | Method and Description |
|---|---|
com.hp.hpl.jena.sparql.algebra.Op |
_getApplicableViews(com.hp.hpl.jena.sparql.algebra.Op op)
Given a sparql query in quad form, this method replaces
(sub sets of) quad patterns with view instances (view patterns)
The method also passes the filter conditions that an op must
satisfy.
|
com.hp.hpl.jena.sparql.algebra.Op |
_getApplicableViews(com.hp.hpl.jena.sparql.algebra.Op op,
RestrictionManagerImpl restrictions) |
void |
addView(RdfView view) |
static StartsWithConstraint |
deriveConstraint(com.hp.hpl.jena.sparql.expr.E_StrConcat expr) |
static StartsWithConstraint |
deriveConstraint(E_StrConcatPermissive expr) |
static Constraint |
deriveConstraint(com.hp.hpl.jena.sparql.expr.Expr expr) |
static StartsWithConstraint |
deriveConstraintConcat(com.hp.hpl.jena.sparql.expr.ExprFunction concat) |
static VariableConstraint |
deriveIsPrefixOfConstraint(com.hp.hpl.jena.sparql.expr.Expr a,
com.hp.hpl.jena.sparql.expr.Expr b)
If a variable equals a (uri or string) constant, it means that the view must provide
a prefix for that value.
|
void |
deriveRestrictions(RdfView view)
Derive prefix constraints for variables based on
variable definitions:
concat('constant', var, rest) -> prefix = 'constant'
TODO: Actually we should not add these constraints to the view, but just return them
|
Map<com.hp.hpl.jena.sparql.core.Var,RdfTermType> |
deriveTypeConstraints(RdfView view) |
static VariableConstraint |
deriveViewLookupConstraint(com.hp.hpl.jena.sparql.expr.Expr expr)
Returns IsPrefixOf Constraints for equality expressions between variables and constants.
|
static RestrictionManagerImpl |
filterRestrictionsBound(RestrictionManagerImpl restrictions)
Create a new retrictions manager, where "bound" retrictions are removed
|
Set<org.aksw.sparqlify.database.ViewQuad> |
findCandidates(com.hp.hpl.jena.sparql.core.Quad quad,
RestrictionManagerImpl restrictions) |
org.aksw.commons.util.Pair<NavigableMap<Integer,Set<com.hp.hpl.jena.sparql.core.Quad>>,Map<com.hp.hpl.jena.sparql.core.Quad,Set<org.aksw.sparqlify.database.ViewQuad>>> |
findQuadWithFewestViewCandidates(com.hp.hpl.jena.sparql.core.QuadPattern queryQuads,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpDistinct op,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpExtend op,
RestrictionManagerImpl _restrictions)
We treat OpExtend as a filter for now
TODO This breaks for instance Count(*) as Jena also does renaming with extend:
Jena generates
Project(?c, Extend(?c, ?x, Group(Count(*) As ?x)))
So in this case, extend creates a new alias for a variable
|
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpFilter op,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpGroup op,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpJoin op,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpLeftJoin op,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpOrder op,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpProject op,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpQuadPattern op,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpSlice op,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpUnion op,
RestrictionManagerImpl restrictions) |
com.hp.hpl.jena.sparql.algebra.Op |
getApplicableViews(com.hp.hpl.jena.query.Query query) |
List<RdfViewConjunction> |
getApplicableViewsBase(com.hp.hpl.jena.sparql.algebra.op.OpQuadPattern op,
RestrictionManagerImpl restrictions)
Order the quads of the quadPattern by selectivity.
|
void |
getApplicableViewsRec2(int index,
List<com.hp.hpl.jena.sparql.core.Quad> quadOrder,
Set<org.aksw.sparqlify.database.ViewQuad> viewQuads,
Map<com.hp.hpl.jena.sparql.core.Quad,Set<org.aksw.sparqlify.database.ViewQuad>> candidates,
RestrictionManagerImpl restrictions,
org.aksw.sparqlify.database.NestedStack<RdfViewInstance> instances,
List<RdfViewConjunction> result) |
static List<String> |
getCandidateNames(org.aksw.sparqlify.database.NestedStack<RdfViewInstance> instances) |
static List<RestrictionManagerImpl> |
getRestrictions(com.hp.hpl.jena.sparql.algebra.Op op) |
static void |
getRestrictions(com.hp.hpl.jena.sparql.algebra.Op op,
Collection<RestrictionManagerImpl> result)
Returns a disjunction (list) of restrictions that apply for a given node
|
static RestrictionManagerImpl |
getRestrictions2(com.hp.hpl.jena.sparql.algebra.Op op) |
static RdfTermType |
getType(com.hp.hpl.jena.graph.Node node,
RestrictionManagerImpl restrictions) |
Collection<RdfView> |
getViews() |
static boolean |
isSatisfiable(List<RdfViewInstance> list) |
public void addView(RdfView view)
addView in interface RdfViewSystempublic static Constraint deriveConstraint(com.hp.hpl.jena.sparql.expr.Expr expr)
public static StartsWithConstraint deriveConstraint(com.hp.hpl.jena.sparql.expr.E_StrConcat expr)
public static StartsWithConstraint deriveConstraint(E_StrConcatPermissive expr)
public static StartsWithConstraint deriveConstraintConcat(com.hp.hpl.jena.sparql.expr.ExprFunction concat)
public Map<com.hp.hpl.jena.sparql.core.Var,RdfTermType> deriveTypeConstraints(RdfView view)
public void deriveRestrictions(RdfView view)
public static RdfTermType getType(com.hp.hpl.jena.graph.Node node, RestrictionManagerImpl restrictions)
public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.query.Query query)
getApplicableViews in interface RdfViewSystempublic static VariableConstraint deriveIsPrefixOfConstraint(com.hp.hpl.jena.sparql.expr.Expr a, com.hp.hpl.jena.sparql.expr.Expr b)
a - b - public static VariableConstraint deriveViewLookupConstraint(com.hp.hpl.jena.sparql.expr.Expr expr)
expr - public List<RdfViewConjunction> getApplicableViewsBase(com.hp.hpl.jena.sparql.algebra.op.OpQuadPattern op, RestrictionManagerImpl restrictions)
public Set<org.aksw.sparqlify.database.ViewQuad> findCandidates(com.hp.hpl.jena.sparql.core.Quad quad, RestrictionManagerImpl restrictions)
public org.aksw.commons.util.Pair<NavigableMap<Integer,Set<com.hp.hpl.jena.sparql.core.Quad>>,Map<com.hp.hpl.jena.sparql.core.Quad,Set<org.aksw.sparqlify.database.ViewQuad>>> findQuadWithFewestViewCandidates(com.hp.hpl.jena.sparql.core.QuadPattern queryQuads, RestrictionManagerImpl restrictions)
public static List<String> getCandidateNames(org.aksw.sparqlify.database.NestedStack<RdfViewInstance> instances)
public void getApplicableViewsRec2(int index,
List<com.hp.hpl.jena.sparql.core.Quad> quadOrder,
Set<org.aksw.sparqlify.database.ViewQuad> viewQuads,
Map<com.hp.hpl.jena.sparql.core.Quad,Set<org.aksw.sparqlify.database.ViewQuad>> candidates,
RestrictionManagerImpl restrictions,
org.aksw.sparqlify.database.NestedStack<RdfViewInstance> instances,
List<RdfViewConjunction> result)
index - quadOrder - viewQuads - The viewQuads provided by the parent invocation - with any restrictions encountered during the rewrite taken into accountcandidates - The viewQuads here are the ones from only analyzing the query filter
In some cases (small candidate sets) it might be faster filtering this set of view candidates, rather than doing a new lookup.restrictions - result - public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpQuadPattern op,
RestrictionManagerImpl restrictions)
public static boolean isSatisfiable(List<RdfViewInstance> list)
public com.hp.hpl.jena.sparql.algebra.Op _getApplicableViews(com.hp.hpl.jena.sparql.algebra.Op op)
op - public com.hp.hpl.jena.sparql.algebra.Op _getApplicableViews(com.hp.hpl.jena.sparql.algebra.Op op,
RestrictionManagerImpl restrictions)
public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpProject op,
RestrictionManagerImpl restrictions)
public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpOrder op,
RestrictionManagerImpl restrictions)
public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpGroup op,
RestrictionManagerImpl restrictions)
public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpExtend op,
RestrictionManagerImpl _restrictions)
public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpFilter op,
RestrictionManagerImpl restrictions)
public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpUnion op,
RestrictionManagerImpl restrictions)
public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpJoin op,
RestrictionManagerImpl restrictions)
public static RestrictionManagerImpl filterRestrictionsBound(RestrictionManagerImpl restrictions)
restrictions - public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpLeftJoin op,
RestrictionManagerImpl restrictions)
public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpSlice op,
RestrictionManagerImpl restrictions)
public com.hp.hpl.jena.sparql.algebra.Op getApplicableViews(com.hp.hpl.jena.sparql.algebra.op.OpDistinct op,
RestrictionManagerImpl restrictions)
public static RestrictionManagerImpl getRestrictions2(com.hp.hpl.jena.sparql.algebra.Op op)
public static List<RestrictionManagerImpl> getRestrictions(com.hp.hpl.jena.sparql.algebra.Op op)
public static void getRestrictions(com.hp.hpl.jena.sparql.algebra.Op op,
Collection<RestrictionManagerImpl> result)
public Collection<RdfView> getViews()
getViews in interface RdfViewSystemCopyright © 2013. All Rights Reserved.