owlapy.owl_individual

OWL Individuals

Classes

OWLIndividual

Represents a named or anonymous individual.

NodeID

Generates and normalizes the node IDs used to identify OWLAnonymousIndividual instances,

OWLNamedIndividual

Named individuals are identified using an IRI. Since they are given an IRI, named individuals are entities.

OWLAnonymousIndividual

Anonymous individuals are identified using a node ID rather than an IRI. Node IDs are local to an

Module Contents

class owlapy.owl_individual.OWLIndividual[source]

Bases: owlapy.owl_object.OWLObject

Represents a named or anonymous individual.

__slots__ = ()
class owlapy.owl_individual.NodeID[source]

Generates and normalizes the node IDs used to identify OWLAnonymousIndividual instances, loosely modeled after OWLAPI’s org.semanticweb.owlapi.model.NodeID.

Node IDs are local to an ontology document: they let one distinguish different anonymous individuals without asserting any particular identity for them.

__slots__ = ()
static get_node_id(id_: str | None = None) str[source]

Normalize a node id, generating a fresh, unused one if none is given.

Parameters:

id – A string identifying an anonymous individual, optionally prefixed with “_:” (as blank node labels are written in Turtle/N-Triples). If None, a fresh node id is generated.

Returns:

“ prefix.

Return type:

The normalized node id string, without a “_

class owlapy.owl_individual.OWLNamedIndividual(iri: owlapy.iri.IRI | str)[source]

Bases: OWLIndividual, owlapy.owl_object.OWLEntity

Named individuals are identified using an IRI. Since they are given an IRI, named individuals are entities. IRIs from the reserved vocabulary must not be used to identify named individuals in an OWL 2 DL ontology.

(https://www.w3.org/TR/owl2-syntax/#Named_Individuals)

__slots__ = '_iri'
type_index: Final = 1005
property iri: owlapy.iri.IRI

Gets the IRI of this object.

Returns:

The IRI of this object.

property str

Gets the string representation of this object

Returns:

The IRI as string

property remainder
class owlapy.owl_individual.OWLAnonymousIndividual(node_id: str | None = None)[source]

Bases: OWLIndividual, owlapy.owl_annotation.OWLAnnotationSubject, owlapy.owl_annotation.OWLAnnotationValue

Anonymous individuals are identified using a node ID rather than an IRI. Node IDs are local to an ontology document: they allow different anonymous individuals to be distinguished from one another without asserting any particular identity for them.

(https://www.w3.org/TR/owl2-syntax/#Anonymous_Individuals)

__slots__ = '_node_id'
type_index: Final = 1006
property node_id: str
property str: str
to_string_id() str[source]
is_anonymous() bool[source]
as_anonymous_individual() OWLAnonymousIndividual[source]
Returns:

if the value is an anonymous, return it. Return None otherwise.

__eq__(other)[source]
__hash__()[source]
__repr__()[source]