|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An RDF Statement.
A statement is also itself a resource and can be both the subject and object of other statements.
Like other resources, a statement instance tracks which model it is associated with.
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 | |
boolean |
equals(java.lang.Object o)
determine whether two statements are equal. |
Alt |
getAlt()
Return the object of the statement. |
Bag |
getBag()
Return the object of the statement. |
boolean |
getBoolean()
Return the object of the statement. |
byte |
getByte()
Return the object of the statement. |
char |
getChar()
Return the object of the statement. |
double |
getDouble()
Return the object of the statement. |
float |
getFloat()
Return the object of the statement. |
int |
getInt()
Return the object of the statement. |
java.lang.String |
getLanguage()
Return the language of the object of the statement |
Literal |
getLiteral()
Return the object of the statement. |
long |
getLong()
Return the object of the statement. |
RDFNode |
getObject()
An accessor funtion to return the object of the statement. |
java.lang.Object |
getObject(ObjectF f)
Return the object of the statement. |
Property |
getPredicate()
An accessor function to return the predicate of the statement. |
Statement |
getProperty(Property p)
Get a property of the object of the statement. |
Resource |
getResource()
Return the object of the statement. |
Resource |
getResource(ResourceF f)
Return the object of the statement. |
Seq |
getSeq()
Return the object of the statement. |
short |
getShort()
Return the object of the statement. |
Statement |
getStatementProperty(Property p)
Return a property of this statement. |
java.lang.String |
getString()
Return the object of the statement. |
Resource |
getSubject()
An accessor method to return the subject of the statements. |
boolean |
getWellFormed()
Return whether the Literal object is well formed XML as would result from parsing a property element with parseType="Literal" |
boolean |
isReified()
Determine if this statement is the subject of any statements its associated model. |
Statement |
remove()
Remove this statement from its associated model. |
Statement |
set(boolean o)
Set the object of the statement. |
Statement |
set(char o)
Set the object of the statement. |
Statement |
set(double o)
Set the object of the statement. |
Statement |
set(float o)
Set the object of the statement. |
Statement |
set(long o)
Set the object of the statement. |
Statement |
set(java.lang.Object o)
Set the object of the statement. |
Statement |
set(RDFNode o)
Set the object of the statement. |
Statement |
set(java.lang.String o)
Set the object of the statement. |
Statement |
set(java.lang.String o,
boolean wellFormed)
Set the object of the statement. |
Statement |
set(java.lang.String o,
java.lang.String l)
Set the object of the statement. |
Statement |
set(java.lang.String o,
java.lang.String l,
boolean wellFormed)
Set the object of the statement. |
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.Resource |
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, getId, getLocalName, getModel, getNameSpace, getURI, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, isAnon, listProperties, listProperties, removeProperties, toString |
Method Detail |
public boolean equals(java.lang.Object o)
Two statements are considered to be equal if they have the the same subject, predicate and object. A statement can only be equal to another statement object.
equals
in interface Resource
equals
in class java.lang.Object
o
- the object to be comparedpublic Resource getSubject()
public Property getPredicate()
public RDFNode getObject()
public Statement getProperty(Property p) throws RDFException
There is an unfortunate ambiguity here. GetProperty would normally treat the statement as a resource, and return a property about this statement. This is not what is wanted in most cases, so getProperty on a statement is defined to call getProperty on its object. If a property of the statement itself is required, getStatementProperty should be used.
If the object of the statement is not a resource, an exception is thrown.
getProperty
in interface Resource
p
- the property soughtRDFException
- Generic RDF Exceptionpublic Statement getStatementProperty(Property p) throws RDFException
The model associated with this statement is searched for a statement with this statement as subject and the specified property as predicate. If such a statement is found it is return. If more than one exists in the model, then it is undefined which is returned. If no such statement exists, an exception is thrown.
p
- the property soughtRDFException
- Generic RDF exceptionpublic Resource getResource() throws RDFException
An exception will be thrown if the object is not a resource.
RDFException
- Generuc RDF exception.public Literal getLiteral() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public boolean getBoolean() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public byte getByte() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public short getShort() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public int getInt() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public long getLong() throws RDFException
An exception will be thrown iof the object is not a Literal.
RDFException
- Generuc RDF exception.public char getChar() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public float getFloat() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public double getDouble() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public java.lang.String getString() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public Resource getResource(ResourceF f) throws RDFException
An exception will be thrown if the object is not a Resource.
RDFException
- Generuc RDF exception.public java.lang.Object getObject(ObjectF f) throws RDFException
An exception will be thrown if the object is not a Literal.
f
- A factory used to create the returned object.RDFException
- Generuc RDF exception.public Bag getBag() throws RDFException
An exception will be thrown if the object is not a Resource.
RDFException
- Generuc RDF exception.public Alt getAlt() throws RDFException
An exception will be thrown if the object is not a Resource.
RDFException
- Generuc RDF exception.public Seq getSeq() throws RDFException
An exception will be thrown if the object is not a Resource.
RDFException
- Generuc RDF exception.public java.lang.String getLanguage() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public boolean getWellFormed() throws RDFException
An exception will be thrown if the object is not a Literal.
RDFException
- Generuc RDF exception.public Statement set(boolean o) throws RDFException
o
- The new value to be set.RDFException
- Generic RDF exception.public Statement set(long o) throws RDFException
The statement with the old value is removed from the model and a new statement with the new value added.
o
- The value to be set.RDFException
- Generic RDF exception.public Statement set(char o) throws RDFException
The statement with the old value is removed from the model and a new statement with the new value added.
o
- The value to be set.RDFException
- Generic RDF exception.public Statement set(float o) throws RDFException
The statement with the old value is removed from the model and a new statement with the new value added.
o
- The value to be set.RDFException
- Generic RDF exception.public Statement set(double o) throws RDFException
The statement with the old value is removed from the model and a new statement with the new value added.
o
- The value to be set.RDFException
- Generic RDF exception.public Statement set(java.lang.String o) throws RDFException
The statement with the old value is removed from the model and a new statement with the new value added.
o
- The value to be set.RDFException
- Generic RDF exception.public Statement set(java.lang.String o, boolean wellFormed) throws RDFException
The statement with the old value is removed from the model and a new statement with the new value added.
o
- The value to be set.wellFormed
- true if o is well formed XMLRDFException
- Generic RDF exception.public Statement set(java.lang.String o, java.lang.String l) throws RDFException
The statement with the old value is removed from the model and a new statement with the new value added.
o
- The value to be set.l
- the language of the StringRDFException
- Generic RDF exception.public Statement set(java.lang.String o, java.lang.String l, boolean wellFormed) throws RDFException
The statement with the old value is removed from the model and a new statement with the new value added.
o
- The value to be set.l
- the language of the StringRDFException
- Generic RDF exception.public Statement set(RDFNode o) throws RDFException
The statement with the old value is removed from the model and a new statement with the new value added.
o
- The value to be setwellFormed
- true if o is well formed XMLRDFException
- Generic RDF exception.public Statement set(java.lang.Object o) throws RDFException
The statement with the old value is removed from the model and a new statement with the new value added.
The Object o is converted to a string representation by calling itstoString()
method.o
- The value to be set.RDFException
- Generic RDF exception.public Statement remove() throws RDFException
The statement with the same subject, predicate and object as this statement will be removed from the model associated with this statement.
RDFException
- Generic RDF exception.public boolean isReified() throws RDFException
s
- The statement tested.RDFException
- Generic RDF Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |