| Modifier and Type | Method and Description |
|---|---|
static Set<Node> |
allNodesOfTypeRDFS(Graph graph,
Node type)
List all the node of type, including considering rdfs:subClassOf
|
static <X> boolean |
allNonNull(X... objects)
Are all the arguments non-null?
|
static Set<Node> |
allPO(Graph graph,
Node predicate,
Node object)
Return a set of all subjects for predicate-object
|
static Set<Node> |
allSP(Graph graph,
Node subject,
Node predicate)
Return a set of all objects for subject-predicate
|
static Set<Node> |
allTypesOfNodeRDFS(Graph graph,
Node node)
List all the types of a node, including super-classes.
|
static void |
apply(ExtendedIterator<Triple> iter,
Consumer<Triple> action)
Apply an action to every triple of an iterator.
|
static void |
apply(Graph src,
Consumer<Triple> action)
Apply an action to every triple of a graph.
|
static <X> X |
atMostOne(X... objects)
Is one or none of the arguments non-null?
|
static void |
clear(Graph graph)
Clear graph.
|
static boolean |
contains(Graph graph,
Node subject,
Node predicate,
Node object)
Does the graph match the s/p/o pattern?
|
static boolean |
containsNode(Graph graph,
Node node)
Does the graph use the node anywhere as a subject, predicate or object?
|
static boolean |
containsOne(Graph graph,
Node subject,
Node predicate,
Node object)
Contains exactly one.
|
static void |
copyGraphSrcToDst(Graph src,
Graph dst)
Add src to dst - assumes transaction.
|
static <X> int |
countNonNulls(X... objects)
Count non-nulls
|
static long |
countPO(Graph graph,
Node predicate,
Node object)
Count matches of predicate-object (which can be wildcards).
|
static long |
countSP(Graph graph,
Node subject,
Node predicate)
Count matches of subject-predicate (which can be wildcards).
|
static void |
deleteModify(Graph modify,
Graph srcGraph)
Delete triples in the graph-to-modify (arg 1) that are in the source (arg 2).
|
static <X> boolean |
exactlyOneSet(X... objects)
Is one and only one argument non-null?
|
static ExtendedIterator<Triple> |
find(Graph graph,
Node subject,
Node predicate,
Node object)
Graph.find(Node, Node, Node) as a function. |
static ExtendedIterator<Triple> |
findAll(Graph graph)
Graph.find() as a function. |
static Quad |
getOne(DatasetGraph dsg,
Node graph,
Node subject,
Node predicate,
Node object)
Get quad if there is exactly one to match the s/p/o, else throw
RDFDataException.
|
static Triple |
getOne(Graph graph,
Node subject,
Node predicate,
Node object)
Get triple if there is exactly one to match the s/p/o, else throw
RDFDataException.
|
static Quad |
getOneOrNull(DatasetGraph dsg,
Node graph,
Node subject,
Node predicate,
Node object)
Get triple if there is exactly one to match the s/p/o; else return null
if none or more than one.
|
static Triple |
getOneOrNull(Graph graph,
Node subject,
Node predicate,
Node object)
Get triple if there is exactly one to match the s/p/o; else return null
if none or more than one.
|
static Node |
getOnePO(Graph graph,
Node predicate,
Node object)
Get the subject for predicate-object.
|
static Node |
getOneSP(Graph graph,
Node subject,
Node predicate)
Get object for subject-predicate.
|
static Node |
getPO(Graph graph,
Node predicate,
Node object)
Get the subject, given predicate and object.
|
static Node |
getSP(Graph graph,
Node subject,
Node predicate)
Get object, given subject and predicate.
|
static Quad |
getZeroOrOne(DatasetGraph dsg,
Node graph,
Node subject,
Node predicate,
Node object)
Get triple if there is exactly one to match the s/p/o; return null if none;
throw RDFDataException if more than one.
|
static Triple |
getZeroOrOne(Graph graph,
Node subject,
Node predicate,
Node object)
Get triple if there is exactly one to match the s/p/o; return null if none;
throw RDFDataException if more than one.
|
static Node |
getZeroOrOnePO(Graph graph,
Node predicate,
Node object)
Get the subject for predicate-object.
|
static Node |
getZeroOrOneSP(Graph graph,
Node subject,
Node predicate)
Get object for subject-predicate.
|
static boolean |
hasProperty(Graph graph,
Node subject,
Node predicate)
Does node
s have property p in graph g? |
static boolean |
hasType(Graph graph,
Node node,
Node type)
Does the node x have the given type (non-RDFS - no rdfs:subclassOf considered)?
|
static boolean |
isBlank(Node n) |
static boolean |
isLiteral(Node n) |
static boolean |
isNodeGraph(Node n) |
static boolean |
isNodeTriple(Node n) |
static boolean |
isOfType(Graph graph,
Node node,
Node type)
Test whether the node has the type or is rdfs:subclassOf.
|
static boolean |
isResource(Node n) |
static boolean |
isURI(Node n) |
static ExtendedIterator<Node> |
iterPO(Graph graph,
Node predicate,
Node object)
ExtendedIterator of subjects where the triple matches for predicate
and object (which can be wildcards). |
static ExtendedIterator<Node> |
iterSP(Graph graph,
Node subject,
Node predicate)
ExtendedIterator of objects where the triple matches for subject and
predicate (which can be wildcards). |
static List<Node> |
listNodesOfTypeRDFS(Graph graph,
Node type)
List all the nodes of type, including node of sub-classes.
|
static Iterator<Node> |
listObjects(Graph graph)
List the objects in a graph (no duplicates)
|
static List<Node> |
listPO(Graph graph,
Node predicate,
Node object)
List of subjects matching the predicate-object (which can be wildcards).
|
static Iterator<Node> |
listPredicates(Graph graph)
List the predicates in a graph (no duplicates)
|
static List<Node> |
listSP(Graph graph,
Node subject,
Node predicate)
List of objects matching the subject-predicate (which can be wildcards).
|
static List<Node> |
listSubClasses(Graph graph,
Node type)
List the subclasses of a type, including itself.
|
static Iterator<Node> |
listSubjects(Graph graph)
List the subjects in a graph (no duplicates)
|
static List<Node> |
listSuperClasses(Graph graph,
Node type)
List the super-classes of a type, including itself.
|
static List<Node> |
listTypesOfNodeRDFS(Graph graph,
Node node)
List the types of a node, following rdfs:subClassOf for super classes.
|
static List<Node> |
nodesOfTypeAsList(Graph graph,
Node type)
List the subjects with exactly
type. |
static Set<Node> |
nodesOfTypeAsSet(Graph graph,
Node type)
Set of nodes with exactly
type. |
static Node |
nullAsAny(Node x)
Convert null to Node.ANY
|
static Node |
nullAsDft(Node x,
Node dft)
Convert null to some default Node
|
static Node |
object(Triple triple)
Return the object of a triple, or null if the triple is null.
|
static long |
objectConnectiveness(Graph graph,
Node object)
Count the number of in-arc to an object
|
static boolean |
oneConnected(Graph graph,
Node object)
Test whether an object has exactly one in-arc.
|
static Node |
predicate(Triple triple)
Return the predicate of a triple, or null if the triple is null.
|
static Iterator<Node> |
quad2graphName(Iterator<Quad> iter)
Project quad to graph name
|
static Iterator<Node> |
quad2object(Iterator<Quad> iter)
Project quad to object
|
static Iterator<Node> |
quad2predicate(Iterator<Quad> iter)
Project quad to predicate
|
static Iterator<Node> |
quad2subject(Iterator<Quad> iter)
Project quad to subject
|
static org.apache.jena.atlas.iterator.Iter<Triple> |
quads2triples(Iterator<Quad> iter)
Project quads to triples
|
static List<Node> |
rdfList(Graph graph,
Node node)
Return a java list for an RDF list of data.
|
static Set<Node> |
subClasses(Graph graph,
Node type)
Set of the subclasses of a type, including itself.
|
static Node |
subject(Triple triple)
Return the subject of a triple, or null if the triple is null.
|
static Set<Node> |
superClasses(Graph graph,
Node type)
Set of the subclasses of a type, including itself.
|
static Iterator<Node> |
triple2object(Iterator<Triple> iter)
Project triple to object
|
static Iterator<Node> |
triple2predicate(Iterator<Triple> iter)
Project triple to predicate
|
static Iterator<Node> |
triple2subject(Iterator<Triple> iter)
Project triple to subject
|
static org.apache.jena.atlas.iterator.Iter<Quad> |
triples2quads(Node graphNode,
Iterator<Triple> iter)
Convert an iterator of triples into quads for the specified graph name.
|
static org.apache.jena.atlas.iterator.Iter<Quad> |
triples2quadsDftGraph(Iterator<Triple> iter)
Convert an iterator of triples into quads for the default graph.
|
static List<Node> |
typesOfNodeAsList(Graph graph,
Node node)
List the types of a node/subject.
|
static Set<Node> |
typesOfNodeAsSet(Graph graph,
Node node)
Set of exact types of a node See
allTypesOfNodeRDFS(Graph, Node),
which does include super-classes. |
public static Node subject(Triple triple)
public static Node predicate(Triple triple)
public static Node object(Triple triple)
public static boolean isURI(Node n)
public static boolean isBlank(Node n)
public static boolean isLiteral(Node n)
public static boolean isResource(Node n)
public static boolean isNodeTriple(Node n)
public static boolean isNodeGraph(Node n)
public static boolean contains(Graph graph, Node subject, Node predicate, Node object)
public static boolean containsNode(Graph graph, Node node)
public static boolean isOfType(Graph graph, Node node, Node type)
public static boolean hasType(Graph graph, Node node, Node type)
public static boolean hasProperty(Graph graph, Node subject, Node predicate)
s have property p in graph g?public static boolean containsOne(Graph graph, Node subject, Node predicate, Node object)
public static Node getSP(Graph graph, Node subject, Node predicate)
getOneSP(org.apache.jena.graph.Graph, org.apache.jena.graph.Node, org.apache.jena.graph.Node) and getZeroOrOneSP(org.apache.jena.graph.Graph, org.apache.jena.graph.Node, org.apache.jena.graph.Node).public static Node getOneSP(Graph graph, Node subject, Node predicate)
public static Node getZeroOrOneSP(Graph graph, Node subject, Node predicate)
public static Node getPO(Graph graph, Node predicate, Node object)
getOnePO(org.apache.jena.graph.Graph, org.apache.jena.graph.Node, org.apache.jena.graph.Node) and getZeroOrOnePO(org.apache.jena.graph.Graph, org.apache.jena.graph.Node, org.apache.jena.graph.Node).public static Node getOnePO(Graph graph, Node predicate, Node object)
public static Node getZeroOrOnePO(Graph graph, Node predicate, Node object)
public static Triple getOne(Graph graph, Node subject, Node predicate, Node object)
public static Triple getZeroOrOne(Graph graph, Node subject, Node predicate, Node object)
public static Triple getOneOrNull(Graph graph, Node subject, Node predicate, Node object)
public static Quad getOne(DatasetGraph dsg, Node graph, Node subject, Node predicate, Node object)
public static Quad getZeroOrOne(DatasetGraph dsg, Node graph, Node subject, Node predicate, Node object)
public static Quad getOneOrNull(DatasetGraph dsg, Node graph, Node subject, Node predicate, Node object)
public static ExtendedIterator<Node> iterSP(Graph graph, Node subject, Node predicate)
ExtendedIterator of objects where the triple matches for subject and
predicate (which can be wildcards). The ExtendedIterator must be fully
used or explicitly closed. It is preferable use listSP(org.apache.jena.graph.Graph, org.apache.jena.graph.Node, org.apache.jena.graph.Node) which handles
this condition.public static List<Node> listSP(Graph graph, Node subject, Node predicate)
public static long countSP(Graph graph, Node subject, Node predicate)
public static ExtendedIterator<Node> iterPO(Graph graph, Node predicate, Node object)
ExtendedIterator of subjects where the triple matches for predicate
and object (which can be wildcards). The ExtendedIterator must be
fully used or explicitly closed. It is preferable use listSP(org.apache.jena.graph.Graph, org.apache.jena.graph.Node, org.apache.jena.graph.Node) which
handles this condition.public static List<Node> listPO(Graph graph, Node predicate, Node object)
public static long countPO(Graph graph, Node predicate, Node object)
public static Iterator<Node> listSubjects(Graph graph)
public static Iterator<Node> listPredicates(Graph graph)
public static Iterator<Node> listObjects(Graph graph)
public static List<Node> nodesOfTypeAsList(Graph graph, Node type)
type.
See listNodesOfTypeRDFS(Graph, Node), which does include sub-classes.public static List<Node> typesOfNodeAsList(Graph graph, Node node)
listTypesOfNodeRDFS(Graph, Node) , which does include super-classes.public static Set<Node> nodesOfTypeAsSet(Graph graph, Node type)
type.
See allNodesOfTypeRDFS(Graph, Node), which does include sub-classes.public static Set<Node> typesOfNodeAsSet(Graph graph, Node node)
allTypesOfNodeRDFS(Graph, Node),
which does include super-classes.public static List<Node> rdfList(Graph graph, Node node)
public static List<Node> listSubClasses(Graph graph, Node type)
public static List<Node> listSuperClasses(Graph graph, Node type)
public static Set<Node> subClasses(Graph graph, Node type)
public static Set<Node> superClasses(Graph graph, Node type)
public static List<Node> listTypesOfNodeRDFS(Graph graph, Node node)
public static List<Node> listNodesOfTypeRDFS(Graph graph, Node type)
public static Set<Node> allTypesOfNodeRDFS(Graph graph, Node node)
public static Set<Node> allNodesOfTypeRDFS(Graph graph, Node type)
public static Set<Node> allSP(Graph graph, Node subject, Node predicate)
public static Set<Node> allPO(Graph graph, Node predicate, Node object)
public static long objectConnectiveness(Graph graph, Node object)
public static boolean oneConnected(Graph graph, Node object)
public static ExtendedIterator<Triple> find(Graph graph, Node subject, Node predicate, Node object)
Graph.find(Node, Node, Node) as a function.public static ExtendedIterator<Triple> findAll(Graph graph)
Graph.find() as a function.@SafeVarargs public static <X> boolean allNonNull(X... objects)
@SafeVarargs public static <X> boolean exactlyOneSet(X... objects)
@SafeVarargs public static <X> X atMostOne(X... objects)
@SafeVarargs public static <X> int countNonNulls(X... objects)
public static org.apache.jena.atlas.iterator.Iter<Triple> quads2triples(Iterator<Quad> iter)
public static Iterator<Node> quad2graphName(Iterator<Quad> iter)
public static Iterator<Node> quad2predicate(Iterator<Quad> iter)
public static Iterator<Node> triple2subject(Iterator<Triple> iter)
public static Iterator<Node> triple2predicate(Iterator<Triple> iter)
public static Iterator<Node> triple2object(Iterator<Triple> iter)
public static void copyGraphSrcToDst(Graph src, Graph dst)
src into dstsrc - dst - public static void clear(Graph graph)
public static void apply(Graph src, Consumer<Triple> action)
public static void apply(ExtendedIterator<Triple> iter, Consumer<Triple> action)
public static void deleteModify(Graph modify, Graph srcGraph)
modify - srcGraph - public static org.apache.jena.atlas.iterator.Iter<Quad> triples2quads(Node graphNode, Iterator<Triple> iter)
public static org.apache.jena.atlas.iterator.Iter<Quad> triples2quadsDftGraph(Iterator<Triple> iter)
Quad.defaultGraphIRI, not Quad.defaultGraphNodeGenerated, which is
for quads outside a dataset, usually the output of parsers.Licenced under the Apache License, Version 2.0