namedGraphs property

Iterable<RdfNamedGraph> get namedGraphs

Get all named graphs as RdfNamedGraph instances

Returns all named graphs in this dataset as RdfNamedGraph objects, which pair each graph with its IRI name for convenient iteration.

Returns: An iterable collection of RdfNamedGraph instances representing all named graphs in the dataset. May be empty if the dataset contains only the default graph.

Example:

for (final namedGraph in dataset.namedGraphs) {
  print('Processing graph: ${namedGraph.name.iri}');
  print('Contains ${namedGraph.graph.size} triples');
}

Implementation

Iterable<RdfNamedGraph> get namedGraphs => _namedGraphs.entries
    .map((entry) => RdfNamedGraph(entry.key, entry.value));