[−][src]Struct reasonable::reasoner::Reasoner
Reasoner
is the interface to the reasoning engine. Instances of Reasoner
maintain the state
required to do reasoning.
use reasonable::reasoner::Reasoner; let mut r = Reasoner::new(); // load in an ontology file r.load_file("example_models/ontologies/Brick.n3").unwrap(); // load in another ontology file r.load_file("example_models/ontologies/rdfs.ttl").unwrap(); // load in more triples r.load_file("example_models/small1.n3").unwrap(); // perform reasoning r.reason(); // dump to file r.dump_file("output.ttl").unwrap();
Implementations
impl Reasoner
[src]
pub fn new() -> Self
[src]
Create a new Reasoner instance
pub fn load_triples_str(
&mut self,
triples: Vec<(&'static str, &'static str, &'static str)>
)
[src]
&mut self,
triples: Vec<(&'static str, &'static str, &'static str)>
)
Load in a vector of triples
pub fn load_triples(&mut self, triples: Vec<(Node, Node, Node)>)
[src]
Load in a vector of triples
pub fn dump_file(&mut self, filename: &str) -> Result<(), Error>
[src]
Dump the contents of the reasoner to the given file.
NOTE: currently dump_file
prevents the reasoner from being re-used. This is a bug and
will be amended
pub fn load_file(&mut self, filename: &str) -> Result<(), String>
[src]
Load the triples in the given file into the Reasoner. This currently accepts
Turtle-formatted (.ttl
) and NTriples-formatted (.n3
) files. If you have issues loading
in a Turtle file, try converting it to NTriples
pub fn reason(&mut self)
[src]
Perform OWL 2 RL-compatible reasoning on the triples currently loaded into the Reasoner
pub fn get_triples(&self) -> Vec<(Node, Node, Node)>
[src]
Returns the vec of triples currently contained in the Reasoner
pub fn view_output(&self) -> &[(Node, Node, Node)]
[src]
Returns the vec of triples currently contained in the Reasoner
pub fn get_triples_string(&mut self) -> Vec<(String, String, String)>
[src]
Returns the vec of triples currently contained in the Reasoner
Auto Trait Implementations
impl !RefUnwindSafe for Reasoner
[src]
impl !Send for Reasoner
[src]
impl !Sync for Reasoner
[src]
impl Unpin for Reasoner
[src]
impl !UnwindSafe for Reasoner
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,