JenaOntologyService implements OntologyService { @Override public Ont parseOntology(final WebResource ont) { try (WebResource ontology = ont) { return new Ont(resolveImports(ModelFactory.createOntologyModel(defaultSpec, parse(ontology)))); } catch (final Exception e) { throw new RuntimeException(e); } } JenaOntologyService(); void setOntModelSpec(final OntModelSpec spec); @Reference void setRegistryDelegate(final OntologyRegistry registry); @Override Ont getOntology(final URI uri); @Override Ont parseOntology(final WebResource ont); @Override Ont merge(final Ontology ontology1, final Ontology ontology2); @Override Set<URI> inferClasses(final URI uri, final WebResource resource, final Ontology ontology);  }
@Test public void loadOntologyTest() { final WebResource resource = ONTOLOGY_REGISTRY.get(URI.create(ONT5)); final OntModel transitive = toTest.parseOntology(resource).model; final Model expectedTriples = ModelFactory.createDefaultModel(); expectedTriples.add(ModelFactory.createDefaultModel().read(ONTOLOGY_REGISTRY.get(URI.create(ONT1)) .representation(), null, "N-TRIPLES")); expectedTriples.add(ModelFactory.createDefaultModel().read(ONTOLOGY_REGISTRY.get(URI.create(ONT4)) .representation(), null, "N-TRIPLES")); expectedTriples.add(ModelFactory.createDefaultModel().read(ONTOLOGY_REGISTRY.get(URI.create(ONT5)) .representation(), null, "N-TRIPLES")); expectedTriples.removeAll(null, expectedTriples.getProperty(OWL_IMPORTS), null); assertTrue(transitive.containsAll(expectedTriples)); }