Show / Hide Table of Contents

Class Graph

Class for representing RDF Graphs.
Inheritance
System.Object
BaseGraph
Graph
NonIndexedGraph
OntologyGraph
BaseSparqlView
QueryableGraph
ThreadSafeGraph
UnionGraph
Implements
IGraph
INodeFactory
System.IDisposable
System.Xml.Serialization.IXmlSerializable
System.Runtime.Serialization.ISerializable
Inherited Members
BaseGraph._triples
BaseGraph._nsmapper
BaseGraph._baseuri
BaseGraph._bnodemapper
BaseGraph.Triples
BaseGraph.Nodes
BaseGraph.AllNodes
BaseGraph.NamespaceMap
BaseGraph.BaseUri
BaseGraph.IsEmpty
BaseGraph.Clear()
BaseGraph.CreateBlankNode()
BaseGraph.CreateBlankNode(String)
BaseGraph.CreateLiteralNode(String)
BaseGraph.CreateLiteralNode(String, String)
BaseGraph.CreateLiteralNode(String, Uri)
BaseGraph.CreateUriNode()
BaseGraph.CreateUriNode(Uri)
BaseGraph.CreateUriNode(String)
BaseGraph.CreateVariableNode(String)
BaseGraph.CreateGraphLiteralNode()
BaseGraph.CreateGraphLiteralNode(IGraph)
BaseGraph.ContainsTriple(Triple)
BaseGraph.Merge(IGraph)
BaseGraph.Merge(IGraph, Boolean)
BaseGraph.Equals(Object)
BaseGraph.Equals(IGraph, Dictionary<INode, INode>)
BaseGraph.IsSubGraphOf(IGraph)
BaseGraph.IsSubGraphOf(IGraph, Dictionary<INode, INode>)
BaseGraph.HasSubGraph(IGraph)
BaseGraph.HasSubGraph(IGraph, Dictionary<INode, INode>)
BaseGraph.Difference(IGraph)
BaseGraph.ResolveQName(String)
BaseGraph.GetNextBlankNodeID()
BaseGraph.TripleAsserted
BaseGraph.TripleRetracted
BaseGraph.Changed
BaseGraph.ClearRequested
BaseGraph.Cleared
BaseGraph.MergeRequested
BaseGraph.Merged
BaseGraph.OnTripleAsserted(Object, TripleEventArgs)
BaseGraph.RaiseTripleAsserted(TripleEventArgs)
BaseGraph.RaiseTripleAsserted(Triple)
BaseGraph.OnTripleRetracted(Object, TripleEventArgs)
BaseGraph.RaiseTripleRetracted(TripleEventArgs)
BaseGraph.RaiseTripleRetracted(Triple)
BaseGraph.RaiseGraphChanged(TripleEventArgs)
BaseGraph.RaiseGraphChanged()
BaseGraph.RaiseClearRequested()
BaseGraph.RaiseCleared()
BaseGraph.RaiseMergeRequested()
BaseGraph.RaiseMerged()
BaseGraph.AttachEventHandlers(BaseTripleCollection)
BaseGraph.DetachEventHandlers(BaseTripleCollection)
BaseGraph.Dispose()
BaseGraph.GetObjectData(SerializationInfo, StreamingContext)
BaseGraph.GetSchema()
BaseGraph.ReadXml(XmlReader)
BaseGraph.WriteXml(XmlWriter)
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
[Serializable]
public class Graph : BaseGraph, IGraph, INodeFactory, IDisposable, IXmlSerializable, ISerializable

Constructors

| Improve this Doc View Source

Graph()

Creates a new instance of a Graph.
Declaration
public Graph()
| Improve this Doc View Source

Graph(Boolean)

Creates a new instance of a Graph with an optionally empty Namespace Map.
Declaration
public Graph(bool emptyNamespaceMap)
Parameters
Type Name Description
System.Boolean emptyNamespaceMap Whether the Namespace Map should be empty.
| Improve this Doc View Source

Graph(SerializationInfo, StreamingContext)

Deserialization Constructor.
Declaration
protected Graph(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info Serialization Information.
System.Runtime.Serialization.StreamingContext context Streaming Context.
| Improve this Doc View Source

Graph(BaseTripleCollection)

Creates a new instance of a Graph using the given Triple Collection.
Declaration
public Graph(BaseTripleCollection tripleCollection)
Parameters
Type Name Description
BaseTripleCollection tripleCollection Triple Collection.
| Improve this Doc View Source

Graph(BaseTripleCollection, Boolean)

Creates a new instance of a Graph using the given Triple Collection and an optionally empty Namespace Map.
Declaration
public Graph(BaseTripleCollection tripleCollection, bool emptyNamespaceMap)
Parameters
Type Name Description
BaseTripleCollection tripleCollection Triple Collection.
System.Boolean emptyNamespaceMap Whether the Namespace Map should be empty.

Methods

| Improve this Doc View Source

Assert(IEnumerable<Triple>)

Asserts a List of Triples in the graph.
Declaration
public override bool Assert(IEnumerable<Triple> ts)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Triple> ts List of Triples in the form of an IEnumerable.
Returns
Type Description
System.Boolean
Overrides
BaseGraph.Assert(IEnumerable<Triple>)
| Improve this Doc View Source

Assert(Triple)

Asserts a Triple in the Graph.
Declaration
public override bool Assert(Triple t)
Parameters
Type Name Description
Triple t The Triple to add to the Graph.
Returns
Type Description
System.Boolean
Overrides
BaseGraph.Assert(Triple)
| Improve this Doc View Source

GetBlankNode(String)

Returns the Blank Node with the given Identifier.
Declaration
public override IBlankNode GetBlankNode(string nodeId)
Parameters
Type Name Description
System.String nodeId The Identifier of the Blank Node to select.
Returns
Type Description
IBlankNode Either the Blank Node or null if no Node with the given Identifier exists.
Overrides
BaseGraph.GetBlankNode(String)
| Improve this Doc View Source

GetLiteralNode(String)

Returns the LiteralNode with the given Value if it exists.
Declaration
public override ILiteralNode GetLiteralNode(string literal)
Parameters
Type Name Description
System.String literal The literal value of the Node to select.
Returns
Type Description
ILiteralNode Either the LiteralNode Or null if no Node with the given Value exists.
Overrides
BaseGraph.GetLiteralNode(String)
Remarks
The LiteralNode in the Graph must have no Language or DataType set.
| Improve this Doc View Source

GetLiteralNode(String, String)

Returns the LiteralNode with the given Value in the given Language if it exists.
Declaration
public override ILiteralNode GetLiteralNode(string literal, string langspec)
Parameters
Type Name Description
System.String literal The literal value of the Node to select.
System.String langspec The Language Specifier for the Node to select.
Returns
Type Description
ILiteralNode Either the LiteralNode Or null if no Node with the given Value and Language Specifier exists.
Overrides
BaseGraph.GetLiteralNode(String, String)
| Improve this Doc View Source

GetLiteralNode(String, Uri)

Returns the LiteralNode with the given Value and given Data Type if it exists.
Declaration
public override ILiteralNode GetLiteralNode(string literal, Uri datatype)
Parameters
Type Name Description
System.String literal The literal value of the Node to select.
System.Uri datatype The Uri for the Data Type of the Literal to select.
Returns
Type Description
ILiteralNode Either the LiteralNode Or null if no Node with the given Value and Data Type exists.
Overrides
BaseGraph.GetLiteralNode(String, Uri)
| Improve this Doc View Source

GetTriples(Uri)

Gets all the Triples involving the given Uri.
Declaration
public override IEnumerable<Triple> GetTriples(Uri uri)
Parameters
Type Name Description
System.Uri uri The Uri to find Triples involving.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple> Zero/More Triples.
Overrides
BaseGraph.GetTriples(Uri)
| Improve this Doc View Source

GetTriples(INode)

Gets all the Triples involving the given Node.
Declaration
public override IEnumerable<Triple> GetTriples(INode n)
Parameters
Type Name Description
INode n The Node to find Triples involving.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple> Zero/More Triples.
Overrides
BaseGraph.GetTriples(INode)
| Improve this Doc View Source

GetTriplesWithObject(Uri)

Gets all the Triples with the given Uri as the Object.
Declaration
public override IEnumerable<Triple> GetTriplesWithObject(Uri u)
Parameters
Type Name Description
System.Uri u The Uri to find Triples with it as the Object.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple> Zero/More Triples.
Overrides
BaseGraph.GetTriplesWithObject(Uri)
| Improve this Doc View Source

GetTriplesWithObject(INode)

Gets all the Triples with the given Node as the Object.
Declaration
public override IEnumerable<Triple> GetTriplesWithObject(INode n)
Parameters
Type Name Description
INode n The Node to find Triples with it as the Object.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple>
Overrides
BaseGraph.GetTriplesWithObject(INode)
| Improve this Doc View Source

GetTriplesWithPredicate(Uri)

Gets all the Triples with the given Uri as the Predicate.
Declaration
public override IEnumerable<Triple> GetTriplesWithPredicate(Uri u)
Parameters
Type Name Description
System.Uri u The Uri to find Triples with it as the Predicate.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple> Zero/More Triples.
Overrides
BaseGraph.GetTriplesWithPredicate(Uri)
| Improve this Doc View Source

GetTriplesWithPredicate(INode)

Gets all the Triples with the given Node as the Predicate.
Declaration
public override IEnumerable<Triple> GetTriplesWithPredicate(INode n)
Parameters
Type Name Description
INode n The Node to find Triples with it as the Predicate.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple>
Overrides
BaseGraph.GetTriplesWithPredicate(INode)
| Improve this Doc View Source

GetTriplesWithPredicateObject(INode, INode)

Selects all Triples with the given Predicate and Object.
Declaration
public override IEnumerable<Triple> GetTriplesWithPredicateObject(INode pred, INode obj)
Parameters
Type Name Description
INode pred Predicate.
INode obj Object.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple>
Overrides
BaseGraph.GetTriplesWithPredicateObject(INode, INode)
| Improve this Doc View Source

GetTriplesWithSubject(Uri)

Gets all the Triples with the given Uri as the Subject.
Declaration
public override IEnumerable<Triple> GetTriplesWithSubject(Uri u)
Parameters
Type Name Description
System.Uri u The Uri to find Triples with it as the Subject.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple> Zero/More Triples.
Overrides
BaseGraph.GetTriplesWithSubject(Uri)
| Improve this Doc View Source

GetTriplesWithSubject(INode)

Gets all the Triples with the given Node as the Subject.
Declaration
public override IEnumerable<Triple> GetTriplesWithSubject(INode n)
Parameters
Type Name Description
INode n The Node to find Triples with it as the Subject.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple> Zero/More Triples.
Overrides
BaseGraph.GetTriplesWithSubject(INode)
| Improve this Doc View Source

GetTriplesWithSubjectObject(INode, INode)

Selects all Triples with the given Subject and Object.
Declaration
public override IEnumerable<Triple> GetTriplesWithSubjectObject(INode subj, INode obj)
Parameters
Type Name Description
INode subj Subject.
INode obj Object.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple>
Overrides
BaseGraph.GetTriplesWithSubjectObject(INode, INode)
| Improve this Doc View Source

GetTriplesWithSubjectPredicate(INode, INode)

Selects all Triples with the given Subject and Predicate.
Declaration
public override IEnumerable<Triple> GetTriplesWithSubjectPredicate(INode subj, INode pred)
Parameters
Type Name Description
INode subj Subject.
INode pred Predicate.
Returns
Type Description
System.Collections.Generic.IEnumerable<Triple>
Overrides
BaseGraph.GetTriplesWithSubjectPredicate(INode, INode)
| Improve this Doc View Source

GetUriNode(String)

Returns the UriNode with the given QName if it exists.
Declaration
public override IUriNode GetUriNode(string qname)
Parameters
Type Name Description
System.String qname The QName of the Node to select.
Returns
Type Description
IUriNode
Overrides
BaseGraph.GetUriNode(String)
| Improve this Doc View Source

GetUriNode(Uri)

Returns the UriNode with the given Uri if it exists.
Declaration
public override IUriNode GetUriNode(Uri uri)
Parameters
Type Name Description
System.Uri uri The Uri of the Node to select.
Returns
Type Description
IUriNode Either the UriNode Or null if no Node with the given Uri exists.
Overrides
BaseGraph.GetUriNode(Uri)
| Improve this Doc View Source

Retract(IEnumerable<Triple>)

Retracts a enumeration of Triples from the graph.
Declaration
public override bool Retract(IEnumerable<Triple> ts)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<Triple> ts Enumeration of Triples to retract.
Returns
Type Description
System.Boolean
Overrides
BaseGraph.Retract(IEnumerable<Triple>)
| Improve this Doc View Source

Retract(Triple)

Retracts a Triple from the Graph.
Declaration
public override bool Retract(Triple t)
Parameters
Type Name Description
Triple t Triple to Retract.
Returns
Type Description
System.Boolean
Overrides
BaseGraph.Retract(Triple)
Remarks
Current implementation may have some defunct Nodes left in the Graph as only the Triple is retracted.

Implements

IGraph
INodeFactory
System.IDisposable
System.Xml.Serialization.IXmlSerializable
System.Runtime.Serialization.ISerializable

Extension Methods

GraphExtensions.ToDataTable(IGraph)
Extensions.AsEnumerable<T>(T)
Extensions.Assert(IGraph, INode, INode, INode)
Extensions.Retract(IGraph, INode, INode, INode)
Extensions.AssertList<T>(IGraph, IEnumerable<T>, Func<T, INode>)
Extensions.AssertList<T>(IGraph, INode, IEnumerable<T>, Func<T, INode>)
Extensions.AssertList(IGraph, IEnumerable<INode>)
Extensions.AssertList(IGraph, INode, IEnumerable<INode>)
Extensions.GetListAsTriples(IGraph, INode)
Extensions.GetListItems(IGraph, INode)
Extensions.GetListNodes(IGraph, INode)
Extensions.RetractList(IGraph, INode)
Extensions.AddToList<T>(IGraph, INode, IEnumerable<T>, Func<T, INode>)
Extensions.AddToList(IGraph, INode, IEnumerable<INode>)
Extensions.RemoveFromList<T>(IGraph, INode, IEnumerable<T>, Func<T, INode>)
Extensions.RemoveFromList(IGraph, INode, IEnumerable<INode>)
GraphExtensions.ExecuteQuery(IGraph, String)
GraphExtensions.ExecuteQuery(IGraph, IRdfHandler, ISparqlResultsHandler, String)
GraphExtensions.ExecuteQuery(IGraph, SparqlParameterizedString)
GraphExtensions.ExecuteQuery(IGraph, IRdfHandler, ISparqlResultsHandler, SparqlParameterizedString)
GraphExtensions.ExecuteQuery(IGraph, SparqlQuery)
GraphExtensions.ExecuteQuery(IGraph, IRdfHandler, ISparqlResultsHandler, SparqlQuery)
GraphExtensions.LoadFromFile(IGraph, String, IRdfReader)
GraphExtensions.LoadFromFile(IGraph, String)
GraphExtensions.LoadFromUri(IGraph, Uri, IRdfReader)
GraphExtensions.LoadFromUri(IGraph, Uri)
GraphExtensions.LoadFromString(IGraph, String, IRdfReader)
GraphExtensions.LoadFromString(IGraph, String)
GraphExtensions.LoadFromEmbeddedResource(IGraph, String)
GraphExtensions.LoadFromEmbeddedResource(IGraph, String, IRdfReader)
GraphExtensions.SaveToFile(IGraph, String, IRdfWriter)
GraphExtensions.SaveToFile(IGraph, String, IStoreWriter)
GraphExtensions.SaveToFile(IGraph, String)
GraphExtensions.SaveToStream(IGraph, TextWriter, IRdfWriter)
GraphExtensions.SaveToStream(IGraph, TextWriter, IStoreWriter)
GraphExtensions.SaveToStream(IGraph, String, TextWriter)
DynamicExtensions.AsDynamic(IGraph, Uri, Uri)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • Graph()
    • Graph(Boolean)
    • Graph(SerializationInfo, StreamingContext)
    • Graph(BaseTripleCollection)
    • Graph(BaseTripleCollection, Boolean)
  • Methods
    • Assert(IEnumerable<Triple>)
    • Assert(Triple)
    • GetBlankNode(String)
    • GetLiteralNode(String)
    • GetLiteralNode(String, String)
    • GetLiteralNode(String, Uri)
    • GetTriples(Uri)
    • GetTriples(INode)
    • GetTriplesWithObject(Uri)
    • GetTriplesWithObject(INode)
    • GetTriplesWithPredicate(Uri)
    • GetTriplesWithPredicate(INode)
    • GetTriplesWithPredicateObject(INode, INode)
    • GetTriplesWithSubject(Uri)
    • GetTriplesWithSubject(INode)
    • GetTriplesWithSubjectObject(INode, INode)
    • GetTriplesWithSubjectPredicate(INode, INode)
    • GetUriNode(String)
    • GetUriNode(Uri)
    • Retract(IEnumerable<Triple>)
    • Retract(Triple)
  • Implements
  • Extension Methods
Back to top Generated by DocFX