Entities and Primitives

Entities represent the named terms of OWL ontologies, and are modeled by CowlEntity. Primitives are a superset of entities, which also include anonymous individuals. They are modeled by CowlPrimitive.

struct CowlEntity : public CowlPrimitive

Represents an Entity in the OWL 2 specification.

Subclassed by CowlAnnotProp, CowlClass, CowlDataProp, CowlDatatype, CowlNamedInd, CowlObjProp

Public Functions

void cowl_entity_release(CowlAnyEntity *entity)

Releases the entity.

Parameters

entity – The entity.

CowlEntityType cowl_entity_get_type(CowlAnyEntity *entity)

Gets the type of the entity.

Parameters

entity – The entity.

Returns

The type.

CowlIRI *cowl_entity_get_iri(CowlAnyEntity *entity)

Gets the IRI of the entity.

Parameters

entity – The entity.

Returns

The IRI.

CowlString *cowl_entity_to_string(CowlAnyEntity *entity)

Returns the string representation of the specified entity.

Note

The returned string is retained, so you are responsible for releasing it.

Parameters

entity – The entity.

Returns

String representation, or NULL on error.

Public Static Functions

static inline CowlAnyEntity *cowl_entity_retain(CowlAnyEntity *entity)

Retains the entity.

Parameters

entity – The entity.

Returns

Retained entity.

static inline bool cowl_entity_equals(CowlAnyEntity *lhs, CowlAnyEntity *rhs)

Equality function.

Parameters
  • lhs – LHS of the equality relation.

  • rhs – RHS of the equality relation.

Returns

True if the equality relation holds, false otherwise.

static inline ulib_uint cowl_entity_hash(CowlAnyEntity *entity)

Hash function.

Parameters

entity – The entity.

Returns

The hash value.

static inline bool cowl_entity_iterate_primitives(CowlAnyEntity *entity, CowlPrimitiveFlags flags, CowlIterator *iter)

Iterates over this entity.

Parameters
  • entity – The entity.

  • flags – Iteration flags.

  • iter – The iterator.

Returns

True if the iteration was completed, false if it was stopped.

enum CowlEntityType

Represents the type of CowlEntity.

Values:

enumerator COWL_ET_CLASS

CowlClass - class.

enumerator COWL_ET_OBJ_PROP

CowlObjProp - object property.

enumerator COWL_ET_DATA_PROP

CowlDataProp - data property.

enumerator COWL_ET_ANNOT_PROP

CowlAnnotProp - annotation property.

enumerator COWL_ET_NAMED_IND

CowlNamedInd - named individual.

enumerator COWL_ET_DATATYPE

CowlDatatype - datatype.

enumerator COWL_ET_COUNT

Number of enum values.

enumerator COWL_ET_FIRST

First enum value.

struct CowlPrimitive : public CowlObject

Represents a primitive, a collective term for entities and anonymous individuals.

Subclassed by CowlAnonInd, CowlEntity, CowlIndividual

Public Functions

CowlPrimitiveType cowl_primitive_get_type(CowlAnyPrimitive *primitive)

Gets the type of the primitive.

Parameters

primitive – The primitive.

Returns

The type.

bool cowl_primitive_is_entity(CowlAnyPrimitive *primitive)

Checks whether the primitive is an entity.

Parameters

primitive – The primitive.

Returns

True if the primitive is an entity,

Public Static Functions

static inline CowlAnyPrimitive *cowl_primitive_retain(CowlAnyPrimitive *primitive)

Retains the primitive.

Parameters

primitive – The primitive.

Returns

Retained primitive.

static inline void cowl_primitive_release(CowlAnyPrimitive *primitive)

Releases the primitive.

Parameters

primitive – The primitive.

static inline CowlString *cowl_primitive_to_string(CowlAnyPrimitive *primitive)

Returns the string representation of the specified primitive.

Note

The returned string is retained, so you are responsible for releasing it.

Parameters

primitive – The primitive.

Returns

String representation, or NULL on error.

static inline bool cowl_primitive_equals(CowlAnyPrimitive *lhs, CowlAnyPrimitive *rhs)

Equality function.

Parameters
  • lhs – LHS of the equality relation.

  • rhs – RHS of the equality relation.

Returns

True if the equality relation holds, false otherwise.

static inline ulib_uint cowl_primitive_hash(CowlAnyPrimitive *primitive)

Hash function.

Parameters

primitive – The primitive.

Returns

The hash value.

static inline bool cowl_primitive_iterate_primitives(CowlAnyPrimitive *primitive, CowlPrimitiveFlags flags, CowlIterator *iter)

Iterates over this primitive.

Parameters
  • primitive – The primitive.

  • flags – Iteration flags.

  • iter – The iterator.

Returns

True if the iteration was completed, false if it was stopped.

enum CowlPrimitiveType

Represents the type of CowlPrimitive.

Values:

enumerator COWL_PT_CLASS

CowlClass - class.

enumerator COWL_PT_OBJ_PROP

CowlObjProp - object property.

enumerator COWL_PT_DATA_PROP

CowlDataProp - data property.

enumerator COWL_PT_ANNOT_PROP

CowlAnnotProp - annotation property.

enumerator COWL_PT_NAMED_IND

CowlNamedInd - named individual.

enumerator COWL_PT_ANON_IND

CowlAnonInd - anonymous individual.

enumerator COWL_PT_DATATYPE

CowlDatatype - datatype.

enumerator COWL_PT_COUNT

Number of enum values.

enumerator COWL_PT_FIRST

First enum value.