You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by al...@apache.org on 2011/10/17 09:43:19 UTC

svn commit: r1185032 [2/4] - in /incubator/stanbol/trunk: commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/format/ enhancer/engines/refactor/src/main/java/org/apache/stanbol/enhancer/engines/refactor/ explanation/core/ explanation/cor...

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologyScope.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologyScope.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologyScope.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologyScope.java Mon Oct 17 07:43:15 2011
@@ -35,23 +35,25 @@ import org.semanticweb.owlapi.model.OWLO
  * An ontology scope can thus be seen as a façade for ontology spaces.
  * 
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
-public interface OntologyScope extends ScopeOntologyListenable {
+public interface OntologyScope extends ScopeOntologyListenable, OWLExportable {
 
     /**
      * Adds a new ontology space to the list of user session spaces for this scope.
      * 
      * @param sessionSpace
      *            the ontology space to be added.
-     * @throws UnmodifiableOntologySpaceException
+     * @throws UnmodifiableOntologyCollectorException
      */
-    void addSessionSpace(OntologySpace sessionSpace, IRI sessionID) throws UnmodifiableOntologySpaceException;
+    void addSessionSpace(OntologySpace sessionSpace, String sessionID) throws UnmodifiableOntologyCollectorException;
 
     /**
      * Returns an ontological form of this scope.
      * 
+     * @deprecated Please use the inherited method {@link OWLExportable#asOWLOntology(boolean)}. Calls to the
+     *             current method are equivalent to asOWLOntology(false).
      * @return an OWL ontology that represents this scope.
      */
     OWLOntology asOWLOntology();
@@ -79,9 +81,9 @@ public interface OntologyScope extends S
      * @return the unique identifier for this ontology scope
      */
     String getID();
-    
+
     IRI getNamespace();
-    
+
     /**
      * Return the ontology space for this scope that is identified by the supplied IRI.
      * 
@@ -90,7 +92,7 @@ public interface OntologyScope extends S
      * @return the ontology space identified by <code>sessionID</code>, or null if no such space is registered
      *         for this scope and session.
      */
-    SessionOntologySpace getSessionSpace(IRI sessionID);
+    SessionOntologySpace getSessionSpace(String sessionID);
 
     /**
      * Returns all the active ontology spaces for this scope.
@@ -104,10 +106,10 @@ public interface OntologyScope extends S
      * 
      * @param customSpace
      *            the custom ontology space.
-     * @throws UnmodifiableOntologySpaceException
+     * @throws UnmodifiableOntologyCollectorException
      *             if either the scope or the supplied space are locked.
      */
-    void setCustomSpace(OntologySpace customSpace) throws UnmodifiableOntologySpaceException;
+    void setCustomSpace(OntologySpace customSpace) throws UnmodifiableOntologyCollectorException;
 
     void setNamespace(IRI namespace);
 

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologyScopeFactory.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologyScopeFactory.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologyScopeFactory.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologyScopeFactory.java Mon Oct 17 07:43:15 2011
@@ -1,81 +1,54 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.stanbol.ontologymanager.ontonet.api.ontology;
 
 import org.apache.stanbol.ontologymanager.ontonet.api.DuplicateIDException;
 import org.apache.stanbol.ontologymanager.ontonet.api.io.OntologyInputSource;
 import org.semanticweb.owlapi.model.IRI;
 
-
 /**
- * An ontology scope factory is responsible for the creation of new ontology
- * scopes from supplied ontology input sources for their core and custom spaces.<br>
+ * An ontology scope factory is responsible for the creation of new ontology scopes from supplied ontology
+ * input sources for their core and custom spaces.<br>
  * <br>
- * Factory implementations should not call the setup method of the ontology
- * scope once it is created, so that its spaces are not locked from editing
- * since creation time.
+ * Factory implementations should not call the setup method of the ontology scope once it is created, so that
+ * its spaces are not locked from editing since creation time.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public interface OntologyScopeFactory extends ScopeEventListenable {
 
-	/**
-	 * Creates and returns a new ontology scope with the core space ontologies
-	 * obtained from <code>coreSource</code> and the custom space not set.
-	 * 
-	 * @param scopeID
-	 *            the desired unique identifier for the ontology scope.
-	 * @param coreSource
-	 *            the input source that provides the top ontology for the core
-	 *            space.
-	 * @return the newly created ontology scope.
-	 * @throws DuplicateIDException
-	 *             if an ontology scope with the given identifier is already
-	 *             <i>registered</i>. The exception is not thrown if another
-	 *             scope with the same ID has been created but not registered.
-	 */
-    OntologyScope createOntologyScope(String scopeID,
-            OntologyInputSource coreSource) throws DuplicateIDException;
-    
+    /**
+     * Creates and returns a new ontology scope with the core space ontologies obtained from
+     * <code>coreSource</code> and the custom space not set.
+     * 
+     * @param scopeID
+     *            the desired unique identifier for the ontology scope.
+     * @param coreSource
+     *            the input source that provides the top ontology for the core space.
+     * @return the newly created ontology scope.
+     * @throws DuplicateIDException
+     *             if an ontology scope with the given identifier is already <i>registered</i>. The exception
+     *             is not thrown if another scope with the same ID has been created but not registered.
+     */
+    OntologyScope createOntologyScope(String scopeID, OntologyInputSource<?>... coreSources) throws DuplicateIDException;
+
     IRI getNamespace();
 
     void setNamespace(IRI namespace);
 
-	/**
-	 * Creates and returns a new ontology scope with the core space ontologies
-	 * obtained from <code>coreSource</code> and the custom ontologies obtained
-	 * from <code>customSource</code>.
-	 * 
-	 * @param scopeID
-	 *            the desired unique identifier for the ontology scope.
-	 * @param coreSource
-	 *            the input source that provides the top ontology for the core
-	 *            space.
-	 * @param customSource
-	 *            the input source that provides the top ontology for the custom
-	 *            space. If null, no custom space should be created at all.
-	 * @return the newly created ontology scope.
-	 * @throws DuplicateIDException
-	 *             if an ontology scope with the given identifier is already
-	 *             <i>registered</i>. The exception is not thrown if another
-	 *             scope with the same ID has been created but not registered.
-	 */
-    OntologyScope createOntologyScope(String scopeID,
-            OntologyInputSource coreSource, OntologyInputSource customSource)
-			throws DuplicateIDException;
 }

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpace.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpace.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpace.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpace.java Mon Oct 17 07:43:15 2011
@@ -16,11 +16,6 @@
  */
 package org.apache.stanbol.ontologymanager.ontonet.api.ontology;
 
-import java.util.Collection;
-import java.util.Set;
-
-import org.apache.stanbol.ontologymanager.ontonet.api.io.OntologyInputSource;
-import org.semanticweb.owlapi.model.IRI;
 import org.semanticweb.owlapi.model.OWLOntology;
 
 /**
@@ -28,134 +23,19 @@ import org.semanticweb.owlapi.model.OWLO
  * a certain user session or a specific reasoning service. Each ontology space has an ID and a top ontology
  * that can be used as a shared resource for mutual exclusion and locking strategies.
  */
-public interface OntologySpace {
-
-    /**
-     * Adds the given ontology to the ontology space.
-     * 
-     * @param ontology
-     *            the ontology to be added
-     * @throws UnmodifiableOntologySpaceException
-     *             if the ontology space is read-only
-     */
-    void addOntology(OntologyInputSource ontologySource) throws UnmodifiableOntologySpaceException;
-
-    void addOntologySpaceListener(OntologySpaceListener listener);
+public interface OntologySpace extends LockableOntologyCollector, OWLExportable {
 
     /**
      * Returns the ontology that serves as a root module for this ontology space.
      * 
+     * @deprecated Please use the inherited method {@link OWLExportable#asOWLOntology(boolean)}. Calls to the
+     *             current method are equivalent to asOWLOntology(false).
      * @return the OWL form of this ontology space.
      */
     OWLOntology asOWLOntology();
 
-    void clearOntologySpaceListeners();
-
-    boolean containsOntology(IRI ontologyIri);
-
-    /**
-     * Returns a Unique Resource Identifier (URI) that identifies this ontology space. For instance, this URI
-     * could be the parent of (some/most of) the base URIs for the ontologies within this space.<br/>
-     * <br/>
-     * A possible way to construct these IDs is by concatenating <code>/{spacetype}</code> (e.g.
-     * <code>/custom</code>) to the scope IRI. However, this is implementation-dependent.
-     * 
-     * @return the URI that identifies this ontology space
-     */
-    String getID();
-
-    /**
-     * The namespace can change dynamically (e.g. if the ontology network is relocated), so it is not part of
-     * the scope identifier (although its concatenation with the identifier will still be unique).
-     * 
-     * @param namespace
-     */
-    IRI getNamespace();
-
-    /**
-     * Returns the ontologies managed by this ontology space.
-     * 
-     * @param withClosure
-     *            if true, also the ontologies imported by those directly managed by this space will be
-     *            included.
-     * @return the set of ontologies in the ontology space
-     */
-    Set<OWLOntology> getOntologies(boolean withClosure);
-
-    /**
-     * Returns the ontology identified by the supplied <i>logical</i> IRI, if such an ontology has been loaded
-     * in this space.<br>
-     * <br>
-     * Note that ontologies are not identified by physical IRI here. There's no need to ask KReS for
-     * ontologies by physical IRI, use a browser or some other program instead!
-     * 
-     * @param ontologyIri
-     *            the <i>logical</i> identifier of the ontology to query for.
-     * 
-     * @return the requested ontology, or null if no ontology with this ID has been loaded.
-     */
-    OWLOntology getOntology(IRI ontologyIri);
-
-    Collection<OntologySpaceListener> getOntologyScopeListeners();
-
-    /**
-     * Determines if the ontology identified by the supplied <i>logical</i> IRI has been loaded in this space.<br>
-     * <br>
-     * Note that ontologies are not identified by physical IRI here. There's no need to ask KReS for
-     * ontologies by physical IRI, use a browser or some other program instead!
-     * 
-     * @param ontologyIri
-     *            the <i>logical</i> identifier of the ontology to query for.
-     * 
-     * @return true if an ontology with this ID has been loaded in this space.
-     */
-    boolean hasOntology(IRI ontologyIri);
-
-    /**
-     * Determines if it is no longer possible to modify this space until it is torn down.
-     * 
-     * @return true if this space is write-locked, false otherwise.
-     */
-    boolean isLocked();
-
     boolean isSilentMissingOntologyHandling();
 
-    /**
-     * Removes the given ontology from the ontology space, if the ontology is a direct child of the top
-     * ontology. This means that the ontology must neither be the top ontology for this space, nor a subtree
-     * of an imported ontology. This is a conservative measure to avoid using undefined entities in the space.
-     * 
-     * @param ontology
-     *            the ontology to be removed
-     * @throws UnmodifiableOntologySpaceException
-     *             if the ontology space is read-only
-     */
-    void removeOntology(OntologyInputSource src) throws OntologySpaceModificationException;
-
-    void removeOntologySpaceListener(OntologySpaceListener listener);
-
-    /**
-     * The namespace can be changed dynamically (e.g. if the ontology network is relocated).
-     * 
-     * @param namespace
-     *            Must end with a slash character. If the IRI ends with a has, and
-     *            {@link IllegalArgumentException} will be thrown. If it ends with neither, a slash will be
-     *            added.
-     */
-    void setNamespace(IRI namespace);
-
     void setSilentMissingOntologyHandling(boolean silent);
 
-    /**
-     * Bootstraps the ontology space. In some cases (such as with core and custom spaces) this also implies
-     * write-locking its ontologies.
-     */
-    void setUp();
-
-    /**
-     * Performs all required operations for disposing of an ontology space and releasing its resources (e.g.
-     * removing the writelock).
-     */
-    void tearDown();
-
 }

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpaceEvent.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpaceEvent.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpaceEvent.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpaceEvent.java Mon Oct 17 07:43:15 2011
@@ -19,7 +19,7 @@ package org.apache.stanbol.ontologymanag
 /**
  * Placeholder for a wrapper of events that affect ontology spaces.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public class OntologySpaceEvent {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpaceFactory.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpaceFactory.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpaceFactory.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/OntologySpaceFactory.java Mon Oct 17 07:43:15 2011
@@ -25,6 +25,8 @@ import org.semanticweb.owlapi.model.IRI;
  * 
  * Implementations should not call the setup method of the ontology space once it is created, so that it is
  * not locked from editing since creation time.
+ * 
+ * @author alexdma
  */
 public interface OntologySpaceFactory {
 
@@ -39,7 +41,7 @@ public interface OntologySpaceFactory {
      *            the sources of the optional ontologies to be immediately loaded upon space creation.
      * @return the generated ontology space.
      */
-    CoreOntologySpace createCoreOntologySpace(String scopeId, OntologyInputSource... coreSources);
+    CoreOntologySpace createCoreOntologySpace(String scopeId, OntologyInputSource<?>... coreSources);
 
     /**
      * Creates and sets up a default custom ontology space. Equivalent to calling
@@ -52,7 +54,7 @@ public interface OntologySpaceFactory {
      *            the sources of the optional ontologies to be immediately loaded upon space creation.
      * @return the generated ontology space.
      */
-    CustomOntologySpace createCustomOntologySpace(String scopeId, OntologyInputSource... customSources);
+    CustomOntologySpace createCustomOntologySpace(String scopeId, OntologyInputSource<?>... customSources);
 
     /**
      * Creates an ontology space of the specified type.
@@ -66,12 +68,16 @@ public interface OntologySpaceFactory {
      *            the sources of the optional ontologies to be immediately loaded upon space creation.
      * @return the generated ontology space.
      */
-    OntologySpace createOntologySpace(String scopeId, SpaceType type, OntologyInputSource... ontologySources);
+    OntologySpace createOntologySpace(String scopeId,
+                                      SpaceType type,
+                                      OntologyInputSource<?>... ontologySources);
 
     /**
      * Creates and sets up a default session ontology space. Equivalent to calling
      * <code>createOntologySpace(IRI, SpaceTypes.SESSION, OntologyInputSource...)</code>.
      * 
+     * @deprecated session spaces should no longer exist, as session data shold be loaded in Session objects.
+     * 
      * @param scopeId
      *            the unique identifier of the ontology scope that will reference this space. It can be used
      *            for generating the identifier for this ontology space.
@@ -79,7 +85,7 @@ public interface OntologySpaceFactory {
      *            the sources of the optional ontologies to be immediately loaded upon space creation.
      * @return the generated ontology space.
      */
-    SessionOntologySpace createSessionOntologySpace(String scopeId, OntologyInputSource... sessionSources);
+    SessionOntologySpace createSessionOntologySpace(String scopeId, OntologyInputSource<?>... sessionSources);
 
     IRI getNamespace();
 

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeEventListener.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeEventListener.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeEventListener.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeEventListener.java Mon Oct 17 07:43:15 2011
@@ -20,7 +20,7 @@ package org.apache.stanbol.ontologymanag
  * Objects that want to listen to the registration of ontology scopes should
  * implement this interface and add themselves as listener to a scope registry.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public interface ScopeEventListener {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeOntologyListenable.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeOntologyListenable.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeOntologyListenable.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeOntologyListenable.java Mon Oct 17 07:43:15 2011
@@ -22,7 +22,7 @@ import java.util.Collection;
  * Implementations of this interface are able to fire events related to the
  * modification of ontologies within an ontology scope.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public interface ScopeOntologyListenable {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeRegistry.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeRegistry.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeRegistry.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/ScopeRegistry.java Mon Oct 17 07:43:15 2011
@@ -24,7 +24,7 @@ import org.semanticweb.owlapi.model.IRI;
  * A registry that keeps track of the active ontology scopes in a running KReS
  * instance.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public interface ScopeRegistry {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/SessionOntologySpace.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/SessionOntologySpace.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/SessionOntologySpace.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/SessionOntologySpace.java Mon Oct 17 07:43:15 2011
@@ -1,19 +1,19 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.stanbol.ontologymanager.ontonet.api.ontology;
 
 import org.semanticweb.owlapi.model.OWLOntologyManager;
@@ -24,7 +24,10 @@ import org.semanticweb.owlapi.model.OWLO
  * <br>
  * This is the only type of ontology scope that allows public access to its OWL ontology manager.
  * 
- * @author alessandro
+ * @deprecated Session ontology spaces should no longer be created. Session data should be loaded in session
+ *             objects instead.
+ * 
+ * @author alexdma
  * 
  */
 public interface SessionOntologySpace extends OntologySpace {
@@ -36,6 +39,13 @@ public interface SessionOntologySpace ex
      */
     OWLOntologyManager getOntologyManager();
 
-    void attachSpace(OntologySpace space, boolean skipRoot) throws UnmodifiableOntologySpaceException;
+    /**
+     * @deprecated space linking is performed by the parent scope at OWL export time. Implementations do
+     *             nothing.
+     * @param space
+     * @param skipRoot
+     * @throws UnmodifiableOntologyCollectorException
+     */
+    void attachSpace(OntologySpace space, boolean skipRoot) throws UnmodifiableOntologyCollectorException;
 
 }

Copied: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/UnmodifiableOntologyCollectorException.java (from r1184794, incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/UnmodifiableOntologySpaceException.java)
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/UnmodifiableOntologyCollectorException.java?p2=incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/UnmodifiableOntologyCollectorException.java&p1=incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/UnmodifiableOntologySpaceException.java&r1=1184794&r2=1185032&rev=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/UnmodifiableOntologySpaceException.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/ontology/UnmodifiableOntologyCollectorException.java Mon Oct 17 07:43:15 2011
@@ -1,42 +1,40 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.stanbol.ontologymanager.ontonet.api.ontology;
 
 /**
- * Thrown whenever an attempt to modify the ontology network within a read-only
- * ontology space (e.g. a core or custom space in a bootstrapped system) is
- * detected and denied.
+ * Thrown whenever an attempt to modify the ontology network within a read-only ontology space (e.g. a core or
+ * custom space in a bootstrapped system) is detected and denied.
  */
-public class UnmodifiableOntologySpaceException extends
-		OntologySpaceModificationException {
+public class UnmodifiableOntologyCollectorException extends OntologyCollectorModificationException {
 
-	/**
+    /**
 	 * 
 	 */
-	private static final long serialVersionUID = 6747720213098173405L;
+    private static final long serialVersionUID = 6747720213098173405L;
 
-	/**
-	 * Creates a new instance of UnmodifiableOntologySpaceException.
-	 * 
-	 * @param space
-	 *            the ontology space whose modification was attempted.
-	 */
-	public UnmodifiableOntologySpaceException(OntologySpace space) {
-		super(space);
-	}
+    /**
+     * Creates a new instance of UnmodifiableOntologySpaceException.
+     * 
+     * @param space
+     *            the ontology space whose modification was attempted.
+     */
+    public UnmodifiableOntologyCollectorException(LockableOntologyCollector collector) {
+        super(collector);
+    }
 
 }

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/DuplicateSessionIDException.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/DuplicateSessionIDException.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/DuplicateSessionIDException.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/DuplicateSessionIDException.java Mon Oct 17 07:43:15 2011
@@ -25,7 +25,7 @@ import org.semanticweb.owlapi.model.IRI;
  * is already registered, even if it used to be associated to a session that has
  * been destroyed.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public class DuplicateSessionIDException extends DuplicateIDException {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/NonReferenceableSessionException.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/NonReferenceableSessionException.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/NonReferenceableSessionException.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/NonReferenceableSessionException.java Mon Oct 17 07:43:15 2011
@@ -20,7 +20,7 @@ package org.apache.stanbol.ontologymanag
  * Thrown whenever an attempt to access a KReS session that is bound for removal
  * is detected.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public class NonReferenceableSessionException extends Exception {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/Session.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/Session.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/Session.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/Session.java Mon Oct 17 07:43:15 2011
@@ -1,100 +1,112 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.stanbol.ontologymanager.ontonet.api.session;
 
-import org.semanticweb.owlapi.model.IRI;
+import java.util.Set;
+
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.LockableOntologyCollector;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OWLExportable;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyScope;
 
 /**
- * Note that KReS sessions are possibly disjoint with HTTP sessions or the like.
+ * Note that sessions are possibly disjoint with HTTP sessions or the like.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
-public interface Session extends SessionListenable {
+public interface Session extends LockableOntologyCollector, SessionListenable, OWLExportable {
 
-	/**
-	 * The states a KReS session can be in: ACTIVE (for running sessions),
-	 * HALTED (for inactive sessions that may later be activated, e.g. when a
-	 * user logs in), ZOMBIE (inactive and bound for destruction, no longer
-	 * referenceable).
-	 * 
-	 * @author alessandro
-	 * 
-	 */
+    /**
+     * The states a session can be in: ACTIVE (for running sessions), HALTED (for inactive sessions that may
+     * later be activated, e.g. when a user logs in), ZOMBIE (inactive and bound for destruction, no longer
+     * referenceable).
+     * 
+     * @author alexdma
+     * 
+     */
     enum State {
-		/**
-		 * Running session
-		 */
-		ACTIVE,
-		/**
-		 * inactive sessions that may later be activated
-		 */
-		HALTED,
-		/**
-		 * Inactive and bound for destruction, no longer referenceable
-		 */
-		ZOMBIE
-	}
-
-	/**
-	 * Closes this KReS Session irreversibly. Most likely includes setting the
-	 * state to ZOMBIE.
-	 */
+        /**
+         * Running session
+         */
+        ACTIVE,
+        /**
+         * inactive sessions that may later be activated
+         */
+        HALTED,
+        /**
+         * Inactive and bound for destruction, no longer referenceable
+         */
+        ZOMBIE
+    }
+
+    void attachScope(OntologyScope scope);
+
+    void detachScope(String scopeId);
+
+    void clearScopes();
+
+    Set<String> getAttachedScopes();
+
+    /**
+     * Closes this Session irreversibly. Most likely includes setting the state to ZOMBIE.
+     */
     void close() throws NonReferenceableSessionException;
 
-	/**
-	 * Returns the unique Internationalized Resource Identifier (IRI) that
-	 * identifies this KReS session.<br>
-	 * <br>
-	 * NOTE: There is no set method for the session ID as it is assumed to be
-	 * set in its constructor once and for all.
-	 * 
-	 * @return the IRI that identifies this session
-	 */
-    IRI getID();
-
-	/**
-	 * Returns the current state of this KReS session.
-	 * 
-	 * @return the state of this session
-	 */
+    /**
+     * Returns the unique Internationalized Resource Identifier (IRI) that identifies this KReS session.<br>
+     * <br>
+     * NOTE: There is no set method for the session ID as it is assumed to be set in its constructor once and
+     * for all.
+     * 
+     * @return the IRI that identifies this session
+     */
+    String getID();
+
+    /**
+     * Returns the current state of this KReS session.
+     * 
+     * @return the state of this session
+     */
     State getSessionState();
 
-	/**
-	 * Equivalent to <code>getState() == State.ACTIVE</code>.
-	 * 
-	 * @return true iff this session is in the ACTIVE state
-	 */
+    /**
+     * Equivalent to <code>getState() == State.ACTIVE</code>.
+     * 
+     * @return true iff this session is in the ACTIVE state
+     */
     boolean isActive();
-	
-	void open() throws NonReferenceableSessionException;
 
-	/**
-	 * Sets the KReS session as ACTIVE if <code>active</code> is true, INACTIVE
-	 * otherwise. The state set is returned, which should match the input state
-	 * unless an error occurs.<br>
-	 * <br>
-	 * Should throw an exception if this session is in a ZOMBIE state.
-	 * 
-	 * @param active
-	 *            the desired activity state for this session
-	 * @return the resulting state of this KReS session
-	 */
-    State setActive(boolean active)
-			throws NonReferenceableSessionException;
+    /**
+     * Sets this session as active
+     * 
+     * @throws NonReferenceableSessionException
+     */
+    void open() throws NonReferenceableSessionException;
+
+    /**
+     * Sets the KReS session as ACTIVE if <code>active</code> is true, INACTIVE otherwise. The state set is
+     * returned, which should match the input state unless an error occurs.<br>
+     * <br>
+     * Should throw an exception if this session is in a ZOMBIE state.
+     * 
+     * @param active
+     *            the desired activity state for this session
+     * @return the resulting state of this KReS session
+     */
+    State setActive(boolean active) throws NonReferenceableSessionException;
 
 }

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionEvent.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionEvent.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionEvent.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionEvent.java Mon Oct 17 07:43:15 2011
@@ -19,7 +19,7 @@ package org.apache.stanbol.ontologymanag
 /**
  * An event that encompasses a change in the state of a KReS session.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public class SessionEvent {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionIDGenerator.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionIDGenerator.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionIDGenerator.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionIDGenerator.java Mon Oct 17 07:43:15 2011
@@ -25,7 +25,7 @@ import org.semanticweb.owlapi.model.IRI;
  * identifiers for KReS sessions. These algorithms should take into account the
  * need for excluding existing session IDs.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public interface SessionIDGenerator {
@@ -37,7 +37,7 @@ public interface SessionIDGenerator {
 	 * 
 	 * @return the newly generated session ID.
 	 */
-    IRI createSessionID();
+    String createSessionID();
 
 	/**
 	 * Generates a new session ID that is different from any IRI in the
@@ -50,7 +50,7 @@ public interface SessionIDGenerator {
 	 *            to.
 	 * @return the newly generated session ID.
 	 */
-    IRI createSessionID(Set<IRI> exclude);
+    String createSessionID(Set<String> exclude);
 
 	/**
 	 * Returns the base IRI for all generated IDs to start with. It should be

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionListener.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionListener.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionListener.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionListener.java Mon Oct 17 07:43:15 2011
@@ -20,7 +20,7 @@ package org.apache.stanbol.ontologymanag
  * Objects that want to listen to events affecting KReS sessions should
  * implement this interface and add themselves as listener to a manager.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public interface SessionListener {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionManager.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionManager.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionManager.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/session/SessionManager.java Mon Oct 17 07:43:15 2011
@@ -1,106 +1,95 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements.  See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License.  You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.stanbol.ontologymanager.ontonet.api.session;
 
 import java.io.OutputStream;
 import java.util.Set;
 
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.SessionOntologySpace;
-import org.semanticweb.owlapi.model.IRI;
 import org.semanticweb.owlapi.model.OWLOntologyStorageException;
 
-
 /**
- * Manages KReS session objects via CRUD-like operations. A
- * <code>SessionManager</code> maintains in-memory storage of KReS sessions,
- * creates new ones and either destroys or stores existing ones persistently.
- * All KReS sessions are managed via unique identifiers of the
- * <code>org.semanticweb.owlapi.model.IRI</code> type.<br>
+ * Manages KReS session objects via CRUD-like operations. A <code>SessionManager</code> maintains in-memory
+ * storage of KReS sessions, creates new ones and either destroys or stores existing ones persistently. All
+ * KReS sessions are managed via unique identifiers of the <code>org.semanticweb.owlapi.model.IRI</code> type.<br>
  * <br>
- * NOTE: implementations should be synchronized, or document whenever they are
- * not.
+ * NOTE: implementations should be synchronized, or document whenever they are not.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public interface SessionManager extends SessionListenable {
 
-	Set<IRI> getRegisteredSessionIDs();
+    Set<String> getRegisteredSessionIDs();
 
-	/**
-	 * Generates AND REGISTERS a new KReS session and assigns a unique session
-	 * ID generated internally.
-	 * 
-	 * @return the generated KReS session
-	 */
+    /**
+     * Generates AND REGISTERS a new KReS session and assigns a unique session ID generated internally.
+     * 
+     * @return the generated KReS session
+     */
     Session createSession();
 
-	/**
-	 * Generates AND REGISTERS a new KReS session and tries to assign it the
-	 * supplied session ID. If a session with that ID is already registered, the
-	 * new session is <i>not</i> created and a
-	 * <code>DuplicateSessionIDException</code> is thrown.
-	 * 
-	 * @param sessionID
-	 *            the IRI that uniquely identifies the session
-	 * @return the generated KReS session
-	 * @throws DuplicateSessionIDException
-	 *             if a KReS session with that sessionID is already registered
-	 */
-    Session createSession(IRI sessionID)
-			throws DuplicateSessionIDException;
-
-	/**
-	 * Deletes the KReS session identified by the supplied sessionID and
-	 * releases its resources.
-	 * 
-	 * @param sessionID
-	 *            the IRI that uniquely identifies the session
-	 */
-    void destroySession(IRI sessionID);
-
-	/**
-	 * Retrieves the unique KReS session identified by <code>sessionID</code>.
-	 * 
-	 * @param sessionID
-	 *            the IRI that uniquely identifies the session
-	 * @return the unique KReS session identified by <code>sessionID</code>
-	 */
-    Session getSession(IRI sessionID);
-
-	/**
-	 * Returns the ontology space associated with this session.
-	 * 
-	 * @return the session space
-	 */
-    Set<SessionOntologySpace> getSessionSpaces(IRI sessionID)
-			throws NonReferenceableSessionException;
-
-	/**
-	 * Stores the KReS session identified by <code>sessionID</code> using the
-	 * output stream <code>out</code>.
-	 * 
-	 * @param sessionID
-	 *            the IRI that uniquely identifies the session
-	 * @param out
-	 *            the output stream to store the session
-	 * @throws OWLOntologyStorageException 
-	 */
-    void storeSession(IRI sessionID, OutputStream out)
-			throws NonReferenceableSessionException, OWLOntologyStorageException;
+    /**
+     * Generates AND REGISTERS a new KReS session and tries to assign it the supplied session ID. If a session
+     * with that ID is already registered, the new session is <i>not</i> created and a
+     * <code>DuplicateSessionIDException</code> is thrown.
+     * 
+     * @param sessionID
+     *            the IRI that uniquely identifies the session
+     * @return the generated KReS session
+     * @throws DuplicateSessionIDException
+     *             if a KReS session with that sessionID is already registered
+     */
+    Session createSession(String sessionID) throws DuplicateSessionIDException;
+
+    /**
+     * Deletes the KReS session identified by the supplied sessionID and releases its resources.
+     * 
+     * @param sessionID
+     *            the IRI that uniquely identifies the session
+     */
+    void destroySession(String sessionID);
+
+    /**
+     * Retrieves the unique KReS session identified by <code>sessionID</code>.
+     * 
+     * @param sessionID
+     *            the IRI that uniquely identifies the session
+     * @return the unique KReS session identified by <code>sessionID</code>
+     */
+    Session getSession(String sessionID);
+
+    /**
+     * Returns the ontology space associated with this session.
+     * 
+     * @return the session space
+     */
+    Set<SessionOntologySpace> getSessionSpaces(String sessionID) throws NonReferenceableSessionException;
+
+    /**
+     * Stores the KReS session identified by <code>sessionID</code> using the output stream <code>out</code>.
+     * 
+     * @param sessionID
+     *            the IRI that uniquely identifies the session
+     * @param out
+     *            the output stream to store the session
+     * @throws OWLOntologyStorageException
+     */
+    void storeSession(String sessionID, OutputStream out) throws NonReferenceableSessionException,
+                                                         OWLOntologyStorageException;
 
 }

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/conf/OntologyNetworkConfigurationUtils.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/conf/OntologyNetworkConfigurationUtils.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/conf/OntologyNetworkConfigurationUtils.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/conf/OntologyNetworkConfigurationUtils.java Mon Oct 17 07:43:15 2011
@@ -67,7 +67,7 @@ import org.semanticweb.owlapi.model.OWLO
  * relate a library to an ontology</li>
  * </ul>
  * 
- * @author alessandro
+ * @author alexdma
  * @author enridaga
  */
 public class OntologyNetworkConfigurationUtils {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ONManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ONManagerImpl.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ONManagerImpl.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ONManagerImpl.java Mon Oct 17 07:43:15 2011
@@ -49,7 +49,7 @@ import org.apache.stanbol.ontologymanage
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologySpace;
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologySpaceFactory;
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.ScopeRegistry;
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.UnmodifiableOntologySpaceException;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.UnmodifiableOntologyCollectorException;
 import org.apache.stanbol.ontologymanager.ontonet.api.session.SessionManager;
 import org.apache.stanbol.ontologymanager.ontonet.conf.OntologyNetworkConfigurationUtils;
 import org.apache.stanbol.ontologymanager.ontonet.impl.io.ClerezzaOntologyStorage;
@@ -109,7 +109,7 @@ public class ONManagerImpl implements ON
                 try {
                     scope.getCustomSpace().addOntology(createOntologyInputSource(locationIri));
                     log.debug("Added " + locationIri + " to scope " + scopeID + " in the custom space.", this);
-                } catch (UnmodifiableOntologySpaceException e) {
+                } catch (UnmodifiableOntologyCollectorException e) {
                     log.error("An error occurred while trying to add the ontology from location: "
                               + locationIri, e);
                 }
@@ -359,7 +359,7 @@ public class ONManagerImpl implements ON
             bootstrapOntologyNetwork(oConf);
 
         }
-        log.debug("ONManager activated.");
+        log.debug(ONManager.class + "activated.");
 
     }
 

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/io/ClerezzaOntologyStorage.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/io/ClerezzaOntologyStorage.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/io/ClerezzaOntologyStorage.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/io/ClerezzaOntologyStorage.java Mon Oct 17 07:43:15 2011
@@ -181,7 +181,7 @@ public class ClerezzaOntologyStorage {
         // MGraph mg = JenaToClerezzaConverter.jenaModelToClerezzaMGraph(om);
         TripleCollection mg = OWLAPIToClerezzaConverter.owlOntologyToClerezzaMGraph(o);
         MGraph mg2 = null;
-        IRI iri = OWLUtils.getIdentifyingIRI(o);
+        IRI iri = OWLUtils.guessOntologyIdentifier(o);
         UriRef ref = new UriRef(iri.toString());
         try {
             mg2 = tcManager.createMGraph(ref);

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/io/InMemoryOntologyStorage.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/io/InMemoryOntologyStorage.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/io/InMemoryOntologyStorage.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/io/InMemoryOntologyStorage.java Mon Oct 17 07:43:15 2011
@@ -28,7 +28,7 @@ import org.semanticweb.owlapi.model.OWLO
  * A hack that stores ontologies in volatile memory (e.g. for unit tests) but prevents the incessant logging
  * of related error messages.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public class InMemoryOntologyStorage extends ClerezzaOntologyStorage {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/AbstractOntologySpaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/AbstractOntologySpaceImpl.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/AbstractOntologySpaceImpl.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/AbstractOntologySpaceImpl.java Mon Oct 17 07:43:15 2011
@@ -26,17 +26,20 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.stanbol.ontologymanager.ontonet.api.io.OntologyInputSource;
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.MissingOntologyException;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OWLExportable;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyCollectorListener;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyCollectorModificationException;
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologySpace;
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologySpaceListener;
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologySpaceModificationException;
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.SessionOntologySpace;
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.SpaceType;
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.UnmodifiableOntologySpaceException;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.UnmodifiableOntologyCollectorException;
 import org.apache.stanbol.ontologymanager.ontonet.impl.io.ClerezzaOntologyStorage;
 import org.apache.stanbol.owl.util.OWLUtils;
 import org.apache.stanbol.owl.util.URIUtils;
 import org.semanticweb.owlapi.apibinding.OWLManager;
+import org.semanticweb.owlapi.io.OWLOntologyDocumentTarget;
+import org.semanticweb.owlapi.io.StringDocumentSource;
+import org.semanticweb.owlapi.io.StringDocumentTarget;
 import org.semanticweb.owlapi.model.AddImport;
 import org.semanticweb.owlapi.model.IRI;
 import org.semanticweb.owlapi.model.OWLDataFactory;
@@ -44,7 +47,9 @@ import org.semanticweb.owlapi.model.OWLO
 import org.semanticweb.owlapi.model.OWLOntologyAlreadyExistsException;
 import org.semanticweb.owlapi.model.OWLOntologyChange;
 import org.semanticweb.owlapi.model.OWLOntologyCreationException;
+import org.semanticweb.owlapi.model.OWLOntologyDocumentAlreadyExistsException;
 import org.semanticweb.owlapi.model.OWLOntologyManager;
+import org.semanticweb.owlapi.model.OWLOntologyStorageException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -60,7 +65,7 @@ public abstract class AbstractOntologySp
 
     protected String _id = null;
 
-    private Set<OntologySpaceListener> listeners = new HashSet<OntologySpaceListener>();
+    private Set<OntologyCollectorListener> listeners = new HashSet<OntologyCollectorListener>();
 
     /**
      * Indicates whether this ontology space is marked as read-only. Default value is false.
@@ -87,6 +92,8 @@ public abstract class AbstractOntologySp
 
     protected ClerezzaOntologyStorage storage;
 
+    protected Set<Class<?>> supportedTypes;
+
     protected SpaceType type;
 
     protected AbstractOntologySpaceImpl(String spaceID,
@@ -109,6 +116,10 @@ public abstract class AbstractOntologySp
                                         SpaceType type,
                                         ClerezzaOntologyStorage storage,
                                         OWLOntologyManager ontologyManager) {
+
+        supportedTypes = new HashSet<Class<?>>();
+        supportedTypes.add(OWLOntology.class);
+
         setID(spaceID);
         setNamespace(namespace);
         this.type = type;
@@ -120,27 +131,43 @@ public abstract class AbstractOntologySp
     }
 
     @Override
-    public synchronized void addOntology(OntologyInputSource ontologySource) throws UnmodifiableOntologySpaceException {
-        if (locked) throw new UnmodifiableOntologySpaceException(this);
+    public synchronized void addOntology(OntologyInputSource<?> ontologySource) throws UnmodifiableOntologyCollectorException {
+        if (locked) throw new UnmodifiableOntologyCollectorException(this);
         log.debug("Trying to add ontology {} to space {}",
             ontologySource != null ? ontologySource.getRootOntology() : "<NULL>", getNamespace() + getID());
-        // Avoid adding the space top ontology itself.
+        OWLOntology o = null;
         if (ontologySource != null && ontologySource.hasRootOntology()) {
-            OWLOntology o = ontologySource.getRootOntology();
-            if (!o.isAnonymous() && getID().equals(o.getOntologyID().getOntologyIRI())) throw new IllegalArgumentException(
-                    "Cannot add a space's own ontology to itself.");
-            else performAdd(ontologySource);
-            // Remember that this method also fires the event
-        }
+            Object r = ontologySource.getRootOntology();
+            if (r instanceof OWLOntology) {
+                o = (OWLOntology) r;
+                // Avoid adding the space top ontology itself.
+                if (!o.isAnonymous() && getID().equals(o.getOntologyID().getOntologyIRI())) throw new IllegalArgumentException(
+                        "Cannot add a space's own ontology to itself.");
+                else performAdd(ontologySource);
+                // Remember that performAdd() also fires the event
+            } else throw new UnsupportedOperationException(
+                    "This ontology space implementation can only handle " + OWLOntology.class
+                            + " input sources.");
+        } else return; // No ontology to add
     }
 
     @Override
-    public void addOntologySpaceListener(OntologySpaceListener listener) {
+    public void addListener(OntologyCollectorListener listener) {
         listeners.add(listener);
     }
 
     @Override
     public OWLOntology asOWLOntology() {
+        return this.asOWLOntology(false);
+    }
+
+    /**
+     * FIXME not merging yet
+     * 
+     * @see OWLExportable#asOWLOntology(boolean)
+     */
+    @Override
+    public OWLOntology asOWLOntology(boolean merge) {
         OWLOntology root;
         IRI iri = IRI.create(namespace + _id);
         try {
@@ -191,15 +218,10 @@ public abstract class AbstractOntologySp
     }
 
     @Override
-    public void clearOntologySpaceListeners() {
+    public void clearListeners() {
         listeners.clear();
     }
 
-    @Override
-    public boolean containsOntology(IRI ontologyIri) {
-        return ontologyManager.contains(ontologyIri);
-    }
-
     /**
      * Notifies all ontology space listeners that an ontology has been added to this space.
      * 
@@ -207,7 +229,7 @@ public abstract class AbstractOntologySp
      *            the identifier of the ontology that was added to this space.
      */
     protected void fireOntologyAdded(IRI ontologyIri) {
-        for (OntologySpaceListener listener : listeners)
+        for (OntologyCollectorListener listener : listeners)
             listener.onOntologyAdded(IRI.create(namespace + _id), ontologyIri);
     }
 
@@ -218,7 +240,7 @@ public abstract class AbstractOntologySp
      *            the identifier of the ontology that was removed from this space.
      */
     protected void fireOntologyRemoved(IRI ontologyIri) {
-        for (OntologySpaceListener listener : listeners)
+        for (OntologyCollectorListener listener : listeners)
             listener.onOntologyRemoved(IRI.create(namespace + _id), ontologyIri);
     }
 
@@ -234,28 +256,34 @@ public abstract class AbstractOntologySp
 
     @Override
     public synchronized Set<OWLOntology> getOntologies(boolean withClosure) {
-        return withClosure ? ontologyManager.getOntologies() : new HashSet<OWLOntology>(managedOntologies.values());
+        return withClosure ? ontologyManager.getOntologies() : new HashSet<OWLOntology>(
+                managedOntologies.values());
     }
 
     @Override
     public OWLOntology getOntology(IRI ontologyIri) {
         log.debug("Requesting ontology {} from space {}", ontologyIri, getNamespace() + getID());
         OWLOntology o = managedOntologies.get(ontologyIri);
-//        Iterator<OWLOntology> it = managedOntologies.iterator();
-//        while (it.hasNext() && o == null) {
-//            OWLOntology temp = it.next();
-//            if (!temp.isAnonymous() && ontologyIri.equals(temp.getOntologyID().getOntologyIRI())) o = temp;
-//        }
-//        if (o == null) o = ontologyManager.getOntology(ontologyIri);
+        // Iterator<OWLOntology> it = managedOntologies.iterator();
+        // while (it.hasNext() && o == null) {
+        // OWLOntology temp = it.next();
+        // if (!temp.isAnonymous() && ontologyIri.equals(temp.getOntologyID().getOntologyIRI())) o = temp;
+        // }
+        // if (o == null) o = ontologyManager.getOntology(ontologyIri);
         return o;
     }
 
     @Override
-    public Collection<OntologySpaceListener> getOntologyScopeListeners() {
+    public Collection<OntologyCollectorListener> getListeners() {
         return listeners;
     }
 
     @Override
+    public Set<Class<?>> getSupportedTypes() {
+        return Collections.unmodifiableSet(supportedTypes);
+    }
+
+    @Override
     public boolean hasOntology(IRI ontologyIri) {
         return this.getOntology(ontologyIri) != null;
     }
@@ -270,15 +298,17 @@ public abstract class AbstractOntologySp
         return silent;
     }
 
-    private void performAdd(OntologyInputSource ontSrc) {
+    private void performAdd(OntologyInputSource<?> ontSrc) {
 
-        OWLOntology ontology = ontSrc.getRootOntology();
+        Object obj = ontSrc.getRootOntology();
+        OWLOntology ontology = (OWLOntology) obj;
 
         // Should not modify the child ontology in any way.
         // TODO implement transaction control.
         // See to it that the ontology is copied to this manager.
-        OWLOntology newOnt = reload(ontology, ontologyManager, true, false);
-        managedOntologies.put(OWLUtils.getIdentifyingIRI(newOnt),newOnt);
+        OWLOntology newOnt = reload((OWLOntology) ontology, ontologyManager, true, false);
+        // if (newOnt!=null)
+        managedOntologies.put(OWLUtils.guessOntologyIdentifier(newOnt), newOnt);
 
         try {
             // Store the top ontology
@@ -296,8 +326,32 @@ public abstract class AbstractOntologySp
                      + " . Ontology management will be volatile.", ex);
         }
 
-        fireOntologyAdded(OWLUtils.getIdentifyingIRI(ontology));
+        fireOntologyAdded(OWLUtils.guessOntologyIdentifier(ontology));
+
+    }
+
+    protected OWLOntology reload(OWLOntology ontology, OWLOntologyManager mgr, boolean withClosure) {
+        if (ontology == null) throw new IllegalArgumentException("ontology cannot be null");
+        if (ontology.getOWLOntologyManager() == ontologyManager) {
+            log.warn("Ontology {} is already managed by the supplied OWLOntologyManager. Skipping copy.",
+                ontology);
+            return ontology;
+        }
+
+        OWLOntology newOnt = null;
+        OWLOntologyDocumentTarget tgt = new StringDocumentTarget();
+        try {
+            ontology.getOWLOntologyManager().saveOntology(ontology, tgt);
+
+            newOnt = ontologyManager
+                    .loadOntologyFromOntologyDocument(new StringDocumentSource(tgt.toString()));
+        } catch (OWLOntologyStorageException e) {
+            log.error("Failed to re-serialize ontology.", e);
+        } catch (OWLOntologyCreationException e) {
+            log.error("Failed to deserialize ontology.", e);
+        }
 
+        return newOnt;
     }
 
     /**
@@ -331,7 +385,7 @@ public abstract class AbstractOntologySp
         OWLOntology root = null;
 
         IRI location = ontology.getOWLOntologyManager().getOntologyDocumentIRI(ontology);
-        IRI idd = OWLUtils.getIdentifyingIRI(ontology);
+        IRI idd = OWLUtils.guessOntologyIdentifier(ontology);
         if (mgr == null) mgr = ontologyManager;
         Set<OWLOntology> closure = withClosure ? ontology.getOWLOntologyManager().getImportsClosure(ontology)
                 : Collections.singleton(ontology);
@@ -347,16 +401,21 @@ public abstract class AbstractOntologySp
         else {
 
             for (OWLOntology o : closure) {
-                IRI id2 = OWLUtils.getIdentifyingIRI(o);
+                // System.out.println("In closure of " + ontology + " : " + o);
+                IRI id2 = OWLUtils.guessOntologyIdentifier(o);
                 // OWLOntologyID id = o.getOntologyID();
                 if (mgr.contains(id2)) {
+                    // System.out.println("REMOVING " + id2);
                     mgr.removeOntology(mgr.getOntology(id2));
                 }
                 try {
                     OWLOntology o1 = mgr.createOntology(id2, Collections.singleton(o));
+
+                    // System.out.println("DIO BASTARDO " + o1);
                     mgr.setOntologyDocumentIRI(o1, location);
                     if (idd.equals(id2)) root = o1;
                 } catch (OWLOntologyAlreadyExistsException e) {
+                    // System.out.println("ARIFAMO " + e.getOntologyID());
                     if (o.getOWLOntologyManager() != mgr) {
                         mgr.removeOntology(o);
                         try {
@@ -369,10 +428,26 @@ public abstract class AbstractOntologySp
                                         + ontology.getOntologyID() + " across managers", e1);
                         }
                     }
+                } catch (OWLOntologyDocumentAlreadyExistsException e) {
+                    // System.out.println("RIRIFAMO " + e.getOntologyDocumentIRI());
+                    if (o.getOWLOntologyManager() != mgr) {
 
+                        OWLOntology oRemove = mgr.getOntology(e.getOntologyDocumentIRI());
+                        // System.out.println("LEVIAMO " + oRemove);
+                        mgr.removeOntology(oRemove);
+                        try {
+                            OWLOntology o1 = mgr.createOntology(id2, Collections.singleton(o));
+                            mgr.setOntologyDocumentIRI(o1, location);
+                            if (idd.equals(id2)) root = o1;
+                        } catch (OWLOntologyCreationException e1) {
+                            log.error(
+                                "Unexpected exception caught while copying ontology "
+                                        + ontology.getOntologyID() + " across managers", e1);
+                        }
+                    }
                 } catch (OWLOntologyCreationException e) {
-                    log.warn("Failed to re-create ontology {} for ontology space {} . Continuing...", id2,
-                        getID());
+                    log.warn("Failed to re-create ontology " + id2 + " for ontology space " + getID()
+                             + " . Continuing...", e);
                 }
             }
             return root;
@@ -380,45 +455,52 @@ public abstract class AbstractOntologySp
         return root;
     }
 
-    /**
-     * TODO 1 : optimize addition/removal <br>
-     * TODO 2 : set import statements
-     */
     @Override
-    public synchronized void removeOntology(OntologyInputSource src) throws OntologySpaceModificationException {
-        if (locked) throw new UnmodifiableOntologySpaceException(this);
+    public synchronized void removeOntology(IRI ontologyId) throws OntologyCollectorModificationException {
+        if (locked) throw new UnmodifiableOntologyCollectorException(this);
 
-        if (src != null && src.hasRootOntology()) {
-            OWLOntology o = src.getRootOntology();
-            if (!o.isAnonymous() && getID().equals(o.getOntologyID().getOntologyIRI())) throw new IllegalArgumentException(
-                    "Cannot remove a space's own ontology form.");
-        }
+        // OWLOntology o = null;
+        //
+        // if (src != null && src.hasRootOntology()) {
+        // Object r = src.getRootOntology();
+        // if (r instanceof OWLOntology) {
+        // o = (OWLOntology) r;
+        // if (!o.isAnonymous() && getID().equals(o.getOntologyID().getOntologyIRI())) throw new
+        // IllegalArgumentException(
+        // "Cannot remove a space's own ontology form.");
+        // } else throw new UnsupportedOperationException(
+        // "This ontology space implementation can only handle " + OWLOntology.class
+        // + " input sources.");
+        // } else return; // No ontology to remove
+        //
+        // // o should no longer be null here.
+        //
+        // // TODO : find a way to remove anonymous ontologies.
+        // IRI logicalID = null, physicalIRI = null;
+        // try {
+        // logicalID = o.getOntologyID().getOntologyIRI();
+        // physicalIRI = src.getPhysicalIRI();
+        // if (physicalIRI == null) if (isSilentMissingOntologyHandling()) return;
+        // else throw new MissingOntologyException(this, null);
+        // if (logicalID == null) logicalID = physicalIRI;
+        // } catch (RuntimeException ex) {
+        // if (isSilentMissingOntologyHandling()) return;
+        // else throw new MissingOntologyException(this, null);
+        // }
 
-        // TODO : find a way to remove anonymous ontologies.
-        OWLOntology o = src.getRootOntology();
-        IRI logicalID = null, physicalIRI = null;
         try {
-            logicalID = o.getOntologyID().getOntologyIRI();
-            physicalIRI = src.getPhysicalIRI();
-            if (physicalIRI == null) if (isSilentMissingOntologyHandling()) return;
-            else throw new MissingOntologyException(this, null);
-            if (logicalID == null) logicalID = physicalIRI;
-        } catch (RuntimeException ex) {
-            if (isSilentMissingOntologyHandling()) return;
-            else throw new MissingOntologyException(this, null);
-        }
 
-        try {
-            ontologyManager.removeOntology(o);
-            fireOntologyRemoved(logicalID);
+            ontologyManager.removeOntology(ontologyManager.getOntology(ontologyId));
+            managedOntologies.remove(ontologyId);
+            fireOntologyRemoved(ontologyId);
         } catch (RuntimeException ex) {
-            throw new OntologySpaceModificationException(this, ex);
+            throw new OntologyCollectorModificationException(this, ex);
         }
 
     }
 
     @Override
-    public void removeOntologySpaceListener(OntologySpaceListener listener) {
+    public void removeListener(OntologyCollectorListener listener) {
         listeners.remove(listener);
     }
 

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/CoreOntologySpaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/CoreOntologySpaceImpl.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/CoreOntologySpaceImpl.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/CoreOntologySpaceImpl.java Mon Oct 17 07:43:15 2011
@@ -24,6 +24,8 @@ import org.semanticweb.owlapi.model.OWLO
 
 /**
  * Default implementation of the core ontology space.
+ * 
+ * @author alexdma
  */
 public class CoreOntologySpaceImpl extends AbstractOntologySpaceImpl implements CoreOntologySpace {
 

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/CustomOntologySpaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/CustomOntologySpaceImpl.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/CustomOntologySpaceImpl.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/CustomOntologySpaceImpl.java Mon Oct 17 07:43:15 2011
@@ -19,7 +19,7 @@ package org.apache.stanbol.ontologymanag
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.CoreOntologySpace;
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.CustomOntologySpace;
 import org.apache.stanbol.ontologymanager.ontonet.api.ontology.SpaceType;
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.UnmodifiableOntologySpaceException;
+import org.apache.stanbol.ontologymanager.ontonet.api.ontology.UnmodifiableOntologyCollectorException;
 import org.apache.stanbol.ontologymanager.ontonet.impl.io.ClerezzaOntologyStorage;
 import org.semanticweb.owlapi.model.IRI;
 import org.semanticweb.owlapi.model.OWLOntologyManager;
@@ -47,7 +47,7 @@ public class CustomOntologySpaceImpl ext
     }
 
     @Override
-    public void attachCoreSpace(CoreOntologySpace coreSpace, boolean skipRoot) throws UnmodifiableOntologySpaceException {
+    public void attachCoreSpace(CoreOntologySpace coreSpace, boolean skipRoot) throws UnmodifiableOntologyCollectorException {
         // FIXME re-implement!
         // OWLOntology o = coreSpace.getTopOntology();
         // // This does the append thingy

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/OWLOntologyManagerFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/OWLOntologyManagerFactoryImpl.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/OWLOntologyManagerFactoryImpl.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/OWLOntologyManagerFactoryImpl.java Mon Oct 17 07:43:15 2011
@@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
 
 /**
  * 
- * @author alessandro
+ * @author alexdma
  * @deprecated use the static methods of {@link org.apache.stanbol.owl.OWLOntologyManagerFactory} instead.
  */
 public class OWLOntologyManagerFactoryImpl implements OWLOntologyManagerFactory {

Modified: incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/OntologyScopeFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/OntologyScopeFactoryImpl.java?rev=1185032&r1=1185031&r2=1185032&view=diff
==============================================================================
--- incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/OntologyScopeFactoryImpl.java (original)
+++ incubator/stanbol/trunk/ontologymanager/ontonet/src/main/java/org/apache/stanbol/ontologymanager/ontonet/impl/ontology/OntologyScopeFactoryImpl.java Mon Oct 17 07:43:15 2011
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
 /**
  * Utility class that instantiates default implementations of ontology scope.
  * 
- * @author alessandro
+ * @author alexdma
  * 
  */
 public class OntologyScopeFactoryImpl implements OntologyScopeFactory {
@@ -69,20 +69,18 @@ public class OntologyScopeFactoryImpl im
         listeners.clear();
     }
 
-    @Override
-    public OntologyScope createOntologyScope(String scopeID, OntologyInputSource coreSource) throws DuplicateIDException {
-        return createOntologyScope(scopeID, coreSource, null);
-    }
+    // @Override
+    // public OntologyScope createOntologyScope(String scopeID, OntologyInputSource coreSource) throws
+    // DuplicateIDException {
+    // return createOntologyScope(scopeID, coreSource, null);
+    // }
 
     @Override
-    public OntologyScope createOntologyScope(String scopeID,
-                                             OntologyInputSource coreSource,
-                                             OntologyInputSource customSource) throws DuplicateIDException {
+    public OntologyScope createOntologyScope(String scopeID, OntologyInputSource... coreSources) throws DuplicateIDException {
 
         if (registry.containsScope(scopeID)) throw new DuplicateIDException(scopeID,
                 "Scope registry already contains ontology scope with ID " + scopeID);
-        OntologyScope scope = new OntologyScopeImpl(scopeID, getNamespace(), spaceFactory, coreSource,
-                customSource);
+        OntologyScope scope = new OntologyScopeImpl(scopeID, getNamespace(), spaceFactory, coreSources);
         // scope.addOntologyScopeListener(ONManager.get().getOntologyIndex());
         // TODO : manage scopes with null core ontologies
         fireScopeCreated(scope);