/** * @param missingOntologyHeaderStrategy new value * @return a copy of this configuration object with a different strategy */ public OWLOntologyLoaderConfiguration setMissingOntologyHeaderStrategy( MissingOntologyHeaderStrategy missingOntologyHeaderStrategy) { // do not make copies if setting the same value if (getMissingOntologyHeaderStrategy() == missingOntologyHeaderStrategy) { return this; } OWLOntologyLoaderConfiguration copy = copyConfiguration(); copy.overrides.put(MISSING_ONTOLOGY_HEADER_STRATEGY, missingOntologyHeaderStrategy); return copy; }
/** * @param missingOntologyHeaderStrategy new value * @return a copy of this configuration object with a different strategy */ public OWLOntologyLoaderConfiguration setMissingOntologyHeaderStrategy( MissingOntologyHeaderStrategy missingOntologyHeaderStrategy) { // do not make copies if setting the same value if (getMissingOntologyHeaderStrategy() == missingOntologyHeaderStrategy) { return this; } OWLOntologyLoaderConfiguration copy = copyConfiguration(); copy.overrides.put(MISSING_ONTOLOGY_HEADER_STRATEGY, missingOntologyHeaderStrategy); return copy; }
/** * @param missingOntologyHeaderStrategy new value * @return a copy of this configuration object with a different strategy */ public OWLOntologyLoaderConfiguration setMissingOntologyHeaderStrategy( MissingOntologyHeaderStrategy missingOntologyHeaderStrategy) { // do not make copies if setting the same value if (getMissingOntologyHeaderStrategy() == missingOntologyHeaderStrategy) { return this; } OWLOntologyLoaderConfiguration copy = copyConfiguration(); copy.overrides.put(MISSING_ONTOLOGY_HEADER_STRATEGY, missingOntologyHeaderStrategy); return copy; }
protected void handleImportingRDFGraphRatherThanOntology(OWLImportsDeclaration id, OWLOntologyManager man, @Nullable OWLOntology io) { if (io != null) { OWLDocumentFormat importedOntologyFormat = io.getFormat(); if (importedOntologyFormat instanceof AbstractRDFPrefixDocumentFormat && io.isAnonymous() && consumer.getConfiguration() .getMissingOntologyHeaderStrategy() == INCLUDE_GRAPH) { // We should have just included the triples rather // than imported them. So, // we remove the imports statement, add the axioms // from the imported ontology to // out importing ontology and remove the imported // ontology. // WHO EVER THOUGHT THAT THIS WAS A GOOD IDEA? man.applyChange(new RemoveImport(consumer.getOntology(), id)); io.importsDeclarations().forEach(d -> addImport(man, d)); io.annotations().forEach(ann -> addOntAnn(man, ann)); io.axioms().forEach(this::add); man.removeOntology(io); } } } }
protected void handleImportingRDFGraphRatherThanOntology(OWLImportsDeclaration id, OWLOntologyManager man, @Nullable OWLOntology io) { if (io != null) { OWLDocumentFormat importedOntologyFormat = io.getFormat(); if (importedOntologyFormat instanceof AbstractRDFPrefixDocumentFormat && io.isAnonymous() && consumer.getConfiguration() .getMissingOntologyHeaderStrategy() == INCLUDE_GRAPH) { // We should have just included the triples rather // than imported them. So, // we remove the imports statement, add the axioms // from the imported ontology to // out importing ontology and remove the imported // ontology. // WHO EVER THOUGHT THAT THIS WAS A GOOD IDEA? man.applyChange(new RemoveImport(consumer.getOntology(), id)); io.importsDeclarations().forEach(d -> addImport(man, d)); io.annotations().forEach(ann -> addOntAnn(man, ann)); io.axioms().forEach(this::add); man.removeOntology(io); } } } }
protected void handleImportingRDFGraphRatherThanOntology(OWLImportsDeclaration id, OWLOntologyManager man, @Nullable OWLOntology io) { if (io != null) { OWLDocumentFormat importedOntologyFormat = io.getFormat(); if (importedOntologyFormat instanceof AbstractRDFPrefixDocumentFormat && io.isAnonymous() && consumer.getConfiguration() .getMissingOntologyHeaderStrategy() == INCLUDE_GRAPH) { // We should have just included the triples rather // than imported them. So, // we remove the imports statement, add the axioms // from the imported ontology to // out importing ontology and remove the imported // ontology. // WHO EVER THOUGHT THAT THIS WAS A GOOD IDEA? man.applyChange(new RemoveImport(consumer.getOntology(), id)); io.importsDeclarations().forEach(d -> addImport(man, d)); io.annotations().forEach(ann -> addOntAnn(man, ann)); io.axioms().forEach(this::add); man.removeOntology(io); } } } }
protected void handleImportingRDFGraphRatherThanOntology(OWLImportsDeclaration id, OWLOntologyManager man, @Nullable OWLOntology io) { if (io != null) { OWLDocumentFormat importedOntologyFormat = io.getFormat(); if (importedOntologyFormat instanceof AbstractRDFPrefixDocumentFormat && io.isAnonymous() && consumer.getConfiguration() .getMissingOntologyHeaderStrategy() == INCLUDE_GRAPH) { // We should have just included the triples rather // than imported them. So, // we remove the imports statement, add the axioms // from the imported ontology to // out importing ontology and remove the imported // ontology. // WHO EVER THOUGHT THAT THIS WAS A GOOD IDEA? man.applyChange(new RemoveImport(consumer.getOntology(), id)); io.importsDeclarations().forEach(d -> addImport(man, d)); io.annotations().forEach(ann -> addOntAnn(man, ann)); io.axioms().forEach(this::add); man.removeOntology(io); } } } }
if (importedOntologyFormat instanceof RDFOntologyFormat) { if (importedOntology.isAnonymous()) { OWLOntologyLoaderConfiguration.MissingOntologyHeaderStrategy missingOntologyHeaderStrategy = getConsumer().getConfiguration().getMissingOntologyHeaderStrategy(); boolean includeGraph = missingOntologyHeaderStrategy.equals(OWLOntologyLoaderConfiguration.MissingOntologyHeaderStrategy.INCLUDE_GRAPH);