Struct horned_owl::model::Ontology[][src]

pub struct Ontology {
    pub id: OntologyID,
    // some fields omitted
}

An ontology

An ontology consists of a identifier and set of axiom

Fields

Methods

impl Ontology
[src]

Return all instances of DeclareClass in the ontology.

impl Ontology
[src]

Return all instances of DeclareObjectProperty in the ontology.

impl Ontology
[src]

Return all instances of DeclareAnnotationProperty in the ontology.

impl Ontology
[src]

Return all instances of SubClass in the ontology.

impl Ontology
[src]

Return all instances of EquivalentClass in the ontology.

impl Ontology
[src]

Return all instances of DisjointClass in the ontology.

impl Ontology
[src]

Return all instances of SubObjectProperty in the ontology.

impl Ontology
[src]

Return all instances of InverseObjectProperty in the ontology.

impl Ontology
[src]

Return all instances of TransitiveObjectProperty in the ontology.

impl Ontology
[src]

Return all instances of AssertAnnotation in the ontology.

impl Ontology
[src]

Return all instances of SubAnnotationProperty in the ontology.

impl Ontology
[src]

Return all instances of OntologyAnnotation in the ontology.

impl Ontology
[src]

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.

impl Ontology
[src]

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(SubClass::new((&sup).into(), (&sub).into()));
o.insert(SubClass::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(SubClass::new((&sup).into(), (&sub).into()));
o.insert(SubClass::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

impl Debug for Ontology
[src]

Formats the value using the given formatter. Read more

impl Default for Ontology
[src]

Returns the "default value" for a type. Read more

impl Eq for Ontology
[src]

impl PartialEq for Ontology
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl !Send for Ontology

impl !Sync for Ontology