RdfGraph constructor

RdfGraph({
  1. Iterable<Triple> triples = const [],
})

Creates an immutable RDF graph from a list of triples

The constructor makes a defensive copy of the provided triples list to ensure immutability. The graph can be initialized with an empty list to create an empty graph.

Example:

// Empty graph
final emptyGraph = RdfGraph();

// Graph with initial triples
final graph = RdfGraph(triples: myTriples);

Implementation

RdfGraph({Iterable<Triple> triples = const []})
    : _triples = List.unmodifiable(List.from(triples));