containsGraph method

bool containsGraph(
  1. RdfGraphName name
)

Check if a named graph exists in this dataset

Determines whether a graph with the specified IRI name exists in this dataset's named graph collection.

Parameters:

  • name The IRI identifier to check for

Returns: true if a graph with the specified name exists, false otherwise.

Example:

final graphName = IriTerm('http://example.org/people');
if (dataset.containsGraph(graphName)) {
  // Safe to call dataset.graph(graphName)
  final graph = dataset.graph(graphName)!;
}

Implementation

bool containsGraph(RdfGraphName name) => _namedGraphs.containsKey(name);