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
| Edit this page View SourceOntologyGraph(Uri)
Creates a new Ontology Graph with the specified URI as the graph name.
Declaration
public OntologyGraph(Uri name)
Parameters
Type | Name | Description |
---|---|---|
Uri | name | The graph name as a URI. |
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 |
---|---|---|
Uri | name | The name to assign to the graph. |
BaseTripleCollection | tripleCollection | The initial content of the graph. |
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. |
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. |
Properties
| Edit this page 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 |
---|---|
IEnumerable<OntologyClass> |
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 |
---|---|
IEnumerable<OntologyProperty> |
OwlAnnotationProperties
Gets all OWL Annotation properties defined in the graph.
Declaration
public IEnumerable<OntologyProperty> OwlAnnotationProperties { get; }
Property Value
Type | Description |
---|---|
IEnumerable<OntologyProperty> |
OwlClasses
Get all OWL classes defined in the graph.
Declaration
public IEnumerable<OntologyClass> OwlClasses { get; }
Property Value
Type | Description |
---|---|
IEnumerable<OntologyClass> |
OwlDatatypeProperties
Gets all OWL Data properties defined in the graph.
Declaration
public IEnumerable<OntologyProperty> OwlDatatypeProperties { get; }
Property Value
Type | Description |
---|---|
IEnumerable<OntologyProperty> |
OwlObjectProperties
Gets all OWL Object properties defined in the graph.
Declaration
public IEnumerable<OntologyProperty> OwlObjectProperties { get; }
Property Value
Type | Description |
---|---|
IEnumerable<OntologyProperty> |
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 |
---|---|
IEnumerable<OntologyProperty> |
RdfClasses
Get all the RDFS classes defined in the graph.
Declaration
public IEnumerable<OntologyClass> RdfClasses { get; }
Property Value
Type | Description |
---|---|
IEnumerable<OntologyClass> |
RdfProperties
Gets all RDF properties defined in the graph.
Declaration
public IEnumerable<OntologyProperty> RdfProperties { get; }
Property Value
Type | Description |
---|---|
IEnumerable<OntologyProperty> |
Methods
| Edit this page View SourceCreateIndividual(Uri)
Gets an existing individual in the Graph.
Declaration
public virtual Individual CreateIndividual(Uri resource)
Parameters
Type | Name | Description |
---|---|---|
Uri | resource | Individual Resource. |
Returns
Type | Description |
---|---|
Individual |
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 |
---|---|---|
Uri | resource | Individual Resource. |
Uri | class | Class. |
Returns
Type | Description |
---|---|
Individual |
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 |
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 |
CreateOntologyClass()
Gets/Creates an anonymous ontology class in the Graph.
Declaration
public virtual OntologyClass CreateOntologyClass()
Returns
Type | Description |
---|---|
OntologyClass |
CreateOntologyClass(Uri)
Gets/Creates an ontology class in the Graph.
Declaration
public virtual OntologyClass CreateOntologyClass(Uri resource)
Parameters
Type | Name | Description |
---|---|---|
Uri | resource | Class Resource. |
Returns
Type | Description |
---|---|
OntologyClass |
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 |
CreateOntologyProperty(Uri)
Gets/Creates an ontology property in the Graph.
Declaration
public virtual OntologyProperty CreateOntologyProperty(Uri resource)
Parameters
Type | Name | Description |
---|---|---|
Uri | resource | Property Resource. |
Returns
Type | Description |
---|---|
OntologyProperty |
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 |
CreateOntologyResource()
Gets/Creates an anonymous ontology resource in the Graph.
Declaration
public virtual OntologyResource CreateOntologyResource()
Returns
Type | Description |
---|---|
OntologyResource |
CreateOntologyResource(Uri)
Gets/Creates an ontology resource in the Graph.
Declaration
public virtual OntologyResource CreateOntologyResource(Uri resource)
Parameters
Type | Name | Description |
---|---|---|
Uri | resource | Resource. |
Returns
Type | Description |
---|---|
OntologyResource |
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 |
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 |
---|---|
IEnumerable<OntologyClass> | Enumeration of classes. |
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 |
---|---|
IEnumerable<OntologyProperty> | Enumeration of properties. |