Show / Hide Table of Contents

Class BaseGraphCollection

Abstract Base Class for Graph Collections.

Inheritance
object
BaseGraphCollection
GraphCollection
DatasetGraphCollection
WrapperGraphCollection
Implements
IEnumerable<IGraph>
IEnumerable
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public abstract class BaseGraphCollection : IEnumerable<IGraph>, IEnumerable, IDisposable
Remarks

Designed to allow the underlying storage of a Graph Collection to be changed at a later date without affecting classes that use it.

Properties

| Edit this page View Source

Count

Gets the number of Graphs in the Collection.

Declaration
public abstract int Count { get; }
Property Value
Type Description
int
| Edit this page View Source

GraphNames

Provides an enumeration of the names of all of teh graphs in the collection.

Declaration
public abstract IEnumerable<IRefNode> GraphNames { get; }
Property Value
Type Description
IEnumerable<IRefNode>
| Edit this page View Source

GraphUris

Provides access to the Graph URIs of Graphs in the Collection.

Declaration
[Obsolete("Replaced by GraphNames")]
public abstract IEnumerable<Uri> GraphUris { get; }
Property Value
Type Description
IEnumerable<Uri>
| Edit this page View Source

this[Uri]

Gets a Graph from the Collection.

Declaration
[Obsolete("Replaced by this[IRefNode]")]
public abstract IGraph this[Uri graphUri] { get; }
Parameters
Type Name Description
Uri graphUri

Graph Uri.

Property Value
Type Description
IGraph
Remarks

The null URI is used to reference the Default Graph.

| Edit this page View Source

this[IRefNode]

Gets a graph from the collection.

Declaration
public abstract IGraph this[IRefNode graphName] { get; }
Parameters
Type Name Description
IRefNode graphName

The name of the graph to retrieve.

Property Value
Type Description
IGraph
Remarks

The null value is used to reference the default graph.

Methods

| Edit this page View Source

Add(IGraph, bool)

Adds a Graph to the Collection.

Declaration
public abstract bool Add(IGraph g, bool mergeIfExists)
Parameters
Type Name Description
IGraph g

Graph to add.

bool mergeIfExists

Sets whether the Graph should be merged with an existing Graph of the same Uri if present.

Returns
Type Description
bool
| Edit this page View Source

Contains(Uri)

Checks whether the Graph with the given Uri exists in this Graph Collection.

Declaration
[Obsolete("Replaced by Contains(IRefNode)")]
public abstract bool Contains(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Graph Uri to test.

Returns
Type Description
bool
Remarks

The null URI is used to reference the Default Graph.

| Edit this page View Source

Contains(IRefNode)

Checks whether the graph with the given name exists in this graph collection.

Declaration
public abstract bool Contains(IRefNode graphName)
Parameters
Type Name Description
IRefNode graphName

Graph name to test for.

Returns
Type Description
bool

True if a graph with the specified name is in the collection, false otherwise.

Remarks

The null value is used to reference the default (unnamed) graph.

| Edit this page View Source

Dispose()

Disposes of the Graph Collection.

Declaration
public abstract void Dispose()
Remarks

Invokes the Dispose() method of all Graphs contained in the Collection.

| Edit this page View Source

GetEnumerator()

Gets the Enumerator for the Collection.

Declaration
public abstract IEnumerator<IGraph> GetEnumerator()
Returns
Type Description
IEnumerator<IGraph>
| Edit this page View Source

RaiseGraphAdded(IGraph)

Helper method which raises the Graph Added event manually.

Declaration
protected virtual void RaiseGraphAdded(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

| Edit this page View Source

RaiseGraphRemoved(IGraph)

Helper method which raises the Graph Removed event manually.

Declaration
protected virtual void RaiseGraphRemoved(IGraph g)
Parameters
Type Name Description
IGraph g

Graph.

| Edit this page View Source

Remove(Uri)

Removes a Graph from the Collection.

Declaration
[Obsolete("Replaced by Remove(IRefNode)")]
public abstract bool Remove(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Uri of the Graph to remove.

Returns
Type Description
bool
Remarks

The null URI is used to reference the Default Graph.

| Edit this page View Source

Remove(IRefNode)

Removes a graph from the collection.

Declaration
public abstract bool Remove(IRefNode graphName)
Parameters
Type Name Description
IRefNode graphName

Name of the Graph to remove.

Returns
Type Description
bool
Remarks

The null value is used to reference the Default Graph.

Events

| Edit this page View Source

GraphAdded

Event which is raised when a Graph is added to the Collection

Declaration
public event GraphEventHandler GraphAdded
Event Type
Type Description
GraphEventHandler
| Edit this page View Source

GraphRemoved

Event which is raised when a Graph is removed from the Collection

Declaration
public event GraphEventHandler GraphRemoved
Event Type
Type Description
GraphEventHandler

Implements

IEnumerable<T>
IEnumerable
IDisposable

Extension Methods

Extensions.ChunkBy<T>(IEnumerable<T>, int)
Extensions.IsDisjoint<T>(IEnumerable<T>, IEnumerable<T>)
Extensions.ToSafeString(object)
Extensions.AsEnumerable<T>(T)
  • Edit this page
  • View Source
In this article
  • Properties
    • Count
    • GraphNames
    • GraphUris
    • this[Uri]
    • this[IRefNode]
  • Methods
    • Add(IGraph, bool)
    • Contains(Uri)
    • Contains(IRefNode)
    • Dispose()
    • GetEnumerator()
    • RaiseGraphAdded(IGraph)
    • RaiseGraphRemoved(IGraph)
    • Remove(Uri)
    • Remove(IRefNode)
  • Events
    • GraphAdded
    • GraphRemoved
  • Implements
  • Extension Methods
Back to top Generated by DocFX