Package org.aksw.jenax.arq.util.node
Class PathUtils
java.lang.Object
org.aksw.jenax.arq.util.node.PathUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.jena.sparql.path.PathA pre-built path for the expressionrdf:type/rdfs:subclassOf*. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jena.sparql.path.P_Path0asStep(org.apache.jena.sparql.path.Path path) Return null unless path can be casted to P_Path0static booleancanFlatten(org.apache.jena.sparql.core.PathBlock pathBlock) Returns true iff all paths in the path block are instances of P_Path0, i.e.static org.apache.jena.sparql.path.Pathcreate(org.apache.jena.sparql.path.Path path, boolean isFwd) static org.apache.jena.sparql.path.P_Path0createStep(String predicate, boolean isFwd) static org.apache.jena.sparql.path.P_Path0createStep(org.apache.jena.graph.Node predicate, boolean isFwd) static org.apache.jena.sparql.core.BasicPatternflatten(org.apache.jena.sparql.core.PathBlock pathBlock) Flatten the path block w.r.t.static org.apache.jena.sparql.core.BasicPatternflattenOrNull(org.apache.jena.sparql.core.TriplePath triplePath) Flatten the given triple path into a basic pattern if possible.
-
Field Details
-
typeSubclassOf
public static final org.apache.jena.sparql.path.Path typeSubclassOfA pre-built path for the expressionrdf:type/rdfs:subclassOf*.
-
-
Constructor Details
-
PathUtils
public PathUtils()
-
-
Method Details
-
createStep
-
createStep
public static org.apache.jena.sparql.path.P_Path0 createStep(org.apache.jena.graph.Node predicate, boolean isFwd) -
create
public static org.apache.jena.sparql.path.Path create(org.apache.jena.sparql.path.Path path, boolean isFwd) -
asStep
public static org.apache.jena.sparql.path.P_Path0 asStep(org.apache.jena.sparql.path.Path path) Return null unless path can be casted to P_Path0 -
flattenOrNull
public static org.apache.jena.sparql.core.BasicPattern flattenOrNull(org.apache.jena.sparql.core.TriplePath triplePath) Flatten the given triple path into a basic pattern if possible. Returns null if the path cannot be flattened. -
canFlatten
public static boolean canFlatten(org.apache.jena.sparql.core.PathBlock pathBlock) Returns true iff all paths in the path block are instances of P_Path0, i.e. merely forward or reverse links. -
flatten
public static org.apache.jena.sparql.core.BasicPattern flatten(org.apache.jena.sparql.core.PathBlock pathBlock) Flatten the path block w.r.t.canFlatten(PathBlock). Raises a RuntimeException on failure. The caller will most likely wish to rename the variables, such as using:NodeTransformLib.transform(ReverseRenameUtils::effectiveNode, bgp);- Parameters:
pathBlock-- Returns:
-