Class RDFTriple

java.lang.Object
org.semanticweb.owlapi.io.RDFTriple
All Implemented Interfaces:
Serializable, Comparable<RDFTriple>, org.apache.commons.rdf.api.Triple, org.apache.commons.rdf.api.TripleLike

public class RDFTriple extends Object implements Serializable, Comparable<RDFTriple>, org.apache.commons.rdf.api.Triple
Since:
3.2
Author:
Matthew Horridge, The University of Manchester, Bio-Health Informatics Group
See Also:
  • Constructor Details

    • RDFTriple

      public RDFTriple(RDFResource subject, RDFResourceIRI predicate, RDFNode object)
      Parameters:
      subject - the subject
      predicate - the predicate
      object - the object
    • RDFTriple

      public RDFTriple(IRI subject, boolean subjectAnon, boolean subjectAxiom, IRI predicate, IRI object, boolean objectAnon, boolean objectAxiom)
      Parameters:
      subject - the subject
      subjectAnon - whether the subject is anonymous
      subjectAxiom - true if axiom
      predicate - the predicate
      object - the object
      objectAnon - whether the object is anonymous
      objectAxiom - true if axiom
    • RDFTriple

      public RDFTriple(IRI subject, boolean subjectAnon, boolean axiom, IRI predicate, OWLLiteral object)
      Parameters:
      subject - the subject
      subjectAnon - whether the subject is anonymous
      axiom - true if axiom
      predicate - the predicate
      object - the object
  • Method Details

    • isSubjectSameAsObject

      public boolean isSubjectSameAsObject()
      Returns:
      true if subject and object are the same
    • getSubject

      public RDFResource getSubject()
      Specified by:
      getSubject in interface org.apache.commons.rdf.api.Triple
      Specified by:
      getSubject in interface org.apache.commons.rdf.api.TripleLike
    • getPredicate

      public RDFResourceIRI getPredicate()
      Specified by:
      getPredicate in interface org.apache.commons.rdf.api.Triple
      Specified by:
      getPredicate in interface org.apache.commons.rdf.api.TripleLike
    • getObject

      public RDFNode getObject()
      Specified by:
      getObject in interface org.apache.commons.rdf.api.Triple
      Specified by:
      getObject in interface org.apache.commons.rdf.api.TripleLike
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface org.apache.commons.rdf.api.Triple
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Specified by:
      equals in interface org.apache.commons.rdf.api.Triple
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(@Nullable RDFTriple o)
      Specified by:
      compareTo in interface Comparable<RDFTriple>