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
id: OntologyID
Methods
impl Ontology
[src]
impl Ontology
pub fn declare_class(
&self
) -> impl Iterator<Item = &DeclareClass>
[src]
pub fn declare_class(
&self
) -> impl Iterator<Item = &DeclareClass>
Return all instances of DeclareClass in the ontology.
impl Ontology
[src]
impl Ontology
pub fn declare_object_property(
&self
) -> impl Iterator<Item = &DeclareObjectProperty>
[src]
pub fn declare_object_property(
&self
) -> impl Iterator<Item = &DeclareObjectProperty>
Return all instances of DeclareObjectProperty in the ontology.
impl Ontology
[src]
impl Ontology
pub fn declare_annotation_property(
&self
) -> impl Iterator<Item = &DeclareAnnotationProperty>
[src]
pub fn declare_annotation_property(
&self
) -> impl Iterator<Item = &DeclareAnnotationProperty>
Return all instances of DeclareAnnotationProperty in the ontology.
impl Ontology
[src]
impl Ontology
pub fn sub_class(
&self
) -> impl Iterator<Item = &SubClass>
[src]
pub fn sub_class(
&self
) -> impl Iterator<Item = &SubClass>
Return all instances of SubClass in the ontology.
impl Ontology
[src]
impl Ontology
pub fn equivalent_class(
&self
) -> impl Iterator<Item = &EquivalentClass>
[src]
pub fn equivalent_class(
&self
) -> impl Iterator<Item = &EquivalentClass>
Return all instances of EquivalentClass in the ontology.
impl Ontology
[src]
impl Ontology
pub fn disjoint_class(
&self
) -> impl Iterator<Item = &DisjointClass>
[src]
pub fn disjoint_class(
&self
) -> impl Iterator<Item = &DisjointClass>
Return all instances of DisjointClass in the ontology.
impl Ontology
[src]
impl Ontology
pub fn sub_object_property(
&self
) -> impl Iterator<Item = &SubObjectProperty>
[src]
pub fn sub_object_property(
&self
) -> impl Iterator<Item = &SubObjectProperty>
Return all instances of SubObjectProperty in the ontology.
impl Ontology
[src]
impl Ontology
pub fn inverse_object_property(
&self
) -> impl Iterator<Item = &InverseObjectProperty>
[src]
pub fn inverse_object_property(
&self
) -> impl Iterator<Item = &InverseObjectProperty>
Return all instances of InverseObjectProperty in the ontology.
impl Ontology
[src]
impl Ontology
pub fn transitive_object_property(
&self
) -> impl Iterator<Item = &TransitiveObjectProperty>
[src]
pub fn transitive_object_property(
&self
) -> impl Iterator<Item = &TransitiveObjectProperty>
Return all instances of TransitiveObjectProperty in the ontology.
impl Ontology
[src]
impl Ontology
pub fn assert_annotation(
&self
) -> impl Iterator<Item = &AssertAnnotation>
[src]
pub fn assert_annotation(
&self
) -> impl Iterator<Item = &AssertAnnotation>
Return all instances of AssertAnnotation in the ontology.
impl Ontology
[src]
impl Ontology
pub fn sub_annotation_property(
&self
) -> impl Iterator<Item = &SubAnnotationProperty>
[src]
pub fn sub_annotation_property(
&self
) -> impl Iterator<Item = &SubAnnotationProperty>
Return all instances of SubAnnotationProperty in the ontology.
impl Ontology
[src]
impl Ontology
pub fn ontology_annotation(
&self
) -> impl Iterator<Item = &OntologyAnnotation>
[src]
pub fn ontology_annotation(
&self
) -> impl Iterator<Item = &OntologyAnnotation>
Return all instances of OntologyAnnotation in the ontology.
impl Ontology
[src]
impl Ontology
pub fn new() -> Ontology
[src]
pub fn new() -> Ontology
Create a new ontology.
Examples
let o = Ontology::new(); let o2 = Ontology::new(); assert_eq!(o, o2);
pub fn insert<A>(&mut self, ax: A) -> bool where
A: Into<AnnotatedAxiom>,
[src]
pub fn insert<A>(&mut self, ax: A) -> bool where
A: Into<AnnotatedAxiom>,
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.
pub fn declare<N>(&mut self, ne: N) -> bool where
N: Into<NamedEntity>,
[src]
pub fn declare<N>(&mut self, ne: N) -> bool where
N: Into<NamedEntity>,
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"));
pub fn annotated_axiom(
&self,
axk: AxiomKind
) -> impl Iterator<Item = &AnnotatedAxiom>
[src]
pub fn annotated_axiom(
&self,
axk: AxiomKind
) -> impl Iterator<Item = &AnnotatedAxiom>
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.
pub fn axiom(
&self,
axk: AxiomKind
) -> impl Iterator<Item = &Axiom>
[src]
pub fn axiom(
&self,
axk: AxiomKind
) -> impl Iterator<Item = &Axiom>
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]
impl Ontology
pub fn direct_subclass<C>(
&self,
c: C
) -> impl Iterator<Item = &ClassExpression> where
C: Into<ClassExpression>,
[src]
pub fn direct_subclass<C>(
&self,
c: C
) -> impl Iterator<Item = &ClassExpression> where
C: Into<ClassExpression>,
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);
pub fn is_subclass<C>(&self, super_class: C, sub_class: C) -> bool where
C: Into<ClassExpression>,
[src]
pub fn is_subclass<C>(&self, super_class: C, sub_class: C) -> bool where
C: Into<ClassExpression>,
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]
impl Debug for Ontology
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Default for Ontology
[src]
impl Default for Ontology
impl Eq for Ontology
[src]
impl Eq for Ontology
impl PartialEq for Ontology
[src]
impl PartialEq for Ontology