- All Superinterfaces:
FrontsTriple
- All Known Implementing Classes:
StatementImpl
A Statement is not a Resource, but can produce a ReifiedStatement that represents it and from which the Statement can be recovered.
A statement instance tracks which model created it, if any. All the Resource components of a Statement are in the same model as the Statement, if it has one, and are in no model if the Statement isn't.
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.
-
Method Summary
Modifier and TypeMethodDescriptionchangeLiteralObject
(boolean o) Remove this statement (s, p, x) from the model that contains it.changeLiteralObject
(char o) Remove this statement (s, p, x) from the model that contains it.changeLiteralObject
(double o) Remove this statement (s, p, x) from the model that contains it.changeLiteralObject
(float o) Remove this statement (s, p, x) from the model that contains it.changeLiteralObject
(int o) Remove this statement (s, p, x) from the model that contains it.changeLiteralObject
(long o) Remove this statement (s, p, x) from the model that contains it.change the object of the statement (S, P, X) to (S, P, o).changeObject
(String o, boolean wellFormed) change the object of the statement (S, P, X) to (S, P, o).changeObject
(String o, String l) change the object of the statement (S, P, X) to (S, P, o).changeObject
(String o, String l, boolean wellFormed) change the object of the statement (S, P, X) to (S, P, o).change the object of the statement (S, P, X) to (S, P, o).answer a ReifiedStatement object that embodies this Statement and is in the same Model (if any).answer a ReifiedStatement object that embodies this Statement, has the same Model, and has the givenuri
.boolean
determine whether two statements are equal.getAlt()
Return the object of the statement.getBag()
Return the object of the statement.boolean
Return the object of the statement.byte
getByte()
Return the object of the statement.char
getChar()
Return the object of the statement.double
Return the object of the statement.float
getFloat()
Return the object of the statement.int
getInt()
Return the object of the statement.Return the language of the object of the statement.getList()
Return the object of the statement as an RDF List.Return the object of the statement.long
getLong()
Return the object of the statement.getModel()
get the Model this Statement was created in.An accessor funtion to return the object of the statement.An accessor function to return the predicate of the statement.Get a property of the object of the statement.Return the object of the statement.Deprecated.getSeq()
Return the object of the statement.short
getShort()
Return the object of the statement.Return a property of this statement.Return the object of the statement.An accessor method to return the subject of the statements.int
hashCode()
Returns asTriple().hashCode()boolean
Answer true iff the Literal object of this statement is well-formed XML (ie equivalent to getLiteral().isWellFormedXML()).boolean
Determine if this statement is the subject of any statements its associated model.answer an iterator which delivers all the reified statements in the model this Statement belongs to that match this Statement.remove()
Remove this statement from its associated model.void
Finds all possible resources which are the reification of this statement, and for each removes all four triples of the reification quad.Methods inherited from interface org.apache.jena.graph.FrontsTriple
asTriple
-
Method Details
-
equals
determine whether two statements are equal.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.
-
hashCode
int hashCode()Returns asTriple().hashCode() -
getSubject
Resource getSubject()An accessor method to return the subject of the statements.- Returns:
- The subject of the statement.
-
getPredicate
Property getPredicate()An accessor function to return the predicate of the statement.- Returns:
- The predicate of the statement.
-
getObject
RDFNode getObject()An accessor funtion to return the object of the statement.- Returns:
- Return the object of the statement.
-
getProperty
Get a property of the object of the statement.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.
- Parameters:
p
- the property sought- Returns:
- a statement representing an instance of the required property
-
getStatementProperty
Return a property of this statement.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.
- Parameters:
p
- the property sought- Returns:
- a statement representing an instance of the specified property.
-
getResource
Resource getResource()Return the object of the statement.An exception will be thrown if the object is not a resource.
- Returns:
- The Resource which is the object of the statement.
-
getLiteral
Literal getLiteral()Return the object of the statement.An exception will be thrown if the object is not a Literal.
- Returns:
- The Literal which is the object of the statement.
-
getBoolean
boolean getBoolean()Return the object of the statement.An exception will be thrown if the object is not a Literal.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getByte
byte getByte()Return the object of the statement.An exception will be thrown if the object is not a Literal.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getShort
short getShort()Return the object of the statement.An exception will be thrown if the object is not a Literal.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getInt
int getInt()Return the object of the statement.An exception will be thrown if the object is not a Literal.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getLong
long getLong()Return the object of the statement.An exception will be thrown iof the object is not a Literal.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getChar
char getChar()Return the object of the statement.An exception will be thrown if the object is not a Literal.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getFloat
float getFloat()Return the object of the statement.An exception will be thrown if the object is not a Literal.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getDouble
double getDouble()Return the object of the statement.An exception will be thrown if the object is not a Literal.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getString
String getString()Return the object of the statement.An exception will be thrown if the object is not a Literal.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getResource
Deprecated.Return the object of the statement.An exception will be thrown if the object is not a Resource.
- Returns:
- The object of the statement.
-
getBag
Bag getBag()Return the object of the statement.An exception will be thrown if the object is not a Resource.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getAlt
Alt getAlt()Return the object of the statement.An exception will be thrown if the object is not a Resource.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getSeq
Seq getSeq()Return the object of the statement.An exception will be thrown if the object is not a Resource.
- Returns:
- The object of the statement interpreted as a value of the specified type.
-
getList
RDFList getList()Return the object of the statement as an RDF List.An exception will be thrown if the object is not an
RDFList
.- Returns:
- The object of the statement interpreted as a value as RDFList.
-
getLanguage
String getLanguage()Return the language of the object of the statement.An exception will be thrown if the object is not a Literal.
- Returns:
- the language of the object of the statement
-
hasWellFormedXML
boolean hasWellFormedXML()Answer true iff the Literal object of this statement is well-formed XML (ie equivalent to getLiteral().isWellFormedXML()). If the object is not a Literal, throw an exception. -
changeLiteralObject
Remove this statement (s, p, x) from the model that contains it. Create a new statement (s, p, o'), where o' is the typed literal corresponding to o, add it to the model, and answer it. -
changeLiteralObject
Remove this statement (s, p, x) from the model that contains it. Create a new statement (s, p, o'), where o' is the typed literal corresponding to o, add it to the model, and answer it. -
changeLiteralObject
Remove this statement (s, p, x) from the model that contains it. Create a new statement (s, p, o'), where o' is the typed literal corresponding to o, add it to the model, and answer it. -
changeLiteralObject
Remove this statement (s, p, x) from the model that contains it. Create a new statement (s, p, o'), where o' is the typed literal corresponding to o, add it to the model, and answer it. -
changeLiteralObject
Remove this statement (s, p, x) from the model that contains it. Create a new statement (s, p, o'), where o' is the typed literal corresponding to o, add it to the model, and answer it. -
changeLiteralObject
Remove this statement (s, p, x) from the model that contains it. Create a new statement (s, p, o'), where o' is the typed literal corresponding to o, add it to the model, and answer it. -
changeObject
change the object of the statement (S, P, X) to (S, P, o).The statement with the old value is removed from the model and a new statement with the new value added and returned.
- Parameters:
o
- The value to be set.- Returns:
- the new (S, P, o) statement.
-
changeObject
change the object of the statement (S, P, X) to (S, P, o).The statement with the old value is removed from the model and a new statement with the new value added and returned.
- Parameters:
o
- The value to be set.wellFormed
- true if o is well formed XML- Returns:
- the new (S, P, o) statement.
-
changeObject
change the object of the statement (S, P, X) to (S, P, o).The statement with the old value is removed from the model and a new statement with the new value added.
- Parameters:
o
- The value to be set.l
- the language of the String- Returns:
- the new (S, P, o) statement..
-
changeObject
change the object of the statement (S, P, X) to (S, P, o).The statement with the old value is removed from the model and a new statement with the new value added.
- Parameters:
o
- The value to be set.l
- the language of the String- Returns:
- the new (S, P, o) statement.
-
changeObject
change the object of the statement (S, P, X) to (S, P, o).The statement with the old value is removed from the model and a new statement with the new value added.
- Parameters:
o
- The value to be set- Returns:
- the new (S, P, o) statement.
-
remove
Statement remove()Remove this statement from its associated model.The statement with the same subject, predicate and object as this statement will be removed from the model associated with this statement.
- Returns:
- this statement.
-
isReified
boolean isReified()Determine if this statement is the subject of any statements its associated model.- Returns:
- true iff this statement is the subject of a statement in the model.
-
createReifiedStatement
ReifiedStatement createReifiedStatement()answer a ReifiedStatement object that embodies this Statement and is in the same Model (if any). -
createReifiedStatement
answer a ReifiedStatement object that embodies this Statement, has the same Model, and has the givenuri
. -
listReifiedStatements
RSIterator listReifiedStatements()answer an iterator which delivers all the reified statements in the model this Statement belongs to that match this Statement. -
getModel
Model getModel()get the Model this Statement was created in. -
removeReification
void removeReification()Finds all possible resources which are the reification of this statement, and for each removes all four triples of the reification quad.
-