Class PartialStatement

  • All Implemented Interfaces:
    com.hp.hpl.jena.graph.FrontsTriple, com.hp.hpl.jena.rdf.model.Statement

    public class PartialStatement
    extends java.lang.Object
    implements 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

      Constructors 
      Constructor 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.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.hp.hpl.jena.rdf.model.Statement

        equals, hashCode
    • Constructor Detail

      • 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 statement
        predicate - The predicate of the statement
        object - The object of the statement
        model - The ontology this partial statement refers to.
      • PartialStatement

        public PartialStatement​(java.lang.String partialStatement,
                                com.hp.hpl.jena.rdf.model.impl.ModelCom model)
                         throws IllegalStatementException
        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.
        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:
        Syntax details
    • Method Detail

      • asSparqlRow

        public 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.
        Returns:
        the formatted partial statement.
      • isPartialStatement

        public 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 ?.
        Parameters:
        lex - a string to test
        Returns:
        whether the statement is a partial statement or not.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getSubject

        public com.hp.hpl.jena.rdf.model.Resource getSubject()
        Specified by:
        getSubject in interface com.hp.hpl.jena.rdf.model.Statement
      • getPredicate

        public com.hp.hpl.jena.rdf.model.Property getPredicate()
        Specified by:
        getPredicate in interface com.hp.hpl.jena.rdf.model.Statement
      • getObject

        public com.hp.hpl.jena.rdf.model.RDFNode getObject()
        Specified by:
        getObject in interface com.hp.hpl.jena.rdf.model.Statement
      • changeLiteralObject

        public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject​(boolean o)
        Specified by:
        changeLiteralObject in interface com.hp.hpl.jena.rdf.model.Statement
      • changeLiteralObject

        public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject​(long o)
        Specified by:
        changeLiteralObject in interface com.hp.hpl.jena.rdf.model.Statement
      • changeLiteralObject

        public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject​(int o)
        Specified by:
        changeLiteralObject in interface com.hp.hpl.jena.rdf.model.Statement
      • changeLiteralObject

        public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject​(char o)
        Specified by:
        changeLiteralObject in interface com.hp.hpl.jena.rdf.model.Statement
      • changeLiteralObject

        public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject​(float o)
        Specified by:
        changeLiteralObject in interface com.hp.hpl.jena.rdf.model.Statement
      • changeLiteralObject

        public com.hp.hpl.jena.rdf.model.Statement changeLiteralObject​(double o)
        Specified by:
        changeLiteralObject in interface com.hp.hpl.jena.rdf.model.Statement
      • changeObject

        public com.hp.hpl.jena.rdf.model.Statement changeObject​(java.lang.String o)
        Specified by:
        changeObject in interface com.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:
        changeObject in interface com.hp.hpl.jena.rdf.model.Statement
      • changeObject

        public com.hp.hpl.jena.rdf.model.Statement changeObject​(java.lang.String o,
                                                                boolean wellFormed)
        Specified by:
        changeObject in interface com.hp.hpl.jena.rdf.model.Statement
      • changeObject

        public com.hp.hpl.jena.rdf.model.Statement changeObject​(java.lang.String o,
                                                                java.lang.String l)
        Specified by:
        changeObject in interface com.hp.hpl.jena.rdf.model.Statement
      • changeObject

        public com.hp.hpl.jena.rdf.model.Statement changeObject​(java.lang.String o,
                                                                java.lang.String l,
                                                                boolean wellFormed)
        Specified by:
        changeObject in interface com.hp.hpl.jena.rdf.model.Statement
      • createReifiedStatement

        public com.hp.hpl.jena.rdf.model.ReifiedStatement createReifiedStatement()
        Specified by:
        createReifiedStatement in interface com.hp.hpl.jena.rdf.model.Statement
      • createReifiedStatement

        public com.hp.hpl.jena.rdf.model.ReifiedStatement createReifiedStatement​(java.lang.String uri)
        Specified by:
        createReifiedStatement in interface com.hp.hpl.jena.rdf.model.Statement
      • getAlt

        public com.hp.hpl.jena.rdf.model.Alt getAlt()
        Specified by:
        getAlt in interface com.hp.hpl.jena.rdf.model.Statement
      • getBag

        public com.hp.hpl.jena.rdf.model.Bag getBag()
        Specified by:
        getBag in interface com.hp.hpl.jena.rdf.model.Statement
      • getBoolean

        public boolean getBoolean()
        Specified by:
        getBoolean in interface com.hp.hpl.jena.rdf.model.Statement
      • getByte

        public byte getByte()
        Specified by:
        getByte in interface com.hp.hpl.jena.rdf.model.Statement
      • getChar

        public char getChar()
        Specified by:
        getChar in interface com.hp.hpl.jena.rdf.model.Statement
      • getDouble

        public double getDouble()
        Specified by:
        getDouble in interface com.hp.hpl.jena.rdf.model.Statement
      • getFloat

        public float getFloat()
        Specified by:
        getFloat in interface com.hp.hpl.jena.rdf.model.Statement
      • getInt

        public int getInt()
        Specified by:
        getInt in interface com.hp.hpl.jena.rdf.model.Statement
      • getLanguage

        public java.lang.String getLanguage()
        Specified by:
        getLanguage in interface com.hp.hpl.jena.rdf.model.Statement
      • getLiteral

        public com.hp.hpl.jena.rdf.model.Literal getLiteral()
        Specified by:
        getLiteral in interface com.hp.hpl.jena.rdf.model.Statement
      • getLong

        public long getLong()
        Specified by:
        getLong in interface com.hp.hpl.jena.rdf.model.Statement
      • getModel

        public com.hp.hpl.jena.rdf.model.Model getModel()
        Specified by:
        getModel in interface com.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:
        getProperty in interface com.hp.hpl.jena.rdf.model.Statement
      • getResource

        public com.hp.hpl.jena.rdf.model.Resource getResource()
        Specified by:
        getResource in interface com.hp.hpl.jena.rdf.model.Statement
      • getSeq

        public com.hp.hpl.jena.rdf.model.Seq getSeq()
        Specified by:
        getSeq in interface com.hp.hpl.jena.rdf.model.Statement
      • getShort

        public short getShort()
        Specified by:
        getShort in interface com.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:
        getStatementProperty in interface com.hp.hpl.jena.rdf.model.Statement
      • getString

        public java.lang.String getString()
        Specified by:
        getString in interface com.hp.hpl.jena.rdf.model.Statement
      • hasWellFormedXML

        public boolean hasWellFormedXML()
        Specified by:
        hasWellFormedXML in interface com.hp.hpl.jena.rdf.model.Statement
      • isReified

        public boolean isReified()
        Specified by:
        isReified in interface com.hp.hpl.jena.rdf.model.Statement
      • listReifiedStatements

        public com.hp.hpl.jena.rdf.model.RSIterator listReifiedStatements()
        Specified by:
        listReifiedStatements in interface com.hp.hpl.jena.rdf.model.Statement
      • remove

        public com.hp.hpl.jena.rdf.model.Statement remove()
        Specified by:
        remove in interface com.hp.hpl.jena.rdf.model.Statement
      • removeReification

        public void removeReification()
        Specified by:
        removeReification in interface com.hp.hpl.jena.rdf.model.Statement
      • asTriple

        public com.hp.hpl.jena.graph.Triple asTriple()
        Specified by:
        asTriple in interface com.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:
        getResource in interface com.hp.hpl.jena.rdf.model.Statement