Package org.aksw.jenax.arq.util.triple
Class TripleUtils
java.lang.Object
org.aksw.jenax.arq.util.triple.TripleUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.jena.graph.TriplebindingToTriple(org.apache.jena.sparql.engine.binding.Binding b) static org.apache.jena.graph.TriplebindingToTriple(org.apache.jena.sparql.engine.binding.Binding b, org.apache.jena.sparql.core.Var vs, org.apache.jena.sparql.core.Var vp, org.apache.jena.sparql.core.Var vo) static intcompare(org.apache.jena.graph.Triple o1, org.apache.jena.graph.Triple o2, Comparator<org.apache.jena.graph.Node> nc) Compare two triples by their nodes.static intcompareRDFTerms(org.apache.jena.graph.Triple o1, org.apache.jena.graph.Triple o2) static org.apache.jena.graph.TriplecopySubstitute(org.apache.jena.graph.Triple quad, org.apache.jena.sparql.engine.binding.Binding binding) static org.apache.jena.graph.Triplecreate(org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o, boolean isForward) static org.apache.jena.graph.Triplecreate(org.apache.jena.graph.Node s, org.apache.jena.sparql.path.P_Path0 p, org.apache.jena.graph.Node o) static org.apache.jena.graph.TriplecreateMatch(org.apache.jena.graph.Node source, org.apache.jena.graph.Node predicate, boolean isForward) Create a matcher for triples having a certain predicate and a source node.static org.apache.jena.graph.TriplecreateMatch(org.apache.jena.graph.Node source, org.apache.jena.sparql.path.P_Path0 predicate) Create a matcher for triples having a certain predicate and a source node.static org.apache.jena.graph.TriplecreateMatch(org.apache.jena.graph.Triple triple, boolean isForward) static org.apache.jena.graph.TriplefromArray(org.apache.jena.graph.Node[] nodes) static org.apache.jena.graph.NodegetNode(org.apache.jena.graph.Triple triple, int idx) Access a triple's component by a zero-based index in order s, p, o.static org.apache.jena.graph.NodegetNode(org.apache.jena.graph.Triple triple, org.apache.jena.sparql.core.mem.TupleSlot slot) static org.apache.jena.graph.NodegetSource(org.apache.jena.graph.Triple triple, boolean isForward) If isForward is true then return the triple's subject otherwise its object.static org.apache.jena.graph.NodegetTarget(org.apache.jena.graph.Triple triple, boolean isForward) If isForward is true then return the triple's object otherwise its subject.static org.apache.jena.sparql.core.mem.TupleSlotidxToSlot(int idx) static booleanisValid(org.apache.jena.graph.Triple t) Returns true if the triple survives a serialization/deserialization round tripstatic booleanisValidAsStatement(org.apache.jena.graph.Triple t) static Iterator<org.apache.jena.graph.Node>iterateNodes(org.apache.jena.graph.Triple t) static org.apache.jena.graph.TriplelistToTriple(List<org.apache.jena.graph.Node> nodes) static org.apache.jena.graph.TriplelogicalAnd(org.apache.jena.graph.Triple a, org.apache.jena.graph.Triple b) Create a logical conjunction from two triple pattern.static Stringmd5sum(org.apache.jena.graph.Triple triple) static intslotToIdx(org.apache.jena.sparql.core.mem.TupleSlot slot) static Stream<org.apache.jena.graph.Node>streamNodes(org.apache.jena.graph.Triple t) static Set<org.apache.jena.graph.Triple>static org.apache.jena.graph.Tripleswap(org.apache.jena.graph.Triple t) static org.apache.jena.graph.Node[]toArray(org.apache.jena.graph.Triple t) static org.apache.jena.sparql.engine.binding.BindingtripleToBinding(org.apache.jena.graph.Triple triple) static org.apache.jena.sparql.engine.binding.BindingtripleToBinding(org.apache.jena.graph.Triple pattern, org.apache.jena.graph.Triple assignment) static org.apache.jena.sparql.engine.binding.BindingtripleToBinding(org.apache.jena.graph.Triple triple, org.apache.jena.sparql.engine.binding.Binding parent) static List<org.apache.jena.graph.Node>tripleToList(org.apache.jena.graph.Triple triple)
-
Constructor Details
-
TripleUtils
public TripleUtils()
-
-
Method Details
-
streamNodes
-
iterateNodes
-
isValidAsStatement
public static boolean isValidAsStatement(org.apache.jena.graph.Triple t) -
getNode
public static org.apache.jena.graph.Node getNode(org.apache.jena.graph.Triple triple, int idx) Access a triple's component by a zero-based index in order s, p, o. RaisesIndexOutOfBoundsExceptionfor any index outside of the range [0, 2] -
idxToSlot
public static org.apache.jena.sparql.core.mem.TupleSlot idxToSlot(int idx) -
slotToIdx
public static int slotToIdx(org.apache.jena.sparql.core.mem.TupleSlot slot) -
getNode
public static org.apache.jena.graph.Node getNode(org.apache.jena.graph.Triple triple, org.apache.jena.sparql.core.mem.TupleSlot slot) -
logicalAnd
public static org.apache.jena.graph.Triple logicalAnd(org.apache.jena.graph.Triple a, org.apache.jena.graph.Triple b) Create a logical conjunction from two triple pattern.- Parameters:
a-b-- Returns:
-
getSource
public static org.apache.jena.graph.Node getSource(org.apache.jena.graph.Triple triple, boolean isForward) If isForward is true then return the triple's subject otherwise its object. -
getTarget
public static org.apache.jena.graph.Node getTarget(org.apache.jena.graph.Triple triple, boolean isForward) If isForward is true then return the triple's object otherwise its subject. -
createMatch
public static org.apache.jena.graph.Triple createMatch(org.apache.jena.graph.Node source, org.apache.jena.sparql.path.P_Path0 predicate) Create a matcher for triples having a certain predicate and a source node. If 'isForward' is true then the subject acts as the source otherwise its the object. -
createMatch
public static org.apache.jena.graph.Triple createMatch(org.apache.jena.graph.Triple triple, boolean isForward) -
createMatch
public static org.apache.jena.graph.Triple createMatch(org.apache.jena.graph.Node source, org.apache.jena.graph.Node predicate, boolean isForward) Create a matcher for triples having a certain predicate and a source node. If 'isForward' is true then the subject acts as the source otherwise its the object. -
create
public static org.apache.jena.graph.Triple create(org.apache.jena.graph.Node s, org.apache.jena.sparql.path.P_Path0 p, org.apache.jena.graph.Node o) -
create
public static org.apache.jena.graph.Triple create(org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o, boolean isForward) -
toArray
public static org.apache.jena.graph.Node[] toArray(org.apache.jena.graph.Triple t) -
fromArray
public static org.apache.jena.graph.Triple fromArray(org.apache.jena.graph.Node[] nodes) -
tripleToBinding
public static org.apache.jena.sparql.engine.binding.Binding tripleToBinding(org.apache.jena.graph.Triple triple) -
tripleToBinding
public static org.apache.jena.sparql.engine.binding.Binding tripleToBinding(org.apache.jena.graph.Triple triple, org.apache.jena.sparql.engine.binding.Binding parent) -
bindingToTriple
public static org.apache.jena.graph.Triple bindingToTriple(org.apache.jena.sparql.engine.binding.Binding b) -
bindingToTriple
public static org.apache.jena.graph.Triple bindingToTriple(org.apache.jena.sparql.engine.binding.Binding b, org.apache.jena.sparql.core.Var vs, org.apache.jena.sparql.core.Var vp, org.apache.jena.sparql.core.Var vo) -
tripleToBinding
public static org.apache.jena.sparql.engine.binding.Binding tripleToBinding(org.apache.jena.graph.Triple pattern, org.apache.jena.graph.Triple assignment) -
swap
public static org.apache.jena.graph.Triple swap(org.apache.jena.graph.Triple t) -
swap
-
listToTriple
-
tripleToList
-
isValid
public static boolean isValid(org.apache.jena.graph.Triple t) Returns true if the triple survives a serialization/deserialization round trip -
md5sum
-
compareRDFTerms
public static int compareRDFTerms(org.apache.jena.graph.Triple o1, org.apache.jena.graph.Triple o2) -
compare
public static int compare(org.apache.jena.graph.Triple o1, org.apache.jena.graph.Triple o2, Comparator<org.apache.jena.graph.Node> nc) Compare two triples by their nodes. -
copySubstitute
public static org.apache.jena.graph.Triple copySubstitute(org.apache.jena.graph.Triple quad, org.apache.jena.sparql.engine.binding.Binding binding)
-