package de.linkvt.bachelor.config;

import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLMutableOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.web.context.WebApplicationContext;

/**
 * Creates beans for OWL API classes.
 */
@Configuration
public class OwlApiConfig {
  @Bean
  public OWLDataFactory dataFactory() {
    return OWLManager.getOWLDataFactory();
  }

  @Bean
  @Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.INTERFACES)
  public OWLMutableOntology owlOntology() throws OWLOntologyCreationException {
    // Cast to a mutable ontology to pass OWLApi's strange checks
    return (OWLMutableOntology) OWLManager.createOWLOntologyManager().createOntology();
  }
}

@@ -82,16 +82,57 @@
 anager;%0A
+import org.semanticweb.owlapi.model.IRI;%0A
 import o
@@ -293,24 +293,80 @@
 nException;%0A
+import org.semanticweb.owlapi.model.OWLOntologyManager;%0A
 import org.s
@@ -734,16 +734,94 @@
 onfig %7B%0A
+  private static final String DEFAULT_PREFIX = %22http://linkvt.de/bachelor/%22;%0A%0A
   @Bean%0A
@@ -1090,16 +1090,96 @@
 ption %7B%0A
+    OWLOntologyManager ontologyManager = OWLManager.createOWLOntologyManager();%0A
     // C
@@ -1268,19 +1268,24 @@
 tology) 
-OWL
+ontology
 Manager.
@@ -1295,43 +1295,42 @@
 ateO
-WLO
 ntology
-Manager().createOntology(
+(IRI.create(DEFAULT_PREFIX)
 );%0A 

Add temporary ontology iri