RdfDataset.fromDefaultGraph constructor

RdfDataset.fromDefaultGraph(
  1. RdfGraph graph
)

Creates a dataset from a default graph with no named graphs

This factory constructor is useful when you have an existing graph that should serve as the dataset's default graph, with no additional named graphs.

Parameters:

  • graph The RDF graph to use as the default graph

Example:

final myGraph = RdfGraph(triples: [triple1, triple2]);
final dataset = RdfDataset.fromDefaultGraph(myGraph);
assert(dataset.defaultGraph == myGraph);
assert(dataset.graphNames.isEmpty);

Implementation

RdfDataset.fromDefaultGraph(RdfGraph graph)
    : defaultGraph = graph,
      _namedGraphs = {};