@Deprecated @Override public void makeLoadImportRequest(OWLImportsDeclaration declaration) throws UnloadableImportException { if (sealed) { throw new ImportLoadingNotAllowedException(); } delegate.makeLoadImportRequest(declaration); }
@Override public void makeLoadImportRequest(OWLImportsDeclaration declaration, OWLOntologyLoaderConfiguration configuration) throws UnloadableImportException { if (sealed) { throw new ImportLoadingNotAllowedException(); } delegate.makeLoadImportRequest(declaration, configuration); }
/** * Requests that the manager loads an imported ontology that is described by an imports * statement. This method is generally used by parsers and other kinds of loaders. For simply * loading an ontology, use the loadOntologyXXX methods. The method respects the list of ignored * imports in the specified configuration. In other words, if this methods is called for an * ignored import as specified by the configuration object then the import won't be loaded. The * ontology loader configuration used is the default one for this manager. * * @param declaration The declaration that describes the import to be loaded. * @throws UnloadableImportException if there was a problem creating and loading the import and * silent missing imports handling is not turned on. If silent missing import handling * is turned on then this exception will not be thrown. */ default void makeLoadImportRequest(OWLImportsDeclaration declaration) { makeLoadImportRequest(declaration, getOntologyLoaderConfiguration()); }
/** * Requests that the manager loads an imported ontology that is described by an imports * statement. This method is generally used by parsers and other kinds of loaders. For simply * loading an ontology, use the loadOntologyXXX methods. The method respects the list of ignored * imports in the specified configuration. In other words, if this methods is called for an * ignored import as specified by the configuration object then the import won't be loaded. The * ontology loader configuration used is the default one for this manager. * * @param declaration The declaration that describes the import to be loaded. * @throws UnloadableImportException if there was a problem creating and loading the import and * silent missing imports handling is not turned on. If silent missing import handling * is turned on then this exception will not be thrown. */ default void makeLoadImportRequest(OWLImportsDeclaration declaration) { makeLoadImportRequest(declaration, getOntologyLoaderConfiguration()); }
/** * Requests that the manager loads an imported ontology that is described by an imports * statement. This method is generally used by parsers and other kinds of loaders. For simply * loading an ontology, use the loadOntologyXXX methods. The method respects the list of ignored * imports in the specified configuration. In other words, if this methods is called for an * ignored import as specified by the configuration object then the import won't be loaded. The * ontology loader configuration used is the default one for this manager. * * @param declaration The declaration that describes the import to be loaded. * @throws UnloadableImportException if there was a problem creating and loading the import and * silent missing imports handling is not turned on. If silent missing import handling * is turned on then this exception will not be thrown. */ default void makeLoadImportRequest(OWLImportsDeclaration declaration) { makeLoadImportRequest(declaration, getOntologyLoaderConfiguration()); }
private static void adjustImports(OWLOntology ontology, List<OWLOntologyChange> changes, OWLOntologyLoaderConfiguration configuration) throws UnloadableImportException { OWLOntologyManager manager = ontology.getOWLOntologyManager(); Set<OWLImportsDeclaration> finalDeclaredImports = ontology.getImportsDeclarations(); Set<OWLImportsDeclaration> missingImports = new TreeSet<OWLImportsDeclaration>(); for (OWLOntologyChange change : changes) { if (change instanceof AddImport) { OWLImportsDeclaration importDecl = ((AddImport) change).getImportDeclaration(); if (finalDeclaredImports.contains(importDecl) && manager.getImportedOntology(importDecl) == null) { missingImports.add(importDecl); } } } for (OWLImportsDeclaration missingImport : missingImports) { manager.makeLoadImportRequest(missingImport, configuration); } }
private void addFile(final String inputFile, final OWLOntologyManager manager, final LimitedMapIRIMapper iriMapper, final OWLOntology baseOntology) { try { final IRI iri = IRI.create(inputFile); iriMapper.addAllowedIRI(iri); final OWLImportsDeclaration declaration = manager.getOWLDataFactory().getOWLImportsDeclaration(iri); manager.applyChange(new AddImport(baseOntology, declaration)); manager.makeLoadImportRequest(declaration); } catch (final Exception e) { if (_verbose) System.err.println(e.getLocalizedMessage()); } }
public void endElement() throws OWLParserException, UnloadableImportException { IRI ontIRI = getIRI(getText().trim()); OWLImportsDeclaration decl = getOWLDataFactory().getOWLImportsDeclaration(ontIRI); getOWLOntologyManager().applyChange(new AddImport(getOntology(), decl)); getOWLOntologyManager().makeLoadImportRequest(decl); }
protected OWLOntologyID handleOntology(OWLOntology ont, Set<AddImport> imports, Set<AddOntologyAnnotation> ontologyAnnotations) { OWLOntologyID ontologyID; ManchesterOWLSyntaxOntologyHeader header = parseOntologyHeader(false); for (OWLImportsDeclaration decl : header.getImportsDeclarations()) { assert decl != null; imports.add(new AddImport(ont, decl)); ont.getOWLOntologyManager().makeLoadImportRequest(decl, getOntologyLoaderConfiguration()); OWLOntology imported = ont.getOWLOntologyManager().getImportedOntology(decl); if (imported != null) { imported.axioms(AxiomType.DECLARATION).forEach(this::processDeclaredEntities); } } for (OWLAnnotation anno : header.getAnnotations()) { ontologyAnnotations.add(new AddOntologyAnnotation(ont, anno)); } ontologyID = header.getOntologyID(); return ontologyID; }
@Override void endElement() { IRI ontIRI = handler.getIRI(getText().trim()); OWLImportsDeclaration decl = df.getOWLImportsDeclaration(ontIRI); handler.getOWLOntologyManager().applyChange(new AddImport(handler.getOntology(), decl)); handler.getOWLOntologyManager().makeLoadImportRequest(decl, handler.getConfiguration()); }
protected OWLOntologyID handleOntology(OWLOntology ont, Set<AddImport> imports, Set<AddOntologyAnnotation> ontologyAnnotations) { OWLOntologyID ontologyID; ManchesterOWLSyntaxOntologyHeader header = parseOntologyHeader(false); for (OWLImportsDeclaration decl : header.getImportsDeclarations()) { assert decl != null; imports.add(new AddImport(ont, decl)); ont.getOWLOntologyManager().makeLoadImportRequest(decl, getOntologyLoaderConfiguration()); OWLOntology imported = ont.getOWLOntologyManager().getImportedOntology(decl); if (imported != null) { imported.axioms(AxiomType.DECLARATION).forEach(this::processDeclaredEntities); } } for (OWLAnnotation anno : header.getAnnotations()) { ontologyAnnotations.add(new AddOntologyAnnotation(ont, anno)); } ontologyID = header.getOntologyID(); return ontologyID; }
@Override void endElement() { IRI ontIRI = handler.getIRI(getText().trim()); OWLImportsDeclaration decl = df.getOWLImportsDeclaration(ontIRI); handler.getOWLOntologyManager().applyChange(new AddImport(handler.getOntology(), decl)); handler.getOWLOntologyManager().makeLoadImportRequest(decl, handler.getConfiguration()); }
protected OWLOntologyID handleOntology(OWLOntology ont, Set<AddImport> imports, Set<AddOntologyAnnotation> ontologyAnnotations) { OWLOntologyID ontologyID; ManchesterOWLSyntaxOntologyHeader header = parseOntologyHeader(false); for (OWLImportsDeclaration decl : header.getImportsDeclarations()) { assert decl != null; imports.add(new AddImport(ont, decl)); ont.getOWLOntologyManager().makeLoadImportRequest(decl, getOntologyLoaderConfiguration()); OWLOntology imported = ont.getOWLOntologyManager().getImportedOntology(decl); if (imported != null) { imported.axioms(AxiomType.DECLARATION).forEach(this::processDeclaredEntities); } } for (OWLAnnotation anno : header.getAnnotations()) { ontologyAnnotations.add(new AddOntologyAnnotation(ont, anno)); } ontologyID = header.getOntologyID(); return ontologyID; }
@Override void endElement() { IRI ontIRI = handler.getIRI(getText().trim()); OWLImportsDeclaration decl = df.getOWLImportsDeclaration(ontIRI); handler.getOWLOntologyManager().applyChange(new AddImport(handler.getOntology(), decl)); handler.getOWLOntologyManager().makeLoadImportRequest(decl, handler.getConfiguration()); }
@Override void endElement() { IRI ontIRI = handler.getIRI(getText().trim()); OWLImportsDeclaration decl = df.getOWLImportsDeclaration(ontIRI); handler.getOWLOntologyManager().applyChange(new AddImport(handler.getOntology(), decl)); handler.getOWLOntologyManager().makeLoadImportRequest(decl, handler.getConfiguration()); }
@Override public void endElement() throws OWLParserException, UnloadableImportException { IRI ontIRI = getIRI(getText().trim()); OWLImportsDeclaration decl = getOWLDataFactory().getOWLImportsDeclaration(ontIRI); getOWLOntologyManager().applyChange(new AddImport(getOntology(), decl)); getOWLOntologyManager().makeLoadImportRequest(decl, getConfiguration()); }
@Override public void handleTriple(IRI s, IRI p, IRI o) { consume(s, p, o); consumer.addOntology(s); consumer.addOntology(o); OWLImportsDeclaration id = df.getOWLImportsDeclaration(o); consumer.addImport(id); if (!consumer.getConfiguration().isIgnoredImport(o)) { OWLOntologyManager man = consumer.getOWLOntologyManager(); man.makeLoadImportRequest(id, consumer.getConfiguration()); handleImportingRDFGraphRatherThanOntology(id, man, man.getImportedOntology(id)); consumer.importsClosureChanged(); } }
@Override public void handleTriple(IRI s, IRI p, IRI o) { consume(s, p, o); consumer.addOntology(s); consumer.addOntology(o); OWLImportsDeclaration id = df.getOWLImportsDeclaration(o); consumer.addImport(id); if (!consumer.getConfiguration().isIgnoredImport(o)) { OWLOntologyManager man = consumer.getOWLOntologyManager(); man.makeLoadImportRequest(id, consumer.getConfiguration()); handleImportingRDFGraphRatherThanOntology(id, man, man.getImportedOntology(id)); consumer.importsClosureChanged(); } }
@Override public void handleTriple(IRI s, IRI p, IRI o) { consume(s, p, o); consumer.addOntology(s); consumer.addOntology(o); OWLImportsDeclaration id = df.getOWLImportsDeclaration(o); consumer.addImport(id); if (!consumer.getConfiguration().isIgnoredImport(o)) { OWLOntologyManager man = consumer.getOWLOntologyManager(); man.makeLoadImportRequest(id, consumer.getConfiguration()); handleImportingRDFGraphRatherThanOntology(id, man, man.getImportedOntology(id)); consumer.importsClosureChanged(); } }
@Override public void handleTriple(IRI s, IRI p, IRI o) { consume(s, p, o); consumer.addOntology(s); consumer.addOntology(o); OWLImportsDeclaration id = df.getOWLImportsDeclaration(o); consumer.addImport(id); if (!consumer.getConfiguration().isIgnoredImport(o)) { OWLOntologyManager man = consumer.getOWLOntologyManager(); man.makeLoadImportRequest(id, consumer.getConfiguration()); handleImportingRDFGraphRatherThanOntology(id, man, man.getImportedOntology(id)); consumer.importsClosureChanged(); } }