Class Individual
Represents an Individual i.e. an instance of some class in an ontology.
Inherited Members
Namespace: VDS.RDF.Ontology
Assembly: dotNetRdf.Ontology.dll
Syntax
public class Individual : OntologyResource
Remarks
See Using the Ontology API for some informal documentation on the use of the Ontology namespace.
Constructors
| Edit this page View SourceIndividual(INode, IGraph)
Gets an Individual from the Graph.
Declaration
public Individual(INode resource, IGraph graph)
Parameters
Type | Name | Description |
---|---|---|
INode | resource | Resource that represents the Individual. |
IGraph | graph | Graph the Individual is in. |
Remarks
Requires that an individual (a resource which is the subject of at least one triple where the predicate is rdf:type) is already present in the Graph.
Individual(INode, INode, IGraph)
Gets/Creates an Individual from the Graph.
Declaration
public Individual(INode resource, INode resourceClass, IGraph graph)
Parameters
Type | Name | Description |
---|---|---|
INode | resource | Resource that represents the Individual. |
INode | resourceClass | Class to create/add the Individual to. |
IGraph | graph | Graph the Individual is in. |
Remarks
Allows for creating new Individuals in the Graph or adding existing resources to another Class. If the resource for the Individual or the given Class are new then they will be added to the Graph.
Properties
| Edit this page View SourceClasses
Gets all the Classes that this resource belongs to.
Declaration
public IEnumerable<OntologyClass> Classes { get; }
Property Value
Type | Description |
---|---|
IEnumerable<OntologyClass> |
Methods
| Edit this page View SourceHasClass(Uri)
Gets whether the Individual belongs to a class identified by the given URI.
Declaration
public bool HasClass(Uri @class)
Parameters
Type | Name | Description |
---|---|---|
Uri | class | Class URI. |
Returns
Type | Description |
---|---|
bool |
HasClass(INode)
Gets whether the Individual belongs to a class identified by the given resource.
Declaration
public bool HasClass(INode @class)
Parameters
Type | Name | Description |
---|---|---|
INode | class | Class. |
Returns
Type | Description |
---|---|
bool |
HasClass(OntologyClass)
Gets whether the Individual belongs to a specific class.
Declaration
public bool HasClass(OntologyClass @class)
Parameters
Type | Name | Description |
---|---|---|
OntologyClass | class | Class. |
Returns
Type | Description |
---|---|
bool |