RdfNamedGraph constructor

RdfNamedGraph(
  1. RdfGraphName name,
  2. RdfGraph graph
)

Creates a new named graph with the specified name and content

Constructs an immutable named graph by pairing an IRI identifier with an RDF graph. Both parameters are required as every named graph must have both a name and content (even if empty).

Parameters:

  • name The IRI that uniquely identifies this graph
  • graph The RDF graph containing the triples for this named graph

Example:

// Create a named graph for user preferences
final prefsGraph = RdfGraph(triples: userPreferenceTriples);
final namedPrefs = RdfNamedGraph(
  IriTerm('http://example.org/users/john/preferences'),
  prefsGraph
);

Implementation

RdfNamedGraph(this.name, this.graph);