fromTriples static method

RdfGraph fromTriples(
  1. Iterable<Triple> triples, {
  2. bool enableIndexing = true,
})

Creates an RDF graph from a list of triples (factory constructor)

This is a convenience factory method equivalent to the default constructor.

Parameters:

  • triples The collection of triples to include in the graph.
  • enableIndexing Whether to enable lazy indexing for query optimization. When enabled, an internal index is created lazily on first query to improve performance. The index is only built when needed, so enabling this option has no immediate memory cost. Defaults to true.

Example:

final graph = RdfGraph.fromTriples(myTriples);
final unindexedGraph = RdfGraph.fromTriples(myTriples, enableIndexing: false);

Implementation

static RdfGraph fromTriples(Iterable<Triple> triples,
        {bool enableIndexing = true}) =>
    RdfGraph(triples: triples, enableIndexing: enableIndexing);