public class PartialStatement
extends java.lang.Object
implements com.hp.hpl.jena.rdf.model.Statement
"?mysterious oro:objProperty oro:individual"
Constructor and Description |
---|
PartialStatement(com.hp.hpl.jena.rdf.model.Resource subject,
com.hp.hpl.jena.rdf.model.Property predicate,
com.hp.hpl.jena.rdf.model.RDFNode object,
com.hp.hpl.jena.rdf.model.impl.ModelCom model)
Creates a partial statement from a partial triplet (subject, predicate, object).
|
PartialStatement(java.lang.String partialStatement,
com.hp.hpl.jena.rdf.model.impl.ModelCom model)
Create a new partial statement from its string representation.
Works as OpenRobotsOntology.createStatement(String) except at least one variable, prepended with a "?", is expected.
This class implements Statement , but the getSubject() , getPredicate() and getObject() method will return null if the corresponding part of the statement is unbounded. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asSparqlRow()
Formats a partial statement for inclusion in a SPARQL query.
Unbounded resources of the statement are rendered with "?" as prefixes, other parts are rendered as resources with their full URIs.
|
com.hp.hpl.jena.graph.Triple |
asTriple() |
com.hp.hpl.jena.rdf.model.Statement |
changeLiteralObject(boolean o) |
com.hp.hpl.jena.rdf.model.Statement |
changeLiteralObject(char o) |
com.hp.hpl.jena.rdf.model.Statement |
changeLiteralObject(double o) |
com.hp.hpl.jena.rdf.model.Statement |
changeLiteralObject(float o) |
com.hp.hpl.jena.rdf.model.Statement |
changeLiteralObject(int o) |
com.hp.hpl.jena.rdf.model.Statement |
changeLiteralObject(long o) |
com.hp.hpl.jena.rdf.model.Statement |
changeObject(com.hp.hpl.jena.rdf.model.RDFNode o) |
com.hp.hpl.jena.rdf.model.Statement |
changeObject(java.lang.String o) |
com.hp.hpl.jena.rdf.model.Statement |
changeObject(java.lang.String o,
boolean wellFormed) |
com.hp.hpl.jena.rdf.model.Statement |
changeObject(java.lang.String o,
java.lang.String l) |
com.hp.hpl.jena.rdf.model.Statement |
changeObject(java.lang.String o,
java.lang.String l,
boolean wellFormed) |
com.hp.hpl.jena.rdf.model.ReifiedStatement |
createReifiedStatement() |
com.hp.hpl.jena.rdf.model.ReifiedStatement |
createReifiedStatement(java.lang.String uri) |
com.hp.hpl.jena.rdf.model.Alt |
getAlt() |
com.hp.hpl.jena.rdf.model.Bag |
getBag() |
boolean |
getBoolean() |
byte |
getByte() |
char |
getChar() |
double |
getDouble() |
float |
getFloat() |
int |
getInt() |
java.lang.String |
getLanguage() |
com.hp.hpl.jena.rdf.model.Literal |
getLiteral() |
long |
getLong() |
com.hp.hpl.jena.rdf.model.Model |
getModel() |
com.hp.hpl.jena.rdf.model.RDFNode |
getObject() |
com.hp.hpl.jena.rdf.model.Property |
getPredicate() |
com.hp.hpl.jena.rdf.model.Statement |
getProperty(com.hp.hpl.jena.rdf.model.Property p) |
com.hp.hpl.jena.rdf.model.Resource |
getResource() |
com.hp.hpl.jena.rdf.model.Resource |
getResource(com.hp.hpl.jena.rdf.model.ResourceF f) |
com.hp.hpl.jena.rdf.model.Seq |
getSeq() |
short |
getShort() |
com.hp.hpl.jena.rdf.model.Statement |
getStatementProperty(com.hp.hpl.jena.rdf.model.Property p) |
java.lang.String |
getString() |
com.hp.hpl.jena.rdf.model.Resource |
getSubject() |
boolean |
hasWellFormedXML() |
static boolean |
isPartialStatement(java.lang.String lex)
Performs basic tests to determine if a statement is a partial statement, ie if the given string contains three tokens and at least one token starting with ?.
|
boolean |
isReified() |
com.hp.hpl.jena.rdf.model.RSIterator |
listReifiedStatements() |
com.hp.hpl.jena.rdf.model.Statement |
remove() |
void |
removeReification() |
java.lang.String |
toString() |
public PartialStatement(com.hp.hpl.jena.rdf.model.Resource subject, com.hp.hpl.jena.rdf.model.Property predicate, com.hp.hpl.jena.rdf.model.RDFNode object, com.hp.hpl.jena.rdf.model.impl.ModelCom model)
subject
- The subject of the statementpredicate
- The predicate of the statementobject
- The object of the statementmodel
- The ontology this partial statement refers to.public PartialStatement(java.lang.String partialStatement, com.hp.hpl.jena.rdf.model.impl.ModelCom model) throws IllegalStatementException
OpenRobotsOntology.createStatement(String)
except at least one variable, prepended with a "?", is expected.
This class implements Statement
, but the getSubject()
, getPredicate()
and getObject()
method will return null
if the corresponding part of the statement is unbounded.partialStatement
- The string representing the partial statement. For example, "?mysterious oro:objProperty2 ?object"
or "?subject oro:dataProperty1 true"
are valid.model
- The ontology this partial statement refers to.IllegalStatementException
- Currently thrown only if the statement doesn't contain three tokens.Syntax details
public java.lang.String asSparqlRow()
public static boolean isPartialStatement(java.lang.String lex)
lex
- a string to testpublic java.lang.String toString()
toString
in class java.lang.Object
public com.hp.hpl.jena.rdf.model.Resource getSubject()
getSubject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Property getPredicate()
getPredicate
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.RDFNode getObject()
getObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(boolean o)
changeLiteralObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(long o)
changeLiteralObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(int o)
changeLiteralObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(char o)
changeLiteralObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(float o)
changeLiteralObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(double o)
changeLiteralObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeObject(java.lang.String o)
changeObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeObject(com.hp.hpl.jena.rdf.model.RDFNode o)
changeObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeObject(java.lang.String o, boolean wellFormed)
changeObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeObject(java.lang.String o, java.lang.String l)
changeObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement changeObject(java.lang.String o, java.lang.String l, boolean wellFormed)
changeObject
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.ReifiedStatement createReifiedStatement()
createReifiedStatement
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.ReifiedStatement createReifiedStatement(java.lang.String uri)
createReifiedStatement
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Alt getAlt()
getAlt
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Bag getBag()
getBag
in interface com.hp.hpl.jena.rdf.model.Statement
public boolean getBoolean()
getBoolean
in interface com.hp.hpl.jena.rdf.model.Statement
public byte getByte()
getByte
in interface com.hp.hpl.jena.rdf.model.Statement
public char getChar()
getChar
in interface com.hp.hpl.jena.rdf.model.Statement
public double getDouble()
getDouble
in interface com.hp.hpl.jena.rdf.model.Statement
public float getFloat()
getFloat
in interface com.hp.hpl.jena.rdf.model.Statement
public int getInt()
getInt
in interface com.hp.hpl.jena.rdf.model.Statement
public java.lang.String getLanguage()
getLanguage
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Literal getLiteral()
getLiteral
in interface com.hp.hpl.jena.rdf.model.Statement
public long getLong()
getLong
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Model getModel()
getModel
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement getProperty(com.hp.hpl.jena.rdf.model.Property p)
getProperty
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Resource getResource()
getResource
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Seq getSeq()
getSeq
in interface com.hp.hpl.jena.rdf.model.Statement
public short getShort()
getShort
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement getStatementProperty(com.hp.hpl.jena.rdf.model.Property p)
getStatementProperty
in interface com.hp.hpl.jena.rdf.model.Statement
public java.lang.String getString()
getString
in interface com.hp.hpl.jena.rdf.model.Statement
public boolean hasWellFormedXML()
hasWellFormedXML
in interface com.hp.hpl.jena.rdf.model.Statement
public boolean isReified()
isReified
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.RSIterator listReifiedStatements()
listReifiedStatements
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.rdf.model.Statement remove()
remove
in interface com.hp.hpl.jena.rdf.model.Statement
public void removeReification()
removeReification
in interface com.hp.hpl.jena.rdf.model.Statement
public com.hp.hpl.jena.graph.Triple asTriple()
asTriple
in interface com.hp.hpl.jena.graph.FrontsTriple
public com.hp.hpl.jena.rdf.model.Resource getResource(com.hp.hpl.jena.rdf.model.ResourceF f)
getResource
in interface com.hp.hpl.jena.rdf.model.Statement
ORO is a part of the OpenRobots framework.
openrobots@laas.fr
LAAS-CNRS 2009-2011