Class PartialStatement
java.lang.Object
laas.openrobots.ontology.PartialStatement
- All Implemented Interfaces:
com.hp.hpl.jena.graph.FrontsTriple, com.hp.hpl.jena.rdf.model.Statement
A partial statement is a statement whose at least one element (subject, predicate or object) is unknown.
To be valid, a partial statement must have at least one variable, prepended with a "?". For instance:
"?mysterious oro:objProperty oro:individual"-
Nested Class Summary
Nested classes/interfaces inherited from interface com.hp.hpl.jena.rdf.model.Statement
com.hp.hpl.jena.rdf.model.Statement.Util -
Constructor Summary
ConstructorsConstructorDescriptionPartialStatement(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(String partialStatement, com.hp.hpl.jena.rdf.model.impl.ModelCom model) Create a new partial statement from its string representation.
Works asOpenRobotsOntology.createStatement(String)except at least one variable, prepended with a "?", is expected. This class implementsStatement, but thegetSubject(),getPredicate()andgetObject()method will returnnullif the corresponding part of the statement is unbounded. -
Method Summary
Modifier and TypeMethodDescriptionFormats 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.TripleasTriple()com.hp.hpl.jena.rdf.model.StatementchangeLiteralObject(boolean o) com.hp.hpl.jena.rdf.model.StatementchangeLiteralObject(char o) com.hp.hpl.jena.rdf.model.StatementchangeLiteralObject(double o) com.hp.hpl.jena.rdf.model.StatementchangeLiteralObject(float o) com.hp.hpl.jena.rdf.model.StatementchangeLiteralObject(int o) com.hp.hpl.jena.rdf.model.StatementchangeLiteralObject(long o) com.hp.hpl.jena.rdf.model.StatementchangeObject(com.hp.hpl.jena.rdf.model.RDFNode o) com.hp.hpl.jena.rdf.model.Statementcom.hp.hpl.jena.rdf.model.StatementchangeObject(String o, boolean wellFormed) com.hp.hpl.jena.rdf.model.StatementchangeObject(String o, String l) com.hp.hpl.jena.rdf.model.StatementchangeObject(String o, String l, boolean wellFormed) com.hp.hpl.jena.rdf.model.ReifiedStatementcom.hp.hpl.jena.rdf.model.ReifiedStatementcom.hp.hpl.jena.rdf.model.AltgetAlt()com.hp.hpl.jena.rdf.model.BaggetBag()booleanbytegetByte()chargetChar()doublefloatgetFloat()intgetInt()com.hp.hpl.jena.rdf.model.LiterallonggetLong()com.hp.hpl.jena.rdf.model.ModelgetModel()com.hp.hpl.jena.rdf.model.RDFNodecom.hp.hpl.jena.rdf.model.Propertycom.hp.hpl.jena.rdf.model.StatementgetProperty(com.hp.hpl.jena.rdf.model.Property p) com.hp.hpl.jena.rdf.model.Resourcecom.hp.hpl.jena.rdf.model.ResourcegetResource(com.hp.hpl.jena.rdf.model.ResourceF f) com.hp.hpl.jena.rdf.model.SeqgetSeq()shortgetShort()com.hp.hpl.jena.rdf.model.StatementgetStatementProperty(com.hp.hpl.jena.rdf.model.Property p) com.hp.hpl.jena.rdf.model.Resourcebooleanstatic booleanisPartialStatement(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 ?.booleancom.hp.hpl.jena.rdf.model.RSIteratorcom.hp.hpl.jena.rdf.model.Statementremove()voidtoString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.hp.hpl.jena.rdf.model.Statement
equals, hashCode
-
Constructor Details
-
PartialStatement
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) Creates a partial statement from a partial triplet (subject, predicate, object). At least one of the parameter is assumed to be null.- Parameters:
subject- The subject of the statementpredicate- The predicate of the statementobject- The object of the statementmodel- The ontology this partial statement refers to.
-
PartialStatement
public PartialStatement(String partialStatement, com.hp.hpl.jena.rdf.model.impl.ModelCom model) throws IllegalStatementException Create a new partial statement from its string representation.
Works asOpenRobotsOntology.createStatement(String)except at least one variable, prepended with a "?", is expected. This class implementsStatement, but thegetSubject(),getPredicate()andgetObject()method will returnnullif the corresponding part of the statement is unbounded.- Parameters:
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.- Throws:
IllegalStatementException- Currently thrown only if the statement doesn't contain three tokens.- See Also:
-
-
Method Details
-
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.- Returns:
- the formatted partial statement.
-
isPartialStatement
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 ?.- Parameters:
lex- a string to test- Returns:
- whether the statement is a partial statement or not.
-
toString
-
getSubject
public com.hp.hpl.jena.rdf.model.Resource getSubject()- Specified by:
getSubjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getPredicate
public com.hp.hpl.jena.rdf.model.Property getPredicate()- Specified by:
getPredicatein interfacecom.hp.hpl.jena.rdf.model.Statement
-
getObject
public com.hp.hpl.jena.rdf.model.RDFNode getObject()- Specified by:
getObjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
changeLiteralObject
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(boolean o) - Specified by:
changeLiteralObjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
changeLiteralObject
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(long o) - Specified by:
changeLiteralObjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
changeLiteralObject
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(int o) - Specified by:
changeLiteralObjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
changeLiteralObject
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(char o) - Specified by:
changeLiteralObjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
changeLiteralObject
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(float o) - Specified by:
changeLiteralObjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
changeLiteralObject
public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject(double o) - Specified by:
changeLiteralObjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
changeObject
- Specified by:
changeObjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
changeObject
public com.hp.hpl.jena.rdf.model.Statement changeObject(com.hp.hpl.jena.rdf.model.RDFNode o) - Specified by:
changeObjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
changeObject
- Specified by:
changeObjectin interfacecom.hp.hpl.jena.rdf.model.Statement
-
changeObject
-
changeObject
-
createReifiedStatement
public com.hp.hpl.jena.rdf.model.ReifiedStatement createReifiedStatement()- Specified by:
createReifiedStatementin interfacecom.hp.hpl.jena.rdf.model.Statement
-
createReifiedStatement
- Specified by:
createReifiedStatementin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getAlt
public com.hp.hpl.jena.rdf.model.Alt getAlt()- Specified by:
getAltin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getBag
public com.hp.hpl.jena.rdf.model.Bag getBag()- Specified by:
getBagin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getBoolean
public boolean getBoolean()- Specified by:
getBooleanin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getByte
public byte getByte()- Specified by:
getBytein interfacecom.hp.hpl.jena.rdf.model.Statement
-
getChar
public char getChar()- Specified by:
getCharin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getDouble
public double getDouble()- Specified by:
getDoublein interfacecom.hp.hpl.jena.rdf.model.Statement
-
getFloat
public float getFloat()- Specified by:
getFloatin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getInt
public int getInt()- Specified by:
getIntin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getLanguage
- Specified by:
getLanguagein interfacecom.hp.hpl.jena.rdf.model.Statement
-
getLiteral
public com.hp.hpl.jena.rdf.model.Literal getLiteral()- Specified by:
getLiteralin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getLong
public long getLong()- Specified by:
getLongin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getModel
public com.hp.hpl.jena.rdf.model.Model getModel()- Specified by:
getModelin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getProperty
public com.hp.hpl.jena.rdf.model.Statement getProperty(com.hp.hpl.jena.rdf.model.Property p) - Specified by:
getPropertyin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getResource
public com.hp.hpl.jena.rdf.model.Resource getResource()- Specified by:
getResourcein interfacecom.hp.hpl.jena.rdf.model.Statement
-
getSeq
public com.hp.hpl.jena.rdf.model.Seq getSeq()- Specified by:
getSeqin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getShort
public short getShort()- Specified by:
getShortin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getStatementProperty
public com.hp.hpl.jena.rdf.model.Statement getStatementProperty(com.hp.hpl.jena.rdf.model.Property p) - Specified by:
getStatementPropertyin interfacecom.hp.hpl.jena.rdf.model.Statement
-
getString
- Specified by:
getStringin interfacecom.hp.hpl.jena.rdf.model.Statement
-
hasWellFormedXML
public boolean hasWellFormedXML()- Specified by:
hasWellFormedXMLin interfacecom.hp.hpl.jena.rdf.model.Statement
-
isReified
public boolean isReified()- Specified by:
isReifiedin interfacecom.hp.hpl.jena.rdf.model.Statement
-
listReifiedStatements
public com.hp.hpl.jena.rdf.model.RSIterator listReifiedStatements()- Specified by:
listReifiedStatementsin interfacecom.hp.hpl.jena.rdf.model.Statement
-
remove
public com.hp.hpl.jena.rdf.model.Statement remove()- Specified by:
removein interfacecom.hp.hpl.jena.rdf.model.Statement
-
removeReification
public void removeReification()- Specified by:
removeReificationin interfacecom.hp.hpl.jena.rdf.model.Statement
-
asTriple
public com.hp.hpl.jena.graph.Triple asTriple()- Specified by:
asTriplein interfacecom.hp.hpl.jena.graph.FrontsTriple
-
getResource
public com.hp.hpl.jena.rdf.model.Resource getResource(com.hp.hpl.jena.rdf.model.ResourceF f) - Specified by:
getResourcein interfacecom.hp.hpl.jena.rdf.model.Statement
-