|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.model.util.ModelUtil
public class ModelUtil
| Constructor Summary | |
|---|---|
ModelUtil()
|
|
| Method Summary | |
|---|---|
static boolean |
equals(Iterable<? extends Statement> model1,
Iterable<? extends Statement> model2)
Compares two models, defined by two statement collections, and returns true if they are equal. |
static boolean |
equals(Set<? extends Statement> model1,
Set<? extends Statement> model2)
Compares two models, defined by two statement collections, and returns true if they are equal. |
static Value |
getOptionalObject(Model model,
Resource subj,
URI pred,
Resource... contexts)
Gets the object of the statement(s) with the specified subject and predicate from the specified contexts in the supplied model. |
static Literal |
getOptionalObjectLiteral(Model model,
Resource subj,
URI pred)
Utility method that casts the return value of getOptionalObject(Model, Resource, URI, Resource[]) to a Literal,
or throws a ModelUtilException if that value is not a Literal. |
static Resource |
getOptionalObjectResource(Model model,
Resource subj,
URI pred)
Utility method that casts the return value of getOptionalObject(Model, Resource, URI, Resource[]) to a
Resource, or throws a ModelUtilException if that value is not a Resource. |
static String |
getOptionalObjectStringValue(Model model,
Resource subj,
URI pred)
Utility method that returns the value of getOptionalObject(Model, Resource, URI, Resource[])'s stringValue. |
static URI |
getOptionalObjectURI(Model model,
Resource subj,
URI pred)
Utility method that casts the return value of getOptionalObject(Model, Resource, URI, Resource[]) to a URI, or
throws a ModelUtilException if that value is not a URI. |
static Resource |
getOptionalSubject(Model model,
URI pred,
Value obj,
Resource... contexts)
Gets the subject of the statement(s) with the specified predicate and object from the specified contexts in the supplied model. |
static URI |
getOptionalSubjectURI(Model model,
URI pred,
Value obj,
Resource... contexts)
Utility method that casts the return value of getOptionalSubject(Model, URI, Value, Resource[]) to a URI, or
throws a ModelUtilException if that value is not a URI. |
static Value |
getUniqueObject(Model model,
Resource subj,
URI pred,
Resource... contexts)
Gets the object of the statement(s) with the specified subject and predicate from the specified contexts in the supplied model. |
static Literal |
getUniqueObjectLiteral(Model model,
Resource subj,
URI pred)
Utility method that casts the return value of getUniqueObject(Model, Resource, URI, Resource[]) to a Literal,
or throws a ModelUtilException if that value is not a Literal. |
static Resource |
getUniqueObjectResource(Model model,
Resource subj,
URI pred)
Utility method that casts the return value of getUniqueObject(Model, Resource, URI, Resource[]) to a Resource,
or throws a ModelUtilException if that value is not a Resource. |
static URI |
getUniqueObjectURI(Model model,
Resource subj,
URI pred)
Utility method that casts the return value of getUniqueObject(Model, Resource, URI, Resource[]) to a URI, or
throws a ModelUtilException if that value is not a URI. |
static Resource |
getUniqueSubject(Model model,
URI pred,
Value obj,
Resource... contexts)
Gets the subject of the statement(s) with the specified predicate and object from the specified contexts in the supplied model. |
static URI |
getUniqueSubjectURI(Model model,
URI pred,
Value obj,
Resource... contexts)
Utility method that casts the return value of getUniqueSubject(Model, URI, Value, Resource[]) to a URI, or
throws a ModelUtilException if that value is not a URI. |
static boolean |
isSubset(Iterable<? extends Statement> model1,
Iterable<? extends Statement> model2)
Compares two models, defined by two statement collections, and returns true if the first model is a subset of the second model. |
static boolean |
isSubset(Set<? extends Statement> model1,
Set<? extends Statement> model2)
Compares two models, defined by two statement collections, and returns true if the first model is a subset of the second model. |
static void |
setUniqueObject(Model model,
Resource subj,
URI pred,
Value obj,
Resource... contexts)
Adds the specified statement and makes sure that no other statements are present in the Model with the same subject and predicate. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ModelUtil()
| Method Detail |
|---|
public static boolean equals(Iterable<? extends Statement> model1,
Iterable<? extends Statement> model2)
public static boolean equals(Set<? extends Statement> model1,
Set<? extends Statement> model2)
public static boolean isSubset(Iterable<? extends Statement> model1,
Iterable<? extends Statement> model2)
public static boolean isSubset(Set<? extends Statement> model1,
Set<? extends Statement> model2)
public static Resource getUniqueSubject(Model model,
URI pred,
Value obj,
Resource... contexts)
throws ModelException
ModelException is thrown if these conditions are not met. See
Model#match(Resource, URI, Value, Resource[]) for a description of
the parameter values.
ModelException - If the statements matched by the specified parameters do not have
exactly one unique subject.
public static URI getUniqueSubjectURI(Model model,
URI pred,
Value obj,
Resource... contexts)
throws ModelException
getUniqueSubject(Model, URI, Value, Resource[]) to a URI, or
throws a ModelUtilException if that value is not a URI.
ModelException - If such an exception is thrown by
getUniqueSubject(Model, URI, Value, Resource[]) or if its
return value is not a URI.
public static Resource getOptionalSubject(Model model,
URI pred,
Value obj,
Resource... contexts)
throws ModelException
RepositoryConfigException is thrown if this is not the case. See
Model#match(Resource, URI, Value, Resource[]) for a description of
the parameter values.
ModelException - If the statements matched by the specified parameters have more
than one unique subject.
public static URI getOptionalSubjectURI(Model model,
URI pred,
Value obj,
Resource... contexts)
throws ModelException
getOptionalSubject(Model, URI, Value, Resource[]) to a URI, or
throws a ModelUtilException if that value is not a URI.
ModelException - If such an exception is thrown by
getOptionalSubject(Model, URI, Value, Resource[]) or if
its return value is not a URI.
public static Value getUniqueObject(Model model,
Resource subj,
URI pred,
Resource... contexts)
throws ModelException
ModelException is thrown if these conditions
are not met. See Model#match(Resource, URI, Value, Resource[]) for
a description of the parameter values.
ModelException - If the statements matched by the specified parameters do not have
exactly one unique object.
public static void setUniqueObject(Model model,
Resource subj,
URI pred,
Value obj,
Resource... contexts)
public static Resource getUniqueObjectResource(Model model,
Resource subj,
URI pred)
throws ModelException
getUniqueObject(Model, Resource, URI, Resource[]) to a Resource,
or throws a ModelUtilException if that value is not a Resource.
ModelException - If such an exception is thrown by
getUniqueObject(Model, Resource, URI, Resource[]) or if
its return value is not a Resource.
public static URI getUniqueObjectURI(Model model,
Resource subj,
URI pred)
throws ModelException
getUniqueObject(Model, Resource, URI, Resource[]) to a URI, or
throws a ModelUtilException if that value is not a URI.
ModelException - If such an exception is thrown by
getUniqueObject(Model, Resource, URI, Resource[]) or if
its return value is not a URI.
public static Literal getUniqueObjectLiteral(Model model,
Resource subj,
URI pred)
throws ModelException
getUniqueObject(Model, Resource, URI, Resource[]) to a Literal,
or throws a ModelUtilException if that value is not a Literal.
ModelException - If such an exception is thrown by
getUniqueObject(Model, Resource, URI, Resource[]) or if
its return value is not a Literal.
public static Value getOptionalObject(Model model,
Resource subj,
URI pred,
Resource... contexts)
throws ModelException
RepositoryConfigException is thrown if this is not the case. See
Model#match(Resource, URI, Value, Resource[]) for a description of
the parameter values.
ModelException - If the statements matched by the specified parameters have more
than one unique object.
public static Resource getOptionalObjectResource(Model model,
Resource subj,
URI pred)
throws ModelException
getOptionalObject(Model, Resource, URI, Resource[]) to a
Resource, or throws a ModelUtilException if that value is not a Resource.
ModelException - If such an exception is thrown by
getOptionalObject(Model, Resource, URI, Resource[]) or if
its return value is not a Resource.
public static URI getOptionalObjectURI(Model model,
Resource subj,
URI pred)
throws ModelException
getOptionalObject(Model, Resource, URI, Resource[]) to a URI, or
throws a ModelUtilException if that value is not a URI.
ModelException - If such an exception is thrown by
getOptionalObject(Model, Resource, URI, Resource[]) or if
its return value is not a URI.
public static Literal getOptionalObjectLiteral(Model model,
Resource subj,
URI pred)
throws ModelException
getOptionalObject(Model, Resource, URI, Resource[]) to a Literal,
or throws a ModelUtilException if that value is not a Literal.
ModelException - If such an exception is thrown by
getOptionalObject(Model, Resource, URI, Resource[]) or if
its return value is not a Literal.
public static String getOptionalObjectStringValue(Model model,
Resource subj,
URI pred)
throws ModelException
getOptionalObject(Model, Resource, URI, Resource[])'s stringValue.
ModelException - If such an exception is thrown by
getOptionalObject(Model, Resource, URI, Resource[]).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||