Ymris provides a direct reasoner which implements the Jena reasoner interface and hence can be used to construct an InfModel. [The name Direct is a historical hangover.]
com.hp.jena.ymris.deploy.reasoner.DirectReasoner( RuleSet rs )The RuleSet object is constructed by applying the Ymris parser to a suitable input stream. For example:
Ymris y = new Ymris( new StringReader( rules ) ); YAST yast = y.ymris(); Reasoner r = new DirectReasoner( yast.ruleSets().get( 0 ) );(The Ymris grammar allows multiple rulesets to be provided in a single input stream, but at present the reasoner only supports a single - the first or only - ruleset in a stream.)
Once the reasoner has been constructed, it can be bound to Jena RDF data in the usual way. By default, it uses a cut-down set of Jena2 built-in functions. To use some other set of functions, then use
DirectReasoner( RuleSet rs, HowToGenerator gen )The
HowToGenerator
interface creates a
HowTo given an InfGraph; the InfGraph is required for
implementations of the unless primitive of Ymris
and for the Jena2 noValues
predicate.