Class StatementImpl

    • Method Detail

      • toStatement

        public static Statement toStatement​(Triple t,
                                            ModelCom eg)
        create a Statement from the triple _t_ in the enhanced graph _eg_. The Statement has subject, predicate, and object corresponding to those of _t_.
      • getObject

        public RDFNode getObject()
        Description copied from interface: Statement
        An accessor funtion to return the object of the statement.
        Specified by:
        getObject in interface Statement
        Specified by:
        getObject in class StatementBase
        Returns:
        Return the object of the statement.
      • getStatementProperty

        public Statement getStatementProperty​(Property p)
        Description copied from interface: Statement
        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.

        Specified by:
        getStatementProperty in interface Statement
        Parameters:
        p - the property sought
        Returns:
        a statement representing an instance of the specified property.
      • getResource

        public Resource getResource()
        Description copied from interface: Statement
        Return the object of the statement.

        An exception will be thrown if the object is not a resource.

        Specified by:
        getResource in interface Statement
        Specified by:
        getResource in class StatementBase
        Returns:
        The Resource which is the object of the statement.
      • getResource

        @Deprecated
        public Resource getResource​(ResourceF f)
        Deprecated.
        Description copied from interface: Statement
        Return the object of the statement.

        An exception will be thrown if the object is not a Resource.

        Specified by:
        getResource in interface Statement
        Returns:
        The object of the statement.
      • getProperty

        public Statement getProperty​(Property p)
        Description copied from interface: Statement
        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.

        Specified by:
        getProperty in interface Statement
        Parameters:
        p - the property sought
        Returns:
        a statement representing an instance of the required property
      • getLiteral

        public Literal getLiteral()
        get the object field of this statement, insisting that it be a Literal. If it isn't, throw LiteralRequiredException.
        Specified by:
        getLiteral in interface Statement
        Specified by:
        getLiteral in class StatementBase
        Returns:
        The Literal which is the object of the statement.
      • getBag

        public Bag getBag()
        Description copied from interface: Statement
        Return the object of the statement.

        An exception will be thrown if the object is not a Resource.

        Specified by:
        getBag in interface Statement
        Returns:
        The object of the statement interpreted as a value of the specified type.
      • getAlt

        public Alt getAlt()
        Description copied from interface: Statement
        Return the object of the statement.

        An exception will be thrown if the object is not a Resource.

        Specified by:
        getAlt in interface Statement
        Returns:
        The object of the statement interpreted as a value of the specified type.
      • getSeq

        public Seq getSeq()
        Description copied from interface: Statement
        Return the object of the statement.

        An exception will be thrown if the object is not a Resource.

        Specified by:
        getSeq in interface Statement
        Returns:
        The object of the statement interpreted as a value of the specified type.
      • getList

        public RDFList getList()
        Description copied from interface: Statement
        Return the object of the statement as an RDF List.

        An exception will be thrown if the object is not an RDFList.

        Specified by:
        getList in interface Statement
        Returns:
        The object of the statement interpreted as a value as RDFList.
      • equals

        public boolean equals​(java.lang.Object o)
        .equals() defers to .sameAs so we only get the complexity of one cast.
        Specified by:
        equals in interface Statement
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - the object to be compared
        Returns:
        true if and only if the equality condition is met.
      • hashCode

        public int hashCode()
        Description copied from interface: Statement
        Returns asTriple().hashCode()
        Specified by:
        hashCode in interface Statement
        Overrides:
        hashCode in class java.lang.Object
      • asResource

        public Resource asResource()
      • remove

        public Statement remove()
        Description copied from interface: Statement
        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.

        Specified by:
        remove in interface Statement
        Returns:
        this statement.
      • removeReification

        public void removeReification()
        Description copied from interface: Statement
        Finds all possible resources which are the reification of this statement, and for each removes all four triples of the reification quad.
        Specified by:
        removeReification in interface Statement
      • asTriples

        public 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.
        Parameters:
        statements - the array of statements to convert
        Returns:
        the corresponding array of triples
      • isReified

        public boolean isReified()
        Description copied from interface: Statement
        Determine if this statement is the subject of any statements its associated model.
        Specified by:
        isReified in interface Statement
        Returns:
        true iff this statement is the subject of a statement in the model.
      • createReifiedStatement

        public ReifiedStatement createReifiedStatement​(java.lang.String uri)
        create a ReifiedStatement corresponding to this Statement and with the given _uri_.
        Specified by:
        createReifiedStatement in interface Statement
      • listReifiedStatements

        public RSIterator listReifiedStatements()
        Description copied from interface: Statement
        answer an iterator which delivers all the reified statements in the model this Statement belongs to that match this Statement.
        Specified by:
        listReifiedStatements in interface Statement
      • createObject

        public static RDFNode createObject​(Node n,
                                           EnhGraph g)
        create an RDF node which might be a literal, or not.