| org.openrdf.model.Graph
All known Subclasses: org.openrdf.model.impl.GraphImpl,
add | public boolean add(Resource subj, URI pred, Value obj, Resource... contexts)(Code) | | Adds one or more statements to the graph. This method creates a statement
for each specified context and adds those to the graph. If no contexts are
specified, a single statement with no associated context is added.
Parameters: subj - The statement's subject, must not be null. Parameters: pred - The statement's predicate, must not be null. Parameters: obj - The statement's object, must not be null. Parameters: contexts - The contexts to add statements to. |
getValueFactory | public ValueFactory getValueFactory()(Code) | | Gets the value factory for this graph.
|
match | public Iterator<Statement> match(Resource subj, URI pred, Value obj, Resource... contexts)(Code) | | Gets the statements with the specified subject, predicate, object and
(optionally) context. The subject, predicate and
object parameters can be null to indicate wildcards.
The contexts parameter is a wildcard and accepts zero or more
values. If no contexts are specified, statements will match disregarding
their context. If one or more contexts are specified, statements with a
context matching one of these will match. Note: to match statements
without an associated context, specify the value null and
explicitly cast it to type Resource.
Examples: graph.match(s1, null, null) matches all statements
that have subject s1,
graph.match(null, null, null, c1) matches all statements that
have context c1,
graph.match(null, null, null, (Resource)null) matches all
statements that have no associated context,
graph.match(null, null, null, c1, c2, c3) matches all
statements that have context c1, c2 or c3.
Parameters: subj - The subject of the statements to match, null to matchstatements with any subject. Parameters: pred - The predicate of the statements to match, null to matchstatements with any predicate. Parameters: obj - The object of the statements to match, null to matchstatements with any object. Parameters: contexts - The contexts of the statements to match. If no contexts arespecified, statements will match disregarding their context. If oneor more contexts are specified, statements with a context matchingone of these will match. The statements that match the specified pattern. throws: IllegalArgumentException - If a null-array is specified as the value forcontexts. SeeOpenRDFUtil.verifyContextNotNull(Resource[]) for moreinfo. |
|
|