Class GraphCollection
Wrapper class for Graph Collections.
Implements
System.IDisposable
System.Collections.Generic.IEnumerable<IGraph>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRDF.dll
Syntax
public class GraphCollection : BaseGraphCollection, IDisposable, IEnumerable<IGraph>, IEnumerable
Constructors
| Improve this Doc View SourceGraphCollection()
Creates a new Graph Collection.
Declaration
public GraphCollection()
Fields
| Improve this Doc View Source_graphs
Dictionary of Graph Uri Enhanced Hash Codes to Graphs.
Declaration
protected MultiDictionary<Uri, IGraph> _graphs
Field Value
Type | Description |
---|---|
VDS.Common.Collections.MultiDictionary<System.Uri, IGraph> |
Remarks
| Improve this Doc View SourceDefaultGraphID
Internal Constant used as the Hash Code for the default graph.
Declaration
protected const int DefaultGraphID = 0
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
| Improve this Doc View SourceCount
Gets the number of Graphs in the Collection.
Declaration
public override int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
| Improve this Doc View SourceGraphUris
Provides access to the Graph URIs of Graphs in the Collection.
Declaration
public override IEnumerable<Uri> GraphUris { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Uri> |
Overrides
| Improve this Doc View SourceItem[Uri]
Gets a Graph from the Collection.
Declaration
public override IGraph this[Uri graphUri] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | Graph Uri. |
Property Value
Type | Description |
---|---|
IGraph |
Overrides
Methods
| Improve this Doc View SourceAdd(IGraph, Boolean)
Adds a Graph to the Collection.
Declaration
protected override bool Add(IGraph g, bool mergeIfExists)
Parameters
Type | Name | Description |
---|---|---|
IGraph | g | Graph to add. |
System.Boolean | mergeIfExists | Sets whether the Graph should be merged with an existing Graph of the same Uri if present. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
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. |
Contains(Uri)
Checks whether the Graph with the given Uri exists in this Graph Collection.
Declaration
public override bool Contains(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | Graph Uri to test. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
| Improve this Doc View SourceDispose()
Disposes of the Graph Collection.
Declaration
public override void Dispose()
Overrides
Remarks
Invokes the Dispose() method of all Graphs contained in the Collection.
|
Improve this Doc
View Source
GetEnumerator()
Gets the Enumerator for the Collection.
Declaration
public override IEnumerator<IGraph> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<IGraph> |
Overrides
| Improve this Doc View SourceRemove(Uri)
Removes a Graph from the Collection.
Declaration
protected override bool Remove(Uri graphUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | graphUri | Uri of the Graph to remove. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Gets the Enumerator for this Collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
Implements
System.IDisposable
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable