Triple constructor

Triple(
  1. RdfSubject subject,
  2. RdfPredicate predicate,
  3. RdfObject object
)

Creates a new triple with the specified subject, predicate, and object.

The constructor accepts any values that conform to the RDF term types that are allowed in each position, ensuring that only valid RDF triples can be created.

Parameters:

  • subject The subject of the triple (must be an IRI or blank node)
  • predicate The predicate of the triple (must be an IRI)
  • object The object of the triple (can be an IRI, blank node, or literal)

Example:

// Create a triple: <http://example.org/john> <http://xmlns.com/foaf/0.1/name> "John Smith"
final john = IriTerm('http://example.org/john');
final name = IriTerm('http://xmlns.com/foaf/0.1/name');
final johnSmith = LiteralTerm.string('John Smith');
final triple = Triple(john, name, johnSmith);

Implementation

Triple(this.subject, this.predicate, this.object);