Search in sources :

Example 1 with RuleEngine

use of org.geneontology.rules.engine.RuleEngine in project minerva by geneontology.

the class GPADSPARQLTest method setupRules.

@BeforeClass
public static void setupRules() throws OWLOntologyCreationException {
    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
    OWLOntology ont = manager.loadOntologyFromOntologyDocument(GPADSPARQLTest.class.getResourceAsStream("/ro-merged-2017-10-02.ofn"));
    Set<Rule> rules = new HashSet<>();
    rules.addAll(JavaConverters.setAsJavaSetConverter(OWLtoRules.translate(ont, Imports.INCLUDED, true, true, true, true)).asJava());
    rules.addAll(JavaConverters.setAsJavaSetConverter(OWLtoRules.indirectRules(ont)).asJava());
    arachne = new RuleEngine(Bridge.rulesFromJena(JavaConverters.asScalaSetConverter(rules).asScala()), true);
}
Also used : RuleEngine(org.geneontology.rules.engine.RuleEngine) OWLOntology(org.semanticweb.owlapi.model.OWLOntology) OWLOntologyManager(org.semanticweb.owlapi.model.OWLOntologyManager) Rule(org.apache.jena.reasoner.rulesys.Rule) BeforeClass(org.junit.BeforeClass)

Aggregations

Rule (org.apache.jena.reasoner.rulesys.Rule)1 RuleEngine (org.geneontology.rules.engine.RuleEngine)1 BeforeClass (org.junit.BeforeClass)1 OWLOntology (org.semanticweb.owlapi.model.OWLOntology)1 OWLOntologyManager (org.semanticweb.owlapi.model.OWLOntologyManager)1