Show / Hide Table of Contents

Class GraphCollection

Wrapper class for Graph Collections.

Inheritance
object
BaseGraphCollection
GraphCollection
Implements
IDisposable
IEnumerable<IGraph>
IEnumerable
Inherited Members
BaseGraphCollection.GraphAdded
BaseGraphCollection.GraphRemoved
BaseGraphCollection.RaiseGraphAdded(IGraph)
BaseGraphCollection.RaiseGraphRemoved(IGraph)
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 class GraphCollection : BaseGraphCollection, IDisposable, IEnumerable<IGraph>, IEnumerable

Constructors

| Edit this page View Source

GraphCollection()

Creates a new Graph Collection.

Declaration
public GraphCollection()

Fields

| Edit this page View Source

DefaultGraphId

Internal Constant used as the Hash Code for the default graph.

Declaration
protected const int DefaultGraphId = 0
Field Value
Type Description
int
| Edit this page View Source

_graphs

Dictionary of Graph Uri Enhanced Hash Codes to Graphs.

Declaration
protected MultiDictionary<IRefNode, IGraph> _graphs
Field Value
Type Description
MultiDictionary<IRefNode, IGraph>
Remarks

See GetEnhancedHashCode().

Properties

| Edit this page View Source

Count

Gets the number of Graphs in the Collection.

Declaration
public override int Count { get; }
Property Value
Type Description
int
Overrides
BaseGraphCollection.Count
| Edit this page View Source

GraphNames

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

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

GraphUris

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

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

this[Uri]

Gets a Graph from the Collection.

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

Graph Uri.

Property Value
Type Description
IGraph
Overrides
BaseGraphCollection.this[Uri]
| Edit this page View Source

this[IRefNode]

Gets a graph from the collection.

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

The name of the graph to retrieve.

Property Value
Type Description
IGraph
Overrides
BaseGraphCollection.this[IRefNode]
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 override 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
Overrides
BaseGraphCollection.Add(IGraph, bool)
Exceptions
Type Condition
RdfException

Throws an RDF Exception if the Graph has no Base Uri or if the Graph already exists in the Collection and the mergeIfExists parameter was not set to true.

| 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 override bool Contains(Uri graphUri)
Parameters
Type Name Description
Uri graphUri

Graph Uri to test.

Returns
Type Description
bool
Overrides
BaseGraphCollection.Contains(Uri)
| Edit this page View Source

Contains(IRefNode)

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

Declaration
public override 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.

Overrides
BaseGraphCollection.Contains(IRefNode)
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 override void Dispose()
Overrides
BaseGraphCollection.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 override IEnumerator<IGraph> GetEnumerator()
Returns
Type Description
IEnumerator<IGraph>
Overrides
BaseGraphCollection.GetEnumerator()
| Edit this page View Source

Remove(Uri)

Removes a Graph from the Collection.

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

Uri of the Graph to remove.

Returns
Type Description
bool
Overrides
BaseGraphCollection.Remove(Uri)
| Edit this page View Source

Remove(IRefNode)

Removes a graph from the collection.

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

Name of the Graph to remove.

Returns
Type Description
bool
Overrides
BaseGraphCollection.Remove(IRefNode)
Remarks

The null value is used to reference the Default Graph.

Implements

IDisposable
IEnumerable<T>
IEnumerable

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
  • Constructors
    • GraphCollection()
  • Fields
    • DefaultGraphId
    • _graphs
  • Properties
    • Count
    • GraphNames
    • GraphUris
    • this[Uri]
    • this[IRefNode]
  • Methods
    • Add(IGraph, bool)
    • Contains(Uri)
    • Contains(IRefNode)
    • Dispose()
    • GetEnumerator()
    • Remove(Uri)
    • Remove(IRefNode)
  • Implements
  • Extension Methods
Back to top Generated by DocFX