Package com.apicatalog.rdf.primitive
Class Triple
- java.lang.Object
-
- com.apicatalog.rdf.primitive.Triple
-
-
Field Summary
Fields Modifier and Type Field Description (package private) RdfTermobject(package private) RdfResourcepredicate(package private) RdfResourcesubject
-
Constructor Summary
Constructors Constructor Description Triple(RdfResource subject, RdfResource predicate, RdfTerm object)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Compares this RDF term to the specified object.inthashCode()Returns a hash code value for this RDF term.RdfTermobject()Returns the object of the triple.static RdfTripleof(RdfResource subject, RdfResource predicate, RdfTerm object)RdfResourcepredicate()Returns the predicate of the triple.(package private) static java.lang.StringBuilderprintTriple(java.lang.StringBuilder builder, RdfResource subject, RdfResource predicate, RdfTerm object)(package private) static java.lang.StringBuilderprintTripleTerm(java.lang.StringBuilder builder, RdfTriple triple)RdfResourcesubject()Returns the subject of the triple.java.lang.StringtoString()Returns a string representation of this RDF term.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.apicatalog.rdf.model.RdfTerm
asLiteral, asResource, isLiteral, isResource
-
-
-
-
Field Detail
-
subject
final RdfResource subject
-
predicate
final RdfResource predicate
-
object
final RdfTerm object
-
-
Constructor Detail
-
Triple
Triple(RdfResource subject, RdfResource predicate, RdfTerm object)
-
-
Method Detail
-
of
public static RdfTriple of(RdfResource subject, RdfResource predicate, RdfTerm object)
-
subject
public RdfResource subject()
Description copied from interface:RdfTripleReturns the subject of the triple.The subject is either an absolute IRI or a blank node identifier, denoting the resource being described by the statement.
- Specified by:
subjectin interfaceRdfTriple- Returns:
- a
RdfResourcerepresenting the subject of the triple; nevernull
-
predicate
public RdfResource predicate()
Description copied from interface:RdfTripleReturns the predicate of the triple.The predicate is an absolute IRI that specifies the property or relationship between the subject and the object of the triple.
- Specified by:
predicatein interfaceRdfTriple- Returns:
- a
RdfResourcerepresenting the predicate of the triple; nevernull
-
object
public RdfTerm object()
Description copied from interface:RdfTripleReturns the object of the triple.The object can be:
- An absolute IRI or blank node identifier (
RdfResource) - A literal value (
RdfLiteral) - Another
RdfTriple(RDF 1.2 - experimental support)
- An absolute IRI or blank node identifier (
-
toString
public java.lang.String toString()
Description copied from interface:RdfTermReturns a string representation of this RDF term.
-
hashCode
public int hashCode()
Description copied from interface:RdfTermReturns a hash code value for this RDF term.- Specified by:
hashCodein interfaceRdfTerm- Overrides:
hashCodein classjava.lang.Object- Returns:
- a hash code consistent with
RdfTerm.equals(Object).
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:RdfTermCompares this RDF term to the specified object. Implementations must override this method to provide equality checks appropriate to the term type.
-
printTriple
static final java.lang.StringBuilder printTriple(java.lang.StringBuilder builder, RdfResource subject, RdfResource predicate, RdfTerm object)
-
printTripleTerm
static final java.lang.StringBuilder printTripleTerm(java.lang.StringBuilder builder, RdfTriple triple)
-
-