public class StatementImpl extends StatementBase implements Statement
Constructor and Description |
---|
StatementImpl(Resource subject,
Property predicate,
RDFNode object) |
StatementImpl(Resource subject,
Property predicate,
RDFNode object,
ModelCom model)
Creates new StatementImpl
|
Modifier and Type | Method and Description |
---|---|
Resource |
asResource() |
Triple |
asTriple() |
static Triple[] |
asTriples(Statement[] statements)
returns an array of triples corresponding to the array of statements; ie
the i'th element of the result is the i'th element of the input as a triple.
|
static RDFNode |
createObject(Node n,
EnhGraph g)
create an RDF node which might be a literal, or not.
|
ReifiedStatement |
createReifiedStatement()
create a ReifiedStatement corresponding to this Statement
|
ReifiedStatement |
createReifiedStatement(String uri)
create a ReifiedStatement corresponding to this Statement
and with the given _uri_.
|
boolean |
equals(Object o)
.equals() defers to .sameAs so we only get the complexity of one cast.
|
Alt |
getAlt()
Return the object of the statement.
|
Bag |
getBag()
Return the object of the statement.
|
Literal |
getLiteral()
get the object field of this statement, insisting that it be a Literal.
|
RDFNode |
getObject()
An accessor funtion to 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)
Deprecated.
|
Seq |
getSeq()
Return the object of the statement.
|
Statement |
getStatementProperty(Property p)
Return a property of this statement.
|
Resource |
getSubject()
An accessor method to return the subject of the statements.
|
int |
hashCode()
Returns asTriple().hashCode()
|
boolean |
isReified()
Determine if this statement is the subject of any statements its associated
model.
|
RSIterator |
listReifiedStatements()
answer an iterator which delivers all the reified statements in the model
this Statement belongs to that match this Statement.
|
Statement |
remove()
Remove this statement from its associated model.
|
void |
removeReification()
Finds all possible resources which are
the reification of this statement, and for each
removes all four triples of the reification quad.
|
static Statement |
toStatement(Triple t,
ModelCom eg)
create a Statement from the triple _t_ in the enhanced graph _eg_.
|
changeLiteralObject, changeLiteralObject, changeLiteralObject, changeLiteralObject, changeLiteralObject, changeLiteralObject, changeObject, changeObject, changeObject, changeObject, changeObject, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLanguage, getLong, getModel, getShort, getString, getWellFormed, hasWellFormedXML, toString
changeLiteralObject, changeLiteralObject, changeLiteralObject, changeLiteralObject, changeLiteralObject, changeLiteralObject, changeObject, changeObject, changeObject, changeObject, changeObject, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLanguage, getLong, getModel, getShort, getString, hasWellFormedXML
public StatementImpl(Resource subject, Property predicate, RDFNode object, ModelCom model)
public static Statement toStatement(Triple t, ModelCom eg)
public Resource getSubject()
Statement
getSubject
in interface Statement
getSubject
in class StatementBase
public Property getPredicate()
Statement
getPredicate
in interface Statement
getPredicate
in class StatementBase
public RDFNode getObject()
Statement
getObject
in interface Statement
getObject
in class StatementBase
public Statement getStatementProperty(Property p)
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.
getStatementProperty
in interface Statement
p
- the property soughtpublic Resource getResource()
Statement
An exception will be thrown if the object is not a resource.
getResource
in interface Statement
getResource
in class StatementBase
@Deprecated public Resource getResource(ResourceF f)
Statement
An exception will be thrown if the object is not a Resource.
getResource
in interface Statement
public Statement getProperty(Property p)
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.
getProperty
in interface Statement
p
- the property soughtpublic Literal getLiteral()
getLiteral
in interface Statement
getLiteral
in class StatementBase
public Bag getBag()
Statement
An exception will be thrown if the object is not a Resource.
public Alt getAlt()
Statement
An exception will be thrown if the object is not a Resource.
public Seq getSeq()
Statement
An exception will be thrown if the object is not a Resource.
public boolean equals(Object o)
public int hashCode()
Statement
public Resource asResource()
public Statement remove()
Statement
The statement with the same subject, predicate and object as this statement will be removed from the model associated with this statement.
public void removeReification()
Statement
removeReification
in interface Statement
public Triple asTriple()
asTriple
in interface FrontsTriple
public static Triple[] asTriples(Statement[] statements)
statements
- the array of statements to convertpublic boolean isReified()
Statement
public ReifiedStatement createReifiedStatement()
createReifiedStatement
in interface Statement
public ReifiedStatement createReifiedStatement(String uri)
createReifiedStatement
in interface Statement
public RSIterator listReifiedStatements()
Statement
listReifiedStatements
in interface Statement
Licenced under the Apache License, Version 2.0