1#![warn(missing_docs)]
38
39mod axiom;
40mod dirty;
41mod entity;
42mod error;
43mod graph;
44mod iri;
45mod limits;
46mod ontology;
47mod parse_meta;
48mod reasoner;
49mod serialize;
50mod session;
51mod taxonomy;
52mod trace;
53
54pub use axiom::{Axiom, AxiomId};
55pub use dirty::{axiom_signature, DirtySet, OntologyRevision};
56pub use entity::{EntityId, EntityKind, EntityRecord, EntityRegistry};
57pub use error::{Error, Result};
58pub use graph::{AxiomIndex, AxiomStore};
59pub use iri::{InternPool, IriId};
60pub use limits::Limits;
61pub use ontology::{Ontology, OntologyBuilder};
62pub use parse_meta::{OwlConstruct, ParseMeta, ParseMetaSummary};
63pub use reasoner::{Profile, Reasoner, ReasonerBuilder, ReasonerConfig};
64pub use session::ReasonerSession;
65pub use taxonomy::Taxonomy;
66pub use trace::{InferenceTrace, TraceConclusion, TracePremise, TraceStep};
67
68#[cfg(test)]
69mod integration_tests {
70 use super::*;
71
72 #[test]
73 fn classify_returns_not_implemented_for_el() {
74 let ontology = Ontology::default();
75 let mut reasoner = Reasoner::builder()
76 .profile(Profile::El)
77 .build(ontology)
78 .expect("build");
79 assert_eq!(reasoner.classify().unwrap_err(), Error::NotImplemented);
80 assert_eq!(reasoner.ontology().entity_count(), 0);
81 }
82
83 #[test]
84 fn classify_rdfs_profile_returns_delegate_hint() {
85 let ontology = Ontology::default();
86 let mut reasoner = Reasoner::builder()
87 .profile(Profile::Rdfs)
88 .build(ontology)
89 .expect("build");
90 let err = reasoner.classify().expect_err("rdfs delegate hint");
91 assert!(matches!(err, Error::Message(_)));
92 }
93
94 #[test]
95 fn classify_rl_profile_returns_delegate_hint() {
96 let ontology = Ontology::default();
97 let mut reasoner = Reasoner::builder()
98 .profile(Profile::Rl)
99 .build(ontology)
100 .expect("build");
101 let err = reasoner.classify().expect_err("rl delegate hint");
102 assert!(matches!(err, Error::Message(_)));
103 }
104
105 #[test]
106 fn reasoner_rejects_invalid_parallelism() {
107 let ontology = Ontology::default();
108 let err = Reasoner::builder()
109 .config(ReasonerConfig {
110 parallelism: 0,
111 ..ReasonerConfig::default()
112 })
113 .build(ontology)
114 .expect_err("parallelism");
115 assert!(matches!(err, Error::Message(_)));
116 }
117}