Triple class
Represents an RDF triple.
A triple is the atomic unit of data in RDF, consisting of three components:
- subject: The resource being described (IRI or BlankNode)
- predicate: The property or relationship (always an IRI)
- object: The value or related resource (IRI, BlankNode, or Literal)
Triple data structures implement the constraints of the RDF data model using Dart's type system to ensure that only valid RDF statements can be created. The type system enforces that:
- Subjects can only be IRIs or blank nodes
- Predicates can only be IRIs
- Objects can be IRIs, blank nodes, or literals
Example in Turtle syntax:
# A triple stating that "John has the name 'John Smith'"
<http://example.com/john> <http://xmlns.com/foaf/0.1/name> "John Smith" .
# A triple stating that "John knows Jane"
<http://example.com/john> <http://xmlns.com/foaf/0.1/knows> <http://example.com/jane> .
Constructors
- Triple(RdfSubject subject, RdfPredicate predicate, RdfObject object)
- Creates a new triple with the specified subject, predicate, and object.
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- object → RdfObject
-
The object of the triple, representing the value or related resource.
final
- predicate → RdfPredicate
-
The predicate of the triple, representing the property or relationship.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subject → RdfSubject
-
The subject of the triple, representing the resource being described.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
Returns a string representation of the triple in a Turtle-like syntax.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override