Skip to content

Commit

Permalink
Refining the doctest on ontology::iri_mapped.
Browse files Browse the repository at this point in the history
  • Loading branch information
filippodebortoli committed Nov 21, 2024
1 parent 665a362 commit dc7100c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/ontology/iri_mapped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ use std::collections::HashSet;
/// ```
/// # use horned_owl::ontology::iri_mapped::IRIMappedIndex;
/// # use horned_owl::{model::*, ontology::indexed::OntologyIndex};
/// # use std::rc::Rc;
/// # fn test_index_example() {
/// let build = Build::new();
/// let mut idx = IRIMappedIndex::<RcStr, RcAnnotatedComponent>::new();
/// let build: Build<Rc<str>> = Build::new();
/// let mut idx = IRIMappedIndex::new();
///
/// // We create a component to add to the index.
/// let cmp = AnnotatedComponent {
/// component: Component::DisjointClasses(DisjointClasses(vec![
/// ClassExpression::Class(build.class("http://www.example.com/#A")),
Expand All @@ -44,8 +47,10 @@ use std::collections::HashSet;
/// ann: Default::default(),
/// };
///
/// idx.index_insert(RcAnnotatedComponent::new(cmp));
/// // We insert the annotated component that we just created in the index.
/// idx.index_insert(cmp);
///
/// // The index now lists the annotated component for both entities occurring in it.
/// assert!(idx.component_for_iri(&build.iri("http://www.example.com/#A")).next().is_some());
/// assert!(idx.component_for_iri(&build.iri("http://www.example.com/#B")).next().is_some());
/// # }
Expand Down

0 comments on commit dc7100c

Please sign in to comment.