public abstract class AbstractModel extends AbstractSet<Statement> implements Model
| Constructor and Description |
|---|
AbstractModel() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Resource subj,
URI pred,
Value obj,
Resource... contexts)
Deprecated.
|
boolean |
add(Statement st) |
boolean |
addAll(Collection<? extends Statement> c) |
void |
clear() |
boolean |
clear(Resource... contexts)
Removes statements with the specified context exist in this model.
|
protected void |
closeIterator(Iterator<?> iter)
Cleans up any resources used by this iterator.
|
boolean |
contains(Object o) |
boolean |
contains(Resource subj,
URI pred,
Value obj,
Resource... contexts)
Deprecated.
|
boolean |
containsAll(Collection<?> c) |
Set<Resource> |
contexts()
Returns a
Set view of the contexts contained in this model. |
boolean |
equals(Object o) |
Model |
filter(Resource subj,
URI pred,
Value obj,
Resource... contexts)
Deprecated.
|
Namespace |
getNamespace(String prefix)
Gets the namespace that is associated with the specified prefix, if any.
|
ValueFactory |
getValueFactory()
Deprecated.
|
int |
hashCode() |
boolean |
isEmpty() |
Iterator<Statement> |
match(Resource subj,
IRI pred,
Value obj,
Resource... contexts)
Deprecated.
|
Literal |
objectLiteral()
Deprecated.
|
Resource |
objectResource()
Deprecated.
|
Set<Value> |
objects()
Returns a
Set view of the objects contained in this model. |
String |
objectString()
Deprecated.
|
URI |
objectURI()
Deprecated.
|
Value |
objectValue()
Deprecated.
|
Set<IRI> |
predicates()
Returns a
Set view of the predicates contained in this model. |
boolean |
remove(Object o) |
boolean |
remove(Resource subj,
URI pred,
Value obj,
Resource... contexts)
Deprecated.
|
boolean |
removeAll(Collection<?> c) |
abstract void |
removeTermIteration(Iterator<Statement> iter,
Resource subj,
IRI pred,
Value obj,
Resource... contexts)
Called by aggregate sets when a term has been removed from a term iterator.
|
boolean |
retainAll(Collection<?> c) |
Namespace |
setNamespace(String prefix,
String name)
Sets the prefix for a namespace.
|
BNode |
subjectBNode()
Utility method that casts the return value of
Model.subjectResource() to a BNode, or throws a
ModelException if that value is not a BNode. |
Resource |
subjectResource()
Deprecated.
|
Set<Resource> |
subjects()
Returns a
Set view of the subjects contained in this model. |
URI |
subjectURI()
Provided for backward-compatibility purposes only, this method executes
#subjectIRI instead. |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
Model |
unmodifiable()
Returns an unmodifiable view of this model.
|
iterator, size, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, contains, filter, getNamespaces, remove, removeNamespace, setNamespaceiterator, size, spliteratorparallelStream, removeIf, streampublic Model unmodifiable()
ModelUnsupportedOperationException.
unmodifiable in interface Modelpublic Namespace getNamespace(String prefix)
ModelgetNamespace in interface Modelprefix - A namespace prefix.public Namespace setNamespace(String prefix, String name)
ModelsetNamespace in interface Modelprefix - The new prefix.name - The namespace name that the prefix maps to.Namespace object for the given namespace.@Deprecated public boolean add(Resource subj, URI pred, Value obj, Resource... contexts)
@Deprecated public boolean remove(Resource subj, URI pred, Value obj, Resource... contexts)
@Deprecated public Model filter(Resource subj, URI pred, Value obj, Resource... contexts)
@Deprecated public Resource subjectResource() throws ModelException
ModelModelException is thrown if this is not the case.subjectResource in interface ModelOptional#empty() if no matching statements
were found.ModelException - If the statements matched by the specified parameters have more than one unique subject.public URI subjectURI() throws ModelException
Model#subjectIRI instead.subjectURI in interface ModelModelExceptionpublic BNode subjectBNode() throws ModelException
ModelModel.subjectResource() to a BNode, or throws a
ModelException if that value is not a BNode.subjectBNode in interface Modelnull if no matching statements were found.ModelException - If such an exception is thrown by Model.subjectResource() or if its return value is not a
BNode.public boolean add(Statement st)
add in interface Collection<Statement>add in interface Set<Statement>add in class AbstractCollection<Statement>public boolean isEmpty()
isEmpty in interface Collection<Statement>isEmpty in interface Set<Statement>isEmpty in class AbstractCollection<Statement>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<Statement>containsAll in interface Set<Statement>containsAll in class AbstractCollection<Statement>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<Statement>removeAll in interface Set<Statement>removeAll in class AbstractSet<Statement>public Object[] toArray()
toArray in interface Collection<Statement>toArray in interface Set<Statement>toArray in class AbstractCollection<Statement>public <T> T[] toArray(T[] a)
toArray in interface Collection<Statement>toArray in interface Set<Statement>toArray in class AbstractCollection<Statement>public boolean addAll(Collection<? extends Statement> c)
addAll in interface Collection<Statement>addAll in interface Set<Statement>addAll in class AbstractCollection<Statement>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<Statement>retainAll in interface Set<Statement>retainAll in class AbstractCollection<Statement>public void clear()
clear in interface Collection<Statement>clear in interface Set<Statement>clear in class AbstractCollection<Statement>public boolean clear(Resource... contexts)
Modelpublic boolean remove(Object o)
remove in interface Collection<Statement>remove in interface Set<Statement>remove in class AbstractCollection<Statement>@Deprecated public boolean contains(Resource subj, URI pred, Value obj, Resource... contexts)
public boolean contains(Object o)
contains in interface Collection<Statement>contains in interface Set<Statement>contains in class AbstractCollection<Statement>public int hashCode()
hashCode in interface Collection<Statement>hashCode in interface Set<Statement>hashCode in class AbstractSet<Statement>public boolean equals(Object o)
equals in interface Collection<Statement>equals in interface Set<Statement>equals in class AbstractSet<Statement>public Set<Resource> subjects()
ModelSet view of the subjects contained in this model. The set is backed by the model, so
changes to the model are reflected in the set, and vice-versa. If the model is modified while an
iteration over the set is in progress (except through the iterator's own remove operation), the
results of the iteration are undefined. The set supports element removal, which removes all statements
from the model for which that element is a subject value, via the Iterator.remove,
Set.remove, removeAll, retainAll, and clear operations. It does not
support the add or addAll operations if the parameters pred or obj are
null.public Set<IRI> predicates()
ModelSet view of the predicates contained in this model. The set is backed by the model,
so changes to the model are reflected in the set, and vice-versa. If the model is modified while an
iteration over the set is in progress (except through the iterator's own remove operation), the
results of the iteration are undefined. The set supports element removal, which removes all statements
from the model for which that element is a predicate value, via the Iterator.remove,
Set.remove, removeAll, retainAll, and clear operations. It does not
support the add or addAll operations if the parameters subj or obj are
null.predicates in interface Modelpublic Set<Value> objects()
ModelSet view of the objects contained in this model. The set is backed by the model, so
changes to the model are reflected in the set, and vice-versa. If the model is modified while an
iteration over the set is in progress (except through the iterator's own remove operation), the
results of the iteration are undefined. The set supports element removal, which removes all statements
from the model for which that element is an object value, via the Iterator.remove,
Set.remove, removeAll, retainAll, and clear operations. It does not
support the add or addAll operations if the parameters subj or pred are
null.public Set<Resource> contexts()
ModelSet view of the contexts contained in this model. The set is backed by the model, so
changes to the model are reflected in the set, and vice-versa. If the model is modified while an
iteration over the set is in progress (except through the iterator's own remove operation), the
results of the iteration are undefined. The set supports element removal, which removes all statements
from the model for which that element is a context value, via the Iterator.remove,
Set.remove, removeAll, retainAll, and clear operations. It does not
support the add or addAll operations if the parameters subj , pred or
obj are null.@Deprecated public Value objectValue() throws ModelException
ModelModelException is thrown if this is not the case.objectValue in interface ModelOptional#empty() if no matching statements
were found.ModelException - If the statements matched by the specified parameters have more than one unique object.@Deprecated public Literal objectLiteral() throws ModelException
ModelModel.objectValue() to a Literal, or throws a
ModelUtilException if that value is not a Literal.objectLiteral in interface ModelOptional#empty() if no matching statements
were found.ModelException - If such an exception is thrown by Model.objectValue() or if its return value is not a
Literal.@Deprecated public Resource objectResource() throws ModelException
ModelModel.objectValue() to a Resource, or throws a
ModelUtilException if that value is not a Resource.objectResource in interface ModelOptional#empty() if no matching statements
were found.ModelException - If such an exception is thrown by Model.objectValue() or if its return value is not a
Resource.@Deprecated public URI objectURI() throws ModelException
ModelModel.objectValue() to an IRI, or throws a
ModelUtilException if that value is not an IRI.objectURI in interface ModelOptional#empty() if no matching statements
were found.ModelException - If such an exception is thrown by Model.objectValue() or if its return value is not an IRI.@Deprecated public String objectString() throws ModelException
ModelModel.objectValue().objectString in interface ModelOptional#empty() if no matching
statements were found.ModelException - If the statements matched by the specified parameters have more than one unique object.public abstract void removeTermIteration(Iterator<Statement> iter, Resource subj, IRI pred, Value obj, Resource... contexts)
iter - The iterator used to navigate the live set (never null)subj - the subject term to be removed or nullpred - the predicate term to be removed or nullobj - the object term to be removed or nullcontexts - an array of one context term to be removed or an empty arrayprotected void closeIterator(Iterator<?> iter)
iter - Iterator to clean up@Deprecated public Iterator<Statement> match(Resource subj, IRI pred, Value obj, Resource... contexts)
Graph
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.
match in interface Graphsubj - 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.@Deprecated public ValueFactory getValueFactory()
GraphgetValueFactory in interface GraphCopyright © 2015-2016 Eclipse Foundation. All Rights Reserved.