|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Convenience methods which extend the Model
interface.
The Model
interface provides a set of primitive operations on
an RDF model. This interface extends those methods with a
set of convenience methods.
This interface provides methods supporting typed literals. This means
that methods are provided which will translate a built in type, or an
object to an RDF Literal. This translation is done by invoking the
toString()
method of the object, or its built in equivalent.
The reverse translation is also supported. This is built in for built
in types. Factory objects, provided by the application, are used
for application objects.
This interface provides methods for supporting enhanced resources. An enhanced resource is a resource to which the application has added behaviour. RDF containers are examples of enhanced resources built in to this package. Enhanced resources are supported by encapsulating a resource created by an implementation in another class which adds the extra behaviour. Factory objects are used to construct such enhanced resources.
Method Summary | |
Model |
add(Resource s,
Property p,
boolean o)
add a statement to this model |
Model |
add(Resource s,
Property p,
char o)
add a statement to this model |
Model |
add(Resource s,
Property p,
double o)
add a statement to this model |
Model |
add(Resource s,
Property p,
float o)
add a statement to this model |
Model |
add(Resource s,
Property p,
long o)
add a statement to this model |
Model |
add(Resource s,
Property p,
java.lang.Object o)
add a statement to this model |
Model |
add(Resource s,
Property p,
RDFNode o)
add a statement to this model |
Model |
add(Resource s,
Property p,
java.lang.String o)
add a statement to this model |
Model |
add(Resource s,
Property p,
java.lang.String o,
boolean wellFormed)
add a statement to this model |
Model |
add(Resource s,
Property p,
java.lang.String o,
java.lang.String l)
add a statement to this model |
Model |
add(Resource s,
Property p,
java.lang.String o,
java.lang.String l,
boolean wellFormed)
add a statement to this model |
boolean |
contains(Resource s,
Property p,
boolean o)
Determine if a statement is present in this model. |
boolean |
contains(Resource s,
Property p,
char o)
Determine if a statement is present in this model. |
boolean |
contains(Resource s,
Property p,
double o)
Determine if a statement is present in this model. |
boolean |
contains(Resource s,
Property p,
float o)
Determine if a statement is present in this model. |
boolean |
contains(Resource s,
Property p,
long o)
Determine if a statement is present in this model. |
boolean |
contains(Resource s,
Property p,
java.lang.Object o)
Determine if a statement is present in this model. |
boolean |
contains(Resource s,
Property p,
java.lang.String o)
Determine if a statement is present in this model. |
boolean |
contains(Resource s,
Property p,
java.lang.String o,
java.lang.String l)
Determine if a statement is present in this model. |
Alt |
createAlt()
Create a new anonymous alt. |
Alt |
createAlt(java.lang.String uri)
Create a new alt. |
Bag |
createBag()
Create a new anonymous bag. |
Bag |
createBag(java.lang.String uri)
Create a new bag. |
Literal |
createLiteral(boolean v)
create a literal from a boolean value. |
Literal |
createLiteral(char v)
create a literal from a char value. |
Literal |
createLiteral(double v)
create a literal from a double value. |
Literal |
createLiteral(float v)
create a literal from a float value. |
Literal |
createLiteral(long v)
create a literal from an integer value. |
Literal |
createLiteral(java.lang.Object v)
create a literal from an Object. |
Literal |
createLiteral(java.lang.String v)
create a literal from a String value. |
Property |
createProperty(java.lang.String uri)
Create a property |
Resource |
createResource(Resource type)
Create a new anonymous resource with a given type. |
Resource |
createResource(ResourceF f)
Create a new anonymous resource using the supplied factory |
Resource |
createResource(java.lang.String uri,
Resource type)
Create a new resource with a given type. |
Resource |
createResource(java.lang.String uri,
ResourceF f)
Create a new resource using the supplied factory |
Seq |
createSeq()
Create a new anonymous seq. |
Seq |
createSeq(java.lang.String uri)
Create a new seq. |
Statement |
createStatement(Resource s,
Property p,
boolean o)
Create a Statement instance. |
Statement |
createStatement(Resource s,
Property p,
char o)
Create a Statement instance. |
Statement |
createStatement(Resource s,
Property p,
double o)
Create a Statement instance. |
Statement |
createStatement(Resource s,
Property p,
float o)
Create a Statement instance. |
Statement |
createStatement(Resource s,
Property p,
long o)
Create a Statement instance. |
Statement |
createStatement(Resource s,
Property p,
java.lang.Object o)
Create a Statement instance. |
Statement |
createStatement(Resource s,
Property p,
java.lang.String o)
Create a Statement instance. |
Statement |
createStatement(Resource s,
Property p,
java.lang.String o,
boolean wellFormed)
Create a Statement instance. |
Statement |
createStatement(Resource s,
Property p,
java.lang.String o,
java.lang.String l)
Create a Statement instance. |
Statement |
createStatement(Resource s,
Property p,
java.lang.String o,
java.lang.String l,
boolean wellFormed)
Create a Statement instance. |
Alt |
getAlt(Resource r)
Return an Alt instance based on a given resource. |
Alt |
getAlt(java.lang.String uri)
Return an Alt instance in this model. |
Bag |
getBag(Resource r)
Return a bag instance based on a given resource. |
Bag |
getBag(java.lang.String uri)
Return a Bag instance in this model. |
Property |
getProperty(java.lang.String uri)
Return a Property instance in this model. |
Resource |
getResource(java.lang.String uri,
ResourceF f)
Return a Resource instance in this model. |
Seq |
getSeq(Resource r)
Return a Seq instance based on a given resource. |
Seq |
getSeq(java.lang.String uri)
Return a Seq instance in this model. |
ResIterator |
listSubjectsWithProperty(Property p,
boolean o)
List all subjects with a given property and property value |
ResIterator |
listSubjectsWithProperty(Property p,
char o)
List all subjects with a given property and property value |
ResIterator |
listSubjectsWithProperty(Property p,
double o)
lists all subjects with a given property and property value |
ResIterator |
listSubjectsWithProperty(Property p,
float o)
List all subjects with a given property and property value |
ResIterator |
listSubjectsWithProperty(Property p,
long o)
List all the subjects with a given property and property value |
ResIterator |
listSubjectsWithProperty(Property p,
java.lang.Object o)
List all subjects with a given property and property value |
ResIterator |
listSubjectsWithProperty(Property p,
java.lang.String o)
lists all subjects with a given property and property value |
ResIterator |
listSubjectsWithProperty(Property p,
java.lang.String o,
java.lang.String l)
lists all subjects with a given property and property value |
Model |
remove(Model m)
Remove all the Statements in a given model. |
Model |
remove(StmtIterator iter)
Remove all the Statements returned by an iterator. |
Method Detail |
public Resource getResource(java.lang.String uri, ResourceF f) throws RDFException
Subsequent operations on the returned object may modify this model.
The resource is assumed to already exist in the model. If it does not,
createResource
should be used instead.
uri
- the URI of the resourcef
- the factory objectRDFException
- Generic RDF Exceptionpublic Property getProperty(java.lang.String uri) throws RDFException
Subsequent operations on the returned property may modify this model.
The property is assumed to already exist in the model. If it does not,
createProperty
should be used instead.
uri
- the URI of the propertyRDFException
- Generic RDF Exceptionpublic Bag getBag(java.lang.String uri) throws RDFException
Subsequent operations on the returned bag may modify this model.
The bag is assumed to already exist in the model. If it does not,
createBag
should be used instead.
uri
- the URI of the bag.RDFException
- Generic RDF Exceptionpublic Bag getBag(Resource r) throws RDFException
This method enables an application to treat any resource as a bag. It is in effect an unsafe downcast.
Subsequent operations on the returned bag may modify this model.
The bag is assumed to already exist in the model. If it does not,
createBag
should be used instead.
r
- an untyped Resource instanceRDFException
- Generic RDF Exceptionpublic Alt getAlt(java.lang.String uri) throws RDFException
Subsequent operations on the returned object may modify this model.
The alt is assumed to already exist in the model. If it does not,
createAlt
should be used instead.
uri
- the URI of the altRDFException
- Generic RDF Exceptionpublic Alt getAlt(Resource r) throws RDFException
This method enables an application to treat any resource as an Alt. It is in effect an unsafe downcast.
Subsequent operations on the returned Alt may modify this model.
The bag is assumed to already exist in the model. If it does not,
createAlt
should be used instead.
r
- an untyped Resource instanceRDFException
- Generic RDF Exceptionpublic Seq getSeq(java.lang.String uri) throws RDFException
Subsequent operations on the returned bag may modify this model.
The seq is assumed to already exist in the model. If it does not,
createSeq
should be used instead.
uri
- the URI of the seqRDFException
- Generic RDF Exceptionpublic Seq getSeq(Resource r) throws RDFException
This method enables an application to treat any resource as a Seq. It is in effect an unsafe downcast.
Subsequent operations on the returned Seq may modify this model.
The Seq is assumed to already exist in the model. If it does not,
createAlt
should be used instead.
r
- an untyped Resource instanceRDFException
- Generic RDF Exceptionpublic Resource createResource(Resource type) throws RDFException
Subsequent operations on the returned resource may modify this model.
The resource is created and an rdf:type property added to the model to specify its type.
type
- A resource representing the RDF type of the new resource.RDFException
- Generic RDF exceptionpublic Resource createResource(java.lang.String uri, Resource type) throws RDFException
Subsequent operations on the returned resource may modify this model.
The resource is created and an rdf:type property added to the model to specify its type.
uri
- The URI of the new resource.type
- A resource representing the RDF type of the new resource.RDFException
- Generic RDF exception.public Resource createResource(ResourceF f) throws RDFException
Subsequent operations on the returned resource may modify this model.
f
- A factory object to create the returned object.RDFException
- Generic RDF exception.public Resource createResource(java.lang.String uri, ResourceF f) throws RDFException
Subsequent operations on the returned resource may modify this model.
uri
- the URI of the resourcef
- A factory to create the returned object.RDFException
- Generic RDF exception.public Property createProperty(java.lang.String uri) throws RDFException
Subsequent operations on the returned property may modify this model.
uri
- the URI of the propertyRDFException
- Generic RDF exceptionpublic Literal createLiteral(boolean v) throws RDFException
The value is converted to a string using its toString
method.
v
- the value of the literalRDFException
- generic RDF exceptionpublic Literal createLiteral(long v) throws RDFException
v
- the value of the literalRDFException
- generic RDF exceptionpublic Literal createLiteral(char v) throws RDFException
v
- the value of the literalRDFException
- generic RDF exceptionpublic Literal createLiteral(float v) throws RDFException
v
- the value of the literalRDFException
- generic RDF exceptionpublic Literal createLiteral(double v) throws RDFException
v
- the value of the literalRDFException
- generic RDF exceptionpublic Literal createLiteral(java.lang.String v) throws RDFException
v
- the value of the literalRDFException
- generic RDF exceptionpublic Literal createLiteral(java.lang.Object v) throws RDFException
v
- the value of the literal.RDFException
- generic RDF exceptionpublic Statement createStatement(Resource s, Property p, boolean o) throws RDFException
Subsequent operations on the statement or any of its parts may modify this model.
Creating a statement does not add it to the set of statements in the model.
The value o will be converted to a Literal.
s
- the subject of the statementp
- the predicate of the statemento
- is the value to be the object of the statementRDFException
- generic RDF exceptionpublic Statement createStatement(Resource s, Property p, long o) throws RDFException
Subsequent operations on the statement or any of its parts may modify this model.
Creating a statement does not add it to the set of statements in the model.
The value o will be converted to a Literal.
s
- the subject of the statementp
- the predicate of the statemento
- is the value to be the object of the statementRDFException
- generic RDF exceptionpublic Statement createStatement(Resource s, Property p, char o) throws RDFException
Subsequent operations on the statement or any of its parts may modify this model.
Creating a statement does not add it to the set of statements in the model.
The value o will be converted to a Literal.
s
- the subject of the statementp
- the predicate of the statemento
- is the value to be the object of the statementRDFException
- generic RDF exceptionpublic Statement createStatement(Resource s, Property p, float o) throws RDFException
Subsequent operations on the statement or any of its parts may modify this model.
Creating a statement does not add it to the set of statements in the model.
The value o will be converted to a Literal.
s
- the subject of the statementp
- the predicate of the statemento
- is the value to be the object of the statementRDFException
- generic RDF exceptionpublic Statement createStatement(Resource s, Property p, double o) throws RDFException
Subsequent operations on the statement or any of its parts may modify this model.
Creating a statement does not add it to the set of statements in the model.
The value o will be converted to a Literal.
s
- the subject of the statementp
- the predicate of the statemento
- is the value to be the object of the statementRDFException
- generic RDF exceptionpublic Statement createStatement(Resource s, Property p, java.lang.String o) throws RDFException
Subsequent operations on the statement or any of its parts may modify this model.
Creating a statement does not add it to the set of statements in the model.
The Object o will be converted to a Literal.
s
- the subject of the statementp
- the predicate of the statemento
- is the value to be the object of the statementRDFException
- generic RDF exceptionpublic Statement createStatement(Resource s, Property p, java.lang.String o, java.lang.String l) throws RDFException
Subsequent operations on the statement or any of its parts may modify this model.
Creating a statement does not add it to the set of statements in the model.
The Object o will be converted to a Literal.
s
- the subject of the statementp
- the predicate of the statemento
- is the value to be the object of the statementl
- the language associated with the objectRDFException
- generic RDF exceptionpublic Statement createStatement(Resource s, Property p, java.lang.String o, boolean wellFormed) throws RDFException
Subsequent operations on the statement or any of its parts may modify this model.
Creating a statement does not add it to the set of statements in the model.
The Object o will be converted to a Literal.
s
- the subject of the statementp
- the predicate of the statemento
- is the value to be the object of the statementwellFormed
- true if the string is well formed XMLRDFException
- generic RDF exceptionpublic Statement createStatement(Resource s, Property p, java.lang.String o, java.lang.String l, boolean wellFormed) throws RDFException
Subsequent operations on the statement or any of its parts may modify this model.
Creating a statement does not add it to the set of statements in the model.
The Object o will be converted to a Literal.
s
- the subject of the statementp
- the predicate of the statemento
- is the value to be the object of the statementl
- the language associated with the objectwellFormed
- true of the string is well formed XMLRDFException
- generic RDF exceptionpublic Statement createStatement(Resource s, Property p, java.lang.Object o) throws RDFException
Subsequent operations on the statement or any of its parts may modify this model.
Creating a statement does not add it to the set of statements in the model.
The value o will be converted to a Literal.
s
- the subject of the statementp
- the predicate of the statemento
- is the value to be the object of the statementRDFException
- generic RDF exceptionpublic Bag createBag() throws RDFException
Subsequent operations on the bag or any of its parts may modify this model.
A statement defining the type of the new bag is added to this model.
RDFException
- Generic RDF exception.public Bag createBag(java.lang.String uri) throws RDFException
Subsequent operations on the bag or any of its parts may modify this model.
A statement defining the type of the new bag is added to this model.
uri
- The URI of the new Bag.RDFException
- Generic RDF exception.public Alt createAlt() throws RDFException
Subsequent operations on the alt or any of its parts may modify this model.
A statement defining the type of the new alt is added to this model.
RDFException
- Generic RDF exception.public Alt createAlt(java.lang.String uri) throws RDFException
Subsequent operations on the alt or any of its parts may modify this model.
A statement defining the type of the new alt is added to this model.
uri
- The URI of the new alt.RDFException
- Generic RDF exception.public Seq createSeq() throws RDFException
Subsequent operations on the seq or any of its parts may modify this model.
A statement defining the type of the new seq is added to this model.
RDFException
- Generic RDF exception.public Seq createSeq(java.lang.String uri) throws RDFException
Subsequent operations on the seq or any of its parts may modify this model.
A statement defining the type of the new seq is added to this model.
uri
- The URI of the new seq.RDFException
- Generic RDF exception.public Model add(Resource s, Property p, RDFNode o) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addRDFException
- Generic RDF Exceptionpublic Model add(Resource s, Property p, boolean o) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addRDFException
- Generic RDF Exceptionpublic Model add(Resource s, Property p, long o) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addRDFException
- Generic RDF Exceptionpublic Model add(Resource s, Property p, char o) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addRDFException
- Generic RDF Exceptionpublic Model add(Resource s, Property p, float o) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addRDFException
- Generic RDF Exceptionpublic Model add(Resource s, Property p, double o) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addRDFException
- Generic RDF Exceptionpublic Model add(Resource s, Property p, java.lang.String o) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addRDFException
- Generic RDF Exceptionpublic Model add(Resource s, Property p, java.lang.String o, boolean wellFormed) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addwellFormed
- true if o is well formed XMLRDFException
- Generic RDF Exceptionpublic Model add(Resource s, Property p, java.lang.String o, java.lang.String l) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addl
- the language associated with the objectRDFException
- Generic RDF Exceptionpublic Model add(Resource s, Property p, java.lang.String o, java.lang.String l, boolean wellFormed) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addl
- the language associated with the objectwellFormed
- true if o is well formed XMLRDFException
- Generic RDF Exceptionpublic Model add(Resource s, Property p, java.lang.Object o) throws RDFException
s
- the subject of the statement to addp
- the predicate of the statement to addo
- the object of the statement to addRDFException
- Generic RDF Exceptionpublic Model remove(StmtIterator iter) throws RDFException
iter
- the iterator which returns the statements to be removed.RDFException
- Generic RDF Exceptionpublic Model remove(Model m) throws RDFException
m
- the model containing the statements to be removed.RDFException
- Generic RDF Exceptionpublic ResIterator listSubjectsWithProperty(Property p, boolean o) throws RDFException
p
- The predicate soughto
- The value soughtRDFException
- Generic RDF Exceptionpublic ResIterator listSubjectsWithProperty(Property p, long o) throws RDFException
p
- The predicate soughto
- The value soughtRDFException
- Generic RDF Exceptionpublic ResIterator listSubjectsWithProperty(Property p, char o) throws RDFException
p
- The predicate soughto
- The value soughtRDFException
- Generic RDF Exceptionpublic ResIterator listSubjectsWithProperty(Property p, float o) throws RDFException
p
- The predicate soughto
- The value soughtRDFException
- Generic RDF Exceptionpublic ResIterator listSubjectsWithProperty(Property p, double o) throws RDFException
p
- The property sought.o
- The property value sought.RDFException
- Generic RDF Exceptionpublic ResIterator listSubjectsWithProperty(Property p, java.lang.String o) throws RDFException
p
- The predicate sought.o
- The property value sought.RDFException
- Generic RDF Exceptionpublic ResIterator listSubjectsWithProperty(Property p, java.lang.String o, java.lang.String l) throws RDFException
p
- The predicate sought.o
- The property value sought.l
- the language associated with the objectRDFException
- Generic RDF Exceptionpublic ResIterator listSubjectsWithProperty(Property p, java.lang.Object o) throws RDFException
p
- The predicate soughto
- The value soughtRDFException
- Generic RDF Exceptionpublic boolean contains(Resource s, Property p, boolean o) throws RDFException
s
- The subject of the statment tested.p
- The predicate of the statement tested.o
- The object of the statement tested.RDFException
- Generic RDF Exceptionpublic boolean contains(Resource s, Property p, long o) throws RDFException
s
- The subject of the statment tested.p
- The predicate of the statement tested.o
- The object of the statement tested.RDFException
- Generic RDF Exceptionpublic boolean contains(Resource s, Property p, char o) throws RDFException
s
- The subject of the statment tested.p
- The predicate of the statement tested.o
- The object of the statement tested.RDFException
- Generic RDF Exceptionpublic boolean contains(Resource s, Property p, float o) throws RDFException
s
- The subject of the statment tested.p
- The predicate of the statement tested.o
- The object of the statement tested.RDFException
- Generic RDF Exceptionpublic boolean contains(Resource s, Property p, double o) throws RDFException
s
- The subject of the statment tested.p
- The predicate of the statement tested.o
- The object of the statement tested.RDFException
- Generic RDF Exceptionpublic boolean contains(Resource s, Property p, java.lang.String o) throws RDFException
s
- The subject of the statment tested.p
- The predicate of the statement tested.o
- The object of the statement tested.RDFException
- Generic RDF Exceptionpublic boolean contains(Resource s, Property p, java.lang.String o, java.lang.String l) throws RDFException
s
- The subject of the statment tested.p
- The predicate of the statement tested.o
- The object of the statement tested.l
- the language associated with the objectRDFException
- Generic RDF Exceptionpublic boolean contains(Resource s, Property p, java.lang.Object o) throws RDFException
s
- The subject of the statment tested.p
- The predicate of the statement tested.o
- The object of the statement tested.RDFException
- Generic RDF Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |