contains

Determines if statements with the specified subject, predicate, object and (optionally) context exist
in this model. 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: model.contains(s1, null, null) is true if any statements in this model have subject
s1,model.contains(null, null, null, c1) is true if any statements in this model have context
c1,model.contains(null, null, null, (Resource)null) is true if any statements in this model have
no associated context,model.contains(null, null, null, c1, c2, c3) is true if any statements in this model have
context c1, c2 or c3 .

Parameters:

subj - The subject of the statements to match, null to match statements with any subject.

pred - The predicate of the statements to match, null to match statements with any predicate.

obj - The object of the statements to match, null to match statements with any object.

contexts - The contexts of the statements to match. 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.

Returns:

true if statements match the specified pattern.

add

Adds one or more statements to the model. This method creates a statement for each specified context
and adds those to the model. If no contexts are specified, a single statement with no associated
context is added. If this Model is a filtered Model then null (if context empty) values are permitted
and will use the corresponding filtered values.

Parameters:

subj - The statement's subject.

pred - The statement's predicate.

obj - The statement's object.

contexts - The contexts to add statements to.

remove

Removes statements with the specified subject, predicate, object and (optionally) context exist in this
model. 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 be removed disregarding their context. If one or more contexts
are specified, statements with a context matching one of these will be removed. Note: to remove
statements without an associated context, specify the value null and explicitly cast it to type
Resource.

Examples: model.remove(s1, null, null) removes any statements in this model have subject
s1,model.remove(null, null, null, c1) removes any statements in this model have context c1
,model.remove(null, null, null, (Resource)null) removes any statements in this model have no
associated context,model.remove(null, null, null, c1, c2, c3) removes any statements in this model have context
c1, c2 or c3.

Parameters:

subj - The subject of the statements to remove, null to remove statements with any subject.

pred - The predicate of the statements to remove, null to remove statements with any predicate.

obj - The object of the statements to remove, null to remove statements with any object.

contexts - The contexts of the statements to remove. If no contexts are specified, statements will be
removed disregarding their context. If one or more contexts are specified, statements with a
context matching one of these will be removed.

filter

Returns a view of 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.

The returned model is backed by this Model, so changes to this Model are reflected in the returned
model, and vice-versa. If this Model is modified while an iteration over the returned model is in
progress (except through the iterator's own remove operation), the results of the iteration are
undefined. The model supports element removal, which removes the corresponding statement from this
Model, via the Iterator.remove, Set.remove, removeAll, retainAll, and
clear operations. The statements passed to the add and addAll operations must
match the parameter pattern.

subj - The subject of the statements to match, null to match statements with any subject.

pred - The predicate of the statements to match, null to match statements with any predicate.

obj - The object of the statements to match, null to match statements with any object.

contexts - The contexts of the statements to match. 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.