Class OntologyGraph
Represents a Graph with additional methods for extracting ontology based information from it.
Inherited Members
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 SourceOntologyGraph(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.
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.
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.
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 SourceAllClasses
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.
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.
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.
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.
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.
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.
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.
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.
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 SourceCreateIndividual(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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.