Struct horned_owl::model::Ontology

source ·
pub struct Ontology {
    pub id: OntologyID,
    /* private fields */
}
Expand description

An ontology

An ontology consists of a identifier and set of axiom

Fields

id: OntologyID

Implementations

Return all instances of Import in the ontology.

Return all instances of OntologyAnnotation in the ontology.

Return all instances of DeclareClass in the ontology.

Return all instances of DeclareObjectProperty in the ontology.

Return all instances of DeclareAnnotationProperty in the ontology.

Return all instances of DeclareDataProperty in the ontology.

Return all instances of DeclareNamedIndividual in the ontology.

Return all instances of DeclareDatatype in the ontology.

Return all instances of SubClassOf in the ontology.

Return all instances of EquivalentClasses in the ontology.

Return all instances of DisjointClasses in the ontology.

Return all instances of SubObjectPropertyOf in the ontology.

Return all instances of EquivalentObjectProperties in the ontology.

Return all instances of DisjointObjectProperties in the ontology.

Return all instances of InverseObjectProperties in the ontology.

Return all instances of ObjectPropertyDomain in the ontology.

Return all instances of ObjectPropertyRange in the ontology.

Return all instances of FunctionalObjectProperty in the ontology.

Return all instances of InverseFunctionalObjectProperty in the ontology.

Return all instances of ReflexiveObjectProperty in the ontology.

Return all instances of IrreflexiveObjectProperty in the ontology.

Return all instances of SymmetricObjectProperty in the ontology.

Return all instances of AsymmetricObjectProperty in the ontology.

Return all instances of TransitiveObjectProperty in the ontology.

Return all instances of SubDataPropertyOf in the ontology.

Return all instances of EquivalentDataProperties in the ontology.

Return all instances of DisjointDataProperties in the ontology.

Return all instances of DataPropertyDomain in the ontology.

Return all instances of DataPropertyRange in the ontology.

Return all instances of FunctionalDataProperty in the ontology.

Return all instances of DatatypeDefinition in the ontology.

Return all instances of HasKey in the ontology.

Return all instances of SameIndividual in the ontology.

Return all instances of DifferentIndividuals in the ontology.

Return all instances of ClassAssertion in the ontology.

Return all instances of ObjectPropertyAssertion in the ontology.

Return all instances of NegativeObjectPropertyAssertion in the ontology.

Return all instances of DataPropertyAssertion in the ontology.

Return all instances of NegativeDataPropertyAssertion in the ontology.

Return all instances of AnnotationAssertion in the ontology.

Return all instances of SubAnnotationPropertyOf in the ontology.

Create a new ontology.

Examples
let o = Ontology::new();
let o2 = Ontology::new();

assert_eq!(o, o2);

Insert an axiom into the ontology.

Examples
let mut o = Ontology::new();
let b = Build::new();
o.insert(DeclareClass(b.class("http://www.example.com/a")));
o.insert(DeclareObjectProperty(b.object_property("http://www.example.com/r")));

See declare for an easier way to declare named entities.

Declare an NamedEntity for the ontology.

Examples
let mut o = Ontology::new();
let b = Build::new();
o.declare(b.class("http://www.example.com/a"));
o.declare(b.object_property("http://www.example.com/r"));

Fetch the AnnotatedAxiom for a given kind

Examples
let mut o = Ontology::new();
let b = Build::new();
o.declare(b.class("http://www.example.com/a"));
o.declare(b.object_property("http://www.example.com/r"));

assert_eq!(o.annotated_axiom(AxiomKind::DeclareClass).count(), 1);

See also axiom for access to the Axiom without annotations.

Fetch the Axiom for a given kind

Examples
let mut o = Ontology::new();
let b = Build::new();
o.declare(b.class("http://www.example.com/a"));
o.declare(b.object_property("http://www.example.com/r"));

assert_eq!(o.axiom(AxiomKind::DeclareClass).count(), 1);

See methods such as declare_class for access to the Axiom struct directly.

Returns all direct subclasses

Examples
let mut o = Ontology::new();
let b = Build::new();

let sup = b.class("http://www.example.com/super");
let sub = b.class("http://www.example.com/sub");
let subsub = b.class("http://www.example.com/subsub");

o.insert(SubClassOf::new((&sup).into(), (&sub).into()));
o.insert(SubClassOf::new((&sub).into(), (&subsub).into()));

let subs:Vec<&ClassExpression> = o.direct_subclass(&sup).collect();

assert_eq!(vec![&ClassExpression::Class(sub)],subs);

Returns true is subclass is a subclass of superclass

Examples
let mut o = Ontology::new();
let b = Build::new();

let sup = b.class("http://www.example.com/super");
let sub = b.class("http://www.example.com/sub");
let subsub = b.class("http://www.example.com/subsub");

o.insert(SubClassOf::new((&sup).into(), (&sub).into()));
o.insert(SubClassOf::new((&sub).into(), (&subsub).into()));

assert!(o.is_subclass(&sup, &sub));
assert!(!o.is_subclass(&sub, &sup));
assert!(!o.is_subclass(&sup, &subsub));

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.