Class PropertyFunctionPathFinder
java.lang.Object
org.apache.jena.sparql.pfunction.PropertyFunctionBase
org.apache.jena.sparql.pfunction.PropertyFunctionEval
org.aksw.jena_sparql_api.sparql_path2.PropertyFunctionPathFinder
- All Implemented Interfaces:
org.apache.jena.sparql.pfunction.PropertyFunction
public class PropertyFunctionPathFinder
extends org.apache.jena.sparql.pfunction.PropertyFunctionEval
Select ?path {
?s path:find (?expr ?path ?target ?k)
}
- ?s: The start node for which to find paths
- ?expr: A string representation of a property expression
- ?path: The target variable, this variable will be bound to
- ?target: A target node the property path must terminate it
- ?k: How many paths, ordered by length, to retrieve
- Author:
- raven
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Function<org.aksw.jenax.dataaccess.sparql.datasource.RDFDataSource,SparqlKShortestPathFinder> static final Stringstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionPropertyFunctionPathFinder(Function<org.aksw.jenax.dataaccess.sparql.datasource.RDFDataSource, SparqlKShortestPathFinder> dataSourceToPathFinder) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.jena.sparql.engine.QueryIteratorexecEvaluated(org.apache.jena.sparql.engine.binding.Binding binding, org.apache.jena.sparql.pfunction.PropFuncArg argSubject, org.apache.jena.graph.Node predicate, org.apache.jena.sparql.pfunction.PropFuncArg argObject, org.apache.jena.sparql.engine.ExecutionContext execCxt) static org.aksw.jenax.arq.util.node.NodeListpathToNodeList(org.aksw.commons.util.triplet.TripletPath<org.apache.jena.graph.Node, org.aksw.commons.util.Directed<org.apache.jena.graph.Node>> path) The result array for a path is always: [ start, end, (property, direction, target)* ] This way, the edges of a path can be iterated usingMethods inherited from class org.apache.jena.sparql.pfunction.PropertyFunctionEval
execMethods inherited from class org.apache.jena.sparql.pfunction.PropertyFunctionBase
build, exec
-
Field Details
-
NORSE_NS
- See Also:
-
DEFAULT_IRI
- See Also:
-
dataSourceToPathFinder
protected Function<org.aksw.jenax.dataaccess.sparql.datasource.RDFDataSource,SparqlKShortestPathFinder> dataSourceToPathFinder
-
-
Constructor Details
-
PropertyFunctionPathFinder
public PropertyFunctionPathFinder(Function<org.aksw.jenax.dataaccess.sparql.datasource.RDFDataSource, SparqlKShortestPathFinder> dataSourceToPathFinder)
-
-
Method Details
-
execEvaluated
public org.apache.jena.sparql.engine.QueryIterator execEvaluated(org.apache.jena.sparql.engine.binding.Binding binding, org.apache.jena.sparql.pfunction.PropFuncArg argSubject, org.apache.jena.graph.Node predicate, org.apache.jena.sparql.pfunction.PropFuncArg argObject, org.apache.jena.sparql.engine.ExecutionContext execCxt) - Specified by:
execEvaluatedin classorg.apache.jena.sparql.pfunction.PropertyFunctionEval
-
pathToNodeList
public static org.aksw.jenax.arq.util.node.NodeList pathToNodeList(org.aksw.commons.util.triplet.TripletPath<org.apache.jena.graph.Node, org.aksw.commons.util.Directed<org.apache.jena.graph.Node>> path) The result array for a path is always: [ start, end, (property, direction, target)* ] This way, the edges of a path can be iterated usingBIND(array:size(?path) AS n) (2 ?n 3) number:range ?idx BIND(array:get(?path, ?idx) AS ?property) BIND(array:get(?path, ?idx + 1) AS ?direction) BIND(array:get(?path, ?idx + 2) AS ?target)
- Parameters:
path-- Returns:
-