public OWLOntology loadOntologyFromOntologyDocument(IRI documentIRI) throws OWLOntologyCreationException { // Ontology URI not known in advance return loadOntology(null, new IRIDocumentSource(documentIRI)); }
public OWLOntologyFormat parse(IRI documentIRI, OWLOntology ontology) throws OWLParserException, IOException, UnloadableImportException { return parse(new IRIDocumentSource(documentIRI), ontology); } }
@Override public OWLOntology loadOntologyFromOntologyDocument(IRI documentIRI) throws OWLOntologyCreationException { // XXX check default // Ontology URI not known in advance return loadOntology(null, new IRIDocumentSource(documentIRI, null, null), getOntologyLoaderConfiguration()); }
@Override public OWLOntology loadOntologyFromOntologyDocument(IRI documentIRI) throws OWLOntologyCreationException { // XXX check default // Ontology URI not known in advance return loadOntology(null, new IRIDocumentSource(documentIRI, null, null), getOntologyLoaderConfiguration()); }
@Override public OWLOntology loadOntologyFromOntologyDocument(IRI documentIRI) throws OWLOntologyCreationException { // XXX check default // Ontology URI not known in advance return loadOntology(null, new IRIDocumentSource(documentIRI, null, null), getOntologyLoaderConfiguration()); }
@Override public OWLOntology loadOntologyFromOntologyDocument(IRI documentIRI) throws OWLOntologyCreationException { // XXX check default // Ontology URI not known in advance return loadOntology(null, new IRIDocumentSource(documentIRI, null, null), getOntologyLoaderConfiguration()); }
throws OWLOntologyCreationException { return loadOntologyFromOntologyDocument(new IRIDocumentSource(documentIRI, null, null), getOntologyLoaderConfiguration());
throws OWLOntologyCreationException { return loadOntologyFromOntologyDocument(new IRIDocumentSource(documentIRI, null, null), getOntologyLoaderConfiguration());
throws OWLOntologyCreationException { return loadOntologyFromOntologyDocument(new IRIDocumentSource(documentIRI, null, null), getOntologyLoaderConfiguration());
/** * Parses the ontology with a concrete representation available at {@code documentIRI} and adds * its axioms to {@code ontology}. Implementors of this method should load imported ontologies * through * {@link OWLOntologyManager#makeLoadImportRequest(org.semanticweb.owlapi.model.OWLImportsDeclaration, OWLOntologyLoaderConfiguration) * makeLoadImportRequest()}. * * @param documentIRI the IRI of the document to parse * @param ontology the ontology to which the parsed axioms are added * @return the format of the parsed ontology * @throws OWLParserException if there was a parsing problem parsing the ontology. * @throws OWLOntologyChangeException if there was a problem updating {@code ontology}. * Typically this depends on the document being parsed containing an ontology with an * ontology IRI clashing with one already loaded. * @throws UnloadableImportException if one or more imports could not be loaded. */ default OWLDocumentFormat parse(IRI documentIRI, OWLOntology ontology) { return parse(new IRIDocumentSource(documentIRI, null, null), ontology, ontology.getOWLOntologyManager().getOntologyLoaderConfiguration()); }
/** * Parses the ontology with a concrete representation available at {@code documentIRI} and adds * its axioms to {@code ontology}. Implementors of this method should load imported ontologies * through * {@link OWLOntologyManager#makeLoadImportRequest(org.semanticweb.owlapi.model.OWLImportsDeclaration, OWLOntologyLoaderConfiguration) * makeLoadImportRequest()}. * * @param documentIRI the IRI of the document to parse * @param ontology the ontology to which the parsed axioms are added * @return the format of the parsed ontology * @throws OWLParserException if there was a parsing problem parsing the ontology. * @throws OWLOntologyChangeException if there was a problem updating {@code ontology}. * Typically this depends on the document being parsed containing an ontology with an * ontology IRI clashing with one already loaded. * @throws UnloadableImportException if one or more imports could not be loaded. */ default OWLDocumentFormat parse(IRI documentIRI, OWLOntology ontology) { return parse(new IRIDocumentSource(documentIRI, null, null), ontology, ontology.getOWLOntologyManager().getOntologyLoaderConfiguration()); }
/** * Parses the ontology with a concrete representation available at {@code documentIRI} and adds * its axioms to {@code ontology}. Implementors of this method should load imported ontologies * through * {@link OWLOntologyManager#makeLoadImportRequest(org.semanticweb.owlapi.model.OWLImportsDeclaration, OWLOntologyLoaderConfiguration) * makeLoadImportRequest()}. * * @param documentIRI the IRI of the document to parse * @param ontology the ontology to which the parsed axioms are added * @return the format of the parsed ontology * @throws OWLParserException if there was a parsing problem parsing the ontology. * @throws OWLOntologyChangeException if there was a problem updating {@code ontology}. * Typically this depends on the document being parsed containing an ontology with an * ontology IRI clashing with one already loaded. * @throws UnloadableImportException if one or more imports could not be loaded. */ default OWLDocumentFormat parse(IRI documentIRI, OWLOntology ontology) { return parse(new IRIDocumentSource(documentIRI, null, null), ontology, ontology.getOWLOntologyManager().getOntologyLoaderConfiguration()); }
public OWLOntology loadOntology(IRI ontologyIRI) throws OWLOntologyCreationException { OWLOntologyID id = new OWLOntologyID(ontologyIRI); OWLOntology ontByID = ontologiesByID.get(id); if (ontByID != null) { return ontByID; } IRI documentIRI = getDocumentIRIFromMappers(id, true); if (documentIRIsByID.values().contains(documentIRI)) { throw new OWLOntologyDocumentAlreadyExistsException(documentIRI); } // The ontology might be being loaded, but its IRI might // not have been set (as is probably the case with RDF/XML!) if (documentIRI != null) { OWLOntology ontByDocumentIRI = getOntology(documentIRI); if (ontByDocumentIRI != null) { return ontByDocumentIRI; } } else { // Nothing we can do here. We can't get a document IRI to load // the ontology from. throw new OntologyIRIMappingNotFoundException(ontologyIRI); } return loadOntology(ontologyIRI, new IRIDocumentSource(documentIRI)); }
return ontByDocumentIRI; return loadOntology(iri, new IRIDocumentSource(documentIRI, null, null), configuration); } finally { writeLock.unlock();
return ontByDocumentIRI; return loadOntology(iri, new IRIDocumentSource(documentIRI, null, null), configuration); } finally { writeLock.unlock();
return ontByDocumentIRI; return loadOntology(iri, new IRIDocumentSource(documentIRI, null, null), configuration); } finally { writeLock.unlock();
OWLOntologyLoaderConfiguration configuration = new OWLOntologyLoaderConfiguration(); configuration = configuration.setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT); IRIDocumentSource documentSource = new IRIDocumentSource(IRI.create(documentURI)); OWLOntology ontology = loadingManager.loadOntologyFromOntologyDocument(documentSource, configuration); Set<OWLOntology> alreadyLoadedOntologies = new HashSet<>();
loadingManager.addOntologyLoaderListener(listener); loadingManager.loadOntologyFromOntologyDocument( new IRIDocumentSource(IRI.create(physicalLocation)), new OWLOntologyLoaderConfiguration().setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT)); loadingManager.removeOntologyLoaderListener(listener);
OWLOntologyLoaderConfiguration configuration = new OWLOntologyLoaderConfiguration(); configuration = configuration.setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT); IRIDocumentSource documentSource = new IRIDocumentSource(IRI.create(documentURI)); OWLOntology ontology = loadingManager.loadOntologyFromOntologyDocument(documentSource, configuration); Set<OWLOntology> alreadyLoadedOntologies = new HashSet<>();
loadingManager.addOntologyLoaderListener(listener); loadingManager.loadOntologyFromOntologyDocument( new IRIDocumentSource(IRI.create(physicalLocation)), new OWLOntologyLoaderConfiguration().setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT)); loadingManager.removeOntologyLoaderListener(listener);