Show / Hide Table of Contents

Class OntologyGraph

Represents a Graph with additional methods for extracting ontology based information from it.

Inheritance
System.Object
BaseGraph
Graph
OntologyGraph
ReasonerGraph
Implements
IGraph
INodeFactory
System.IDisposable
ITripleIndex
System.IEquatable<T><IGraph>
System.IEquatable<T><Graph>
Inherited Members
Graph.Equals(Graph)
Graph.Assert(Triple)
Graph.Assert(IEnumerable<Triple>)
Graph.Retract(Triple)
Graph.Retract(IEnumerable<Triple>)
Graph.GetUriNode(Uri)
Graph.GetUriNode(string)
Graph.GetLiteralNode(string)
Graph.GetLiteralNode(string, string)
Graph.GetLiteralNode(string, Uri)
Graph.GetBlankNode(string)
Graph.GetTripleNode(Triple)
Graph.GetTriples(INode)
Graph.GetTriples(Uri)
Graph.GetTriplesWithSubject(INode)
Graph.GetTriplesWithSubject(Uri)
Graph.GetTriplesWithPredicate(INode)
Graph.GetTriplesWithPredicate(Uri)
Graph.GetTriplesWithObject(INode)
Graph.GetTriplesWithObject(Uri)
Graph.GetTriplesWithSubjectPredicate(INode, INode)
Graph.GetTriplesWithSubjectObject(INode, INode)
Graph.GetTriplesWithPredicateObject(INode, INode)
Graph.GetQuoted(INode)
Graph.GetQuotedWithObject(INode)
Graph.GetQuotedWithPredicate(INode)
Graph.GetQuotedWithSubject(INode)
Graph.GetQuotedWithSubjectPredicate(INode, INode)
Graph.GetQuotedWithSubjectObject(INode, INode)
Graph.GetQuotedWithPredicateObject(INode, INode)
BaseGraph._triples
BaseGraph.NodeFactory
BaseGraph.UriFactory
BaseGraph._name
BaseGraph._bnodemapper
BaseGraph.Triples
BaseGraph.QuotedTriples
BaseGraph.Nodes
BaseGraph.AllNodes
BaseGraph.QuotedNodes
BaseGraph.AllQuotedNodes
BaseGraph.NamespaceMap
BaseGraph.BaseUri
BaseGraph.Name
BaseGraph.IsEmpty
BaseGraph.NormalizeLiteralValues
BaseGraph.Clear()
BaseGraph.CreateBlankNode()
BaseGraph.CreateBlankNode(string)
BaseGraph.CreateGraphLiteralNode()
BaseGraph.CreateGraphLiteralNode(IGraph)
BaseGraph.CreateLiteralNode(string, Uri)
BaseGraph.CreateLiteralNode(string)
BaseGraph.CreateLiteralNode(string, string)
BaseGraph.CreateUriNode(Uri)
BaseGraph.CreateUriNode(string)
BaseGraph.CreateUriNode()
BaseGraph.CreateVariableNode(string)
BaseGraph.CreateTripleNode(Triple)
BaseGraph.ContainsTriple(Triple)
BaseGraph.ContainsQuotedTriple(Triple)
BaseGraph.GetQuoted(Uri)
BaseGraph.GetQuotedWithObject(Uri)
BaseGraph.GetQuotedWithPredicate(Uri)
BaseGraph.GetQuotedWithSubject(Uri)
BaseGraph.Merge(IGraph)
BaseGraph.Merge(IGraph, bool)
BaseGraph.Unstar()
BaseGraph.Equals(IGraph)
BaseGraph.Equals(IGraph, out Dictionary<INode, INode>)
BaseGraph.IsSubGraphOf(IGraph)
BaseGraph.IsSubGraphOf(IGraph, out Dictionary<INode, INode>)
BaseGraph.HasSubGraph(IGraph)
BaseGraph.HasSubGraph(IGraph, out 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()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF.Ontology
Assembly: dotNetRdf.Ontology.dll
Syntax
public class OntologyGraph : Graph, IGraph, INodeFactory, IDisposable, ITripleIndex, IEquatable<IGraph>, IEquatable<Graph>
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

Constructors

| Improve this Doc View Source

OntologyGraph(Uri, BaseTripleCollection)

Creates a new Ontology Graph with the specified name and initial content

Declaration
public OntologyGraph(Uri name, BaseTripleCollection tripleCollection)
Parameters
Type Name Description
System.Uri name

The name to assign to the graph.

BaseTripleCollection tripleCollection

The initial content of the graph.

Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

OntologyGraph(Uri)

Creates a new Ontology Graph with the specified URI as the graph name.

Declaration
public OntologyGraph(Uri name)
Parameters
Type Name Description
System.Uri name

The graph name as a URI.

Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

OntologyGraph(IRefNode, BaseTripleCollection)

Creates a new Ontology Graph with the specified name and initial content

Declaration
public OntologyGraph(IRefNode name, BaseTripleCollection tripleCollection)
Parameters
Type Name Description
IRefNode name

The name to assign to the graph.

BaseTripleCollection tripleCollection

The initial content of the graph.

Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

OntologyGraph(IRefNode, INodeFactory, IUriFactory, BaseTripleCollection)

Creates a new Ontology Graph.

Declaration
public OntologyGraph(IRefNode graphName = null, INodeFactory nodeFactory = null, IUriFactory uriFactory = null, BaseTripleCollection tripleCollection = null)
Parameters
Type Name Description
IRefNode graphName

The name to assign to the graph.

INodeFactory nodeFactory

The factory to use when constructing nodes in this graph. If null, defaults to a new NodeFactory instance using the same UriFactory instance as this graph.

IUriFactory uriFactory

The factory to use when constructing URIs in this graph. If null, default to the root UriFactory.

BaseTripleCollection tripleCollection

The initial content of the graph. If null, the graph will initially be empty.

Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

Properties

| Improve this Doc View Source

AllClasses

Gets all classes defined in the graph using the standard rdfs:Class and owl:Class types.

Declaration
public IEnumerable<OntologyClass> AllClasses { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><OntologyClass>
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

AllProperties

Gets all properties defined in the graph using any of the standard property types (rdf:Property, owl:AnnotationProperty, owl:DataProperty, owl:ObjectProperty).

Declaration
public IEnumerable<OntologyProperty> AllProperties { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><OntologyProperty>
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

OwlAnnotationProperties

Gets all OWL Annotation properties defined in the graph.

Declaration
public IEnumerable<OntologyProperty> OwlAnnotationProperties { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><OntologyProperty>
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

OwlClasses

Get all OWL classes defined in the graph.

Declaration
public IEnumerable<OntologyClass> OwlClasses { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><OntologyClass>
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

OwlDatatypeProperties

Gets all OWL Data properties defined in the graph.

Declaration
public IEnumerable<OntologyProperty> OwlDatatypeProperties { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><OntologyProperty>
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

OwlObjectProperties

Gets all OWL Object properties defined in the graph.

Declaration
public IEnumerable<OntologyProperty> OwlObjectProperties { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><OntologyProperty>
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

OwlProperties

Gets all properties defined in the graph using any of the standard OWL property types (owl:AnnotationProperty, owl:DataProperty, owl:ObjectProperty).

Declaration
public IEnumerable<OntologyProperty> OwlProperties { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><OntologyProperty>
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

RdfClasses

Get all the RDFS classes defined in the graph.

Declaration
public IEnumerable<OntologyClass> RdfClasses { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><OntologyClass>
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

RdfProperties

Gets all RDF properties defined in the graph.

Declaration
public IEnumerable<OntologyProperty> RdfProperties { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<T><OntologyProperty>
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

Methods

| Improve this Doc View Source

CreateIndividual(Uri, Uri)

Gets/Creates an individual in the Graph of the given class.

Declaration
public virtual Individual CreateIndividual(Uri resource, Uri @class)
Parameters
Type Name Description
System.Uri resource

Individual Resource.

System.Uri class

Class.

Returns
Type Description
Individual
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateIndividual(Uri)

Gets an existing individual in the Graph.

Declaration
public virtual Individual CreateIndividual(Uri resource)
Parameters
Type Name Description
System.Uri resource

Individual Resource.

Returns
Type Description
Individual
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateIndividual(INode, INode)

Gets/Creates an individual in the Graph of the given class.

Declaration
public virtual Individual CreateIndividual(INode resource, INode @class)
Parameters
Type Name Description
INode resource

Individual Resource.

INode class

Class.

Returns
Type Description
Individual
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateIndividual(INode)

Gets an existing individual in the Graph.

Declaration
public virtual Individual CreateIndividual(INode resource)
Parameters
Type Name Description
INode resource

Individual Resource.

Returns
Type Description
Individual
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateOntologyClass()

Gets/Creates an anonymous ontology class in the Graph.

Declaration
public virtual OntologyClass CreateOntologyClass()
Returns
Type Description
OntologyClass
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateOntologyClass(Uri)

Gets/Creates an ontology class in the Graph.

Declaration
public virtual OntologyClass CreateOntologyClass(Uri resource)
Parameters
Type Name Description
System.Uri resource

Class Resource.

Returns
Type Description
OntologyClass
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateOntologyClass(INode)

Gets/Creates an ontology class in the Graph.

Declaration
public virtual OntologyClass CreateOntologyClass(INode resource)
Parameters
Type Name Description
INode resource

Class Resource.

Returns
Type Description
OntologyClass
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateOntologyProperty(Uri)

Gets/Creates an ontology property in the Graph.

Declaration
public virtual OntologyProperty CreateOntologyProperty(Uri resource)
Parameters
Type Name Description
System.Uri resource

Property Resource.

Returns
Type Description
OntologyProperty
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateOntologyProperty(INode)

Gets/Creates an ontology property in the Graph.

Declaration
public virtual OntologyProperty CreateOntologyProperty(INode resource)
Parameters
Type Name Description
INode resource

Property Resource.

Returns
Type Description
OntologyProperty
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateOntologyResource()

Gets/Creates an anonymous ontology resource in the Graph.

Declaration
public virtual OntologyResource CreateOntologyResource()
Returns
Type Description
OntologyResource
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateOntologyResource(Uri)

Gets/Creates an ontology resource in the Graph.

Declaration
public virtual OntologyResource CreateOntologyResource(Uri resource)
Parameters
Type Name Description
System.Uri resource

Resource.

Returns
Type Description
OntologyResource
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

CreateOntologyResource(INode)

Gets/Creates an ontology resource in the Graph.

Declaration
public virtual OntologyResource CreateOntologyResource(INode resource)
Parameters
Type Name Description
INode resource

Resource.

Returns
Type Description
OntologyResource
Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

GetClasses(INode)

Get all classes defined in the graph where anything of a specific type is considered a class.

Declaration
public IEnumerable<OntologyClass> GetClasses(INode classType)
Parameters
Type Name Description
INode classType

Type which represents classes.

Returns
Type Description
System.Collections.Generic.IEnumerable<T><OntologyClass>

Enumeration of classes.

Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

| Improve this Doc View Source

GetProperties(INode)

Get all properties defined in the graph where anything of a specific type is considered a property.

Declaration
public IEnumerable<OntologyProperty> GetProperties(INode propertyType)
Parameters
Type Name Description
INode propertyType

Type which represents properties.

Returns
Type Description
System.Collections.Generic.IEnumerable<T><OntologyProperty>

Enumeration of properties.

Remarks

See Using the Ontology API for some informal documentation on the use of the Ontology namespace.

Implements

IGraph
INodeFactory
System.IDisposable
ITripleIndex
System.IEquatable<T>
System.IEquatable<T>

Extension Methods

Extensions.ToSafeString(object)
GraphExtensions.ToDataTable(IGraph)
DynamicExtensions.AsDynamic(IGraph, Uri, Uri)
Extensions.AddToList(IGraph, INode, IEnumerable<INode>)
Extensions.AddToList<T>(IGraph, INode, IEnumerable<T>, Func<T, INode>)
Extensions.Assert(IGraph, INode, INode, INode)
Extensions.AssertList(IGraph, IEnumerable<INode>)
Extensions.AssertList(IGraph, INode, IEnumerable<INode>)
Extensions.AssertList<T>(IGraph, IEnumerable<T>, Func<T, INode>)
Extensions.AssertList<T>(IGraph, INode, IEnumerable<T>, Func<T, INode>)
Extensions.GetListAsTriples(IGraph, INode)
Extensions.GetListItems(IGraph, INode)
Extensions.GetListNodes(IGraph, INode)
Extensions.RemoveFromList(IGraph, INode, IEnumerable<INode>)
Extensions.RemoveFromList<T>(IGraph, INode, IEnumerable<T>, Func<T, INode>)
Extensions.Retract(IGraph, INode, INode, INode)
Extensions.RetractList(IGraph, INode)
GraphExtensions.GetETag(IGraph)
GraphExtensions.LoadFromEmbeddedResource(IGraph, string, IRdfReader)
GraphExtensions.LoadFromEmbeddedResource(IGraph, string)
GraphExtensions.LoadFromFile(IGraph, string, IRdfReader)
GraphExtensions.LoadFromFile(IGraph, string)
GraphExtensions.LoadFromString(IGraph, string, IRdfReader)
GraphExtensions.LoadFromString(IGraph, string)
GraphExtensions.LoadFromUri(IGraph, Uri, IRdfReader, Loader)
GraphExtensions.LoadFromUri(IGraph, Uri, Loader)
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)
InMemoryExtensions.ExecuteQuery(IGraph, string)
InMemoryExtensions.ExecuteQuery(IGraph, IRdfHandler, ISparqlResultsHandler, string)
InMemoryExtensions.ExecuteQuery(IGraph, IRdfHandler, ISparqlResultsHandler, SparqlParameterizedString)
InMemoryExtensions.ExecuteQuery(IGraph, IRdfHandler, ISparqlResultsHandler, SparqlQuery)
InMemoryExtensions.ExecuteQuery(IGraph, SparqlParameterizedString)
InMemoryExtensions.ExecuteQuery(IGraph, SparqlQuery)
Extensions.AsEnumerable<T>(T)
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • OntologyGraph(Uri, BaseTripleCollection)
    • OntologyGraph(Uri)
    • OntologyGraph(IRefNode, BaseTripleCollection)
    • OntologyGraph(IRefNode, INodeFactory, IUriFactory, BaseTripleCollection)
  • Properties
    • AllClasses
    • AllProperties
    • OwlAnnotationProperties
    • OwlClasses
    • OwlDatatypeProperties
    • OwlObjectProperties
    • OwlProperties
    • RdfClasses
    • RdfProperties
  • Methods
    • CreateIndividual(Uri, Uri)
    • CreateIndividual(Uri)
    • CreateIndividual(INode, INode)
    • CreateIndividual(INode)
    • CreateOntologyClass()
    • CreateOntologyClass(Uri)
    • CreateOntologyClass(INode)
    • CreateOntologyProperty(Uri)
    • CreateOntologyProperty(INode)
    • CreateOntologyResource()
    • CreateOntologyResource(Uri)
    • CreateOntologyResource(INode)
    • GetClasses(INode)
    • GetProperties(INode)
  • Implements
  • Extension Methods
Back to top Generated by DocFX