[][src]Struct reasonable::reasoner::Reasoner

pub struct Reasoner { /* fields omitted */ }

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,