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 2012/10/05 17:35:30 UTC

svn commit: r1394594 [7/9] - in /stanbol/trunk: commons/authentication.basic/ commons/security/ contrib/reengineer/base/ contrib/reengineer/db/ contrib/reengineer/db/src/main/java/org/apache/stanbol/reengineer/db/ contrib/reengineer/db/src/test/java/or...

Added: stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/test1.owl
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/test1.owl?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/test1.owl (added)
+++ stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/test1.owl Fri Oct  5 15:35:22 2012
@@ -0,0 +1,359 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+]>
+
+
+<rdf:RDF xmlns="http://stanbol.apache.org/ontologies/test1.owl#"
+     xml:base="http://stanbol.apache.org/ontologies/test1.owl"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+
+
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    <owl:AnnotationProperty rdf:about="&rdfs;label"/>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Datatypes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Object Properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+ 
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#aboutFiction -->
+
+    <owl:ObjectProperty rdf:about="http://stanbol.apache.org/ontologies/test1.owl#aboutFiction">
+        <rdfs:label xml:lang="en">aboutFiction</rdfs:label>
+        <rdfs:range rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#ComicWhale"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#friend -->
+
+    <owl:ObjectProperty rdf:about="http://stanbol.apache.org/ontologies/test1.owl#friend">
+        <rdf:type rdf:resource="&owl;SymmetricProperty"/>
+        <rdfs:label xml:lang="en">friend</rdfs:label>
+        <rdfs:subPropertyOf rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#knows"/>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#knows -->
+
+    <owl:ObjectProperty rdf:about="http://stanbol.apache.org/ontologies/test1.owl#knows">
+        <rdf:type rdf:resource="&owl;TransitiveProperty"/>
+        <rdfs:label xml:lang="en">knows</rdfs:label>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#livesIn -->
+
+    <owl:ObjectProperty rdf:about="http://stanbol.apache.org/ontologies/test1.owl#livesIn">
+        <rdfs:label xml:lang="en">livesIn</rdfs:label>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#sellsTo -->
+
+    <owl:ObjectProperty rdf:about="http://stanbol.apache.org/ontologies/test1.owl#sellsTo">
+        <rdfs:label xml:lang="en">sells to</rdfs:label>
+        <rdfs:label xml:lang="it">vende a</rdfs:label>
+    </owl:ObjectProperty>
+    
+
+
+    <!-- http://www.w3.org/2002/07/owl#topObjectProperty -->
+
+    <owl:ObjectProperty rdf:about="&owl;topObjectProperty"/>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Data properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#longInMeters -->
+
+    <owl:DatatypeProperty rdf:about="http://stanbol.apache.org/ontologies/test1.owl#longInMeters">
+        <rdf:type rdf:resource="&owl;FunctionalProperty"/>
+        <rdfs:label xml:lang="en">longInMeters</rdfs:label>
+        <rdfs:range rdf:resource="&xsd;int"/>
+    </owl:DatatypeProperty>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#AquaticMammal -->
+
+    <owl:Class rdf:about="http://stanbol.apache.org/ontologies/test1.owl#AquaticMammal">
+        <rdfs:label>AquaticMammal</rdfs:label>
+        <owl:equivalentClass>
+            <owl:Class>
+                <owl:intersectionOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://stanbol.apache.org/ontologies/test1.owl#AquaticOrganism"/>
+                    <rdf:Description rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Mammal"/>
+                </owl:intersectionOf>
+            </owl:Class>
+        </owl:equivalentClass>
+    </owl:Class>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#AquaticOrganism -->
+
+    <owl:Class rdf:about="http://stanbol.apache.org/ontologies/test1.owl#AquaticOrganism">
+        <rdfs:label>AquaticOrganism</rdfs:label>
+        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
+    </owl:Class>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#ComicWhale -->
+
+    <owl:Class rdf:about="http://stanbol.apache.org/ontologies/test1.owl#ComicWhale">
+        <rdfs:label xml:lang="en">Comic whale</rdfs:label>
+        <owl:equivalentClass>
+            <owl:Class>
+                <owl:oneOf rdf:parseType="Collection">
+                    <rdf:Description rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Porpy"/>
+                    <rdf:Description rdf:about="http://stanbol.apache.org/ontologies/test1.owl#MobyDick"/>
+                </owl:oneOf>
+            </owl:Class>
+        </owl:equivalentClass>
+        <rdfs:subClassOf rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#Whale"/>
+    </owl:Class>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#Crustacean -->
+
+    <owl:Class rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Crustacean">
+        <rdfs:label>Crustacean</rdfs:label>
+    </owl:Class>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#Fish -->
+
+    <owl:Class rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Fish">
+        <rdfs:label>Fish</rdfs:label>
+    </owl:Class>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#Institution -->
+
+    <owl:Class rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Institution"/>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#Mammal -->
+
+    <owl:Class rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Mammal">
+        <rdfs:label>Mammal</rdfs:label>
+    </owl:Class>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#Whale -->
+
+    <owl:Class rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Whale">
+        <rdfs:label>Whale</rdfs:label>
+        <rdfs:subClassOf rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#AquaticMammal"/>
+    </owl:Class>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Individuals
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#ACME -->
+
+    <owl:NamedIndividual rdf:about="http://stanbol.apache.org/ontologies/test1.owl#ACME">
+        <sellsTo rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#Wile"/>
+    </owl:NamedIndividual>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#BalenaBianca -->
+
+    <owl:NamedIndividual rdf:about="http://stanbol.apache.org/ontologies/test1.owl#BalenaBianca">
+        <rdf:type rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#AquaticMammal"/>
+        <rdfs:label xml:lang="en">BalenaBianca</rdfs:label>
+    </owl:NamedIndividual>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#MobyDick -->
+
+    <owl:NamedIndividual rdf:about="http://stanbol.apache.org/ontologies/test1.owl#MobyDick">
+        <rdf:type rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#AquaticOrganism"/>
+        <rdf:type rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#Mammal"/>
+        <rdfs:label>MobyDick</rdfs:label>
+        <longInMeters rdf:datatype="&xsd;nonNegativeInteger">23</longInMeters>
+    </owl:NamedIndividual>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#MobyDickTheNovel -->
+
+    <owl:NamedIndividual rdf:about="http://stanbol.apache.org/ontologies/test1.owl#MobyDickTheNovel">
+        <rdfs:label xml:lang="en">MelvilleNovel</rdfs:label>
+        <aboutFiction rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#BalenaBianca"/>
+    </owl:NamedIndividual>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#Porpy -->
+
+    <owl:NamedIndividual rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Porpy">
+        <rdf:type rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#AquaticOrganism"/>
+        <rdfs:label>Porpy</rdfs:label>
+        <knows rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#MobyDick"/>
+    </owl:NamedIndividual>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#Snorky -->
+
+    <owl:NamedIndividual rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Snorky">
+        <rdf:type rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#Crustacean"/>
+        <rdfs:label xml:lang="en">Snorky</rdfs:label>
+        <friend rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#BalenaBianca"/>
+    </owl:NamedIndividual>
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/test1.owl#Wile -->
+
+    <owl:NamedIndividual rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Wile">
+        <knows rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#Porpy"/>
+    </owl:NamedIndividual>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // General axioms
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    <owl:Class>
+        <rdfs:subClassOf rdf:resource="&owl;Thing"/>
+        <owl:intersectionOf rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://stanbol.apache.org/ontologies/test1.owl#AquaticOrganism"/>
+            <owl:Class>
+                <owl:complementOf rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#Fish"/>
+            </owl:Class>
+        </owl:intersectionOf>
+    </owl:Class>
+    <rdf:Description>
+        <rdf:type rdf:resource="&owl;AllDifferent"/>
+        <owl:distinctMembers rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://stanbol.apache.org/ontologies/test1.owl#BalenaBianca"/>
+            <rdf:Description rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Porpy"/>
+        </owl:distinctMembers>
+    </rdf:Description>
+    <owl:Class>
+        <rdfs:subClassOf rdf:resource="http://stanbol.apache.org/ontologies/test1.owl#AquaticOrganism"/>
+        <owl:unionOf rdf:parseType="Collection">
+            <rdf:Description rdf:about="http://stanbol.apache.org/ontologies/test1.owl#AquaticMammal"/>
+            <rdf:Description rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Crustacean"/>
+            <rdf:Description rdf:about="http://stanbol.apache.org/ontologies/test1.owl#Fish"/>
+        </owl:unionOf>
+    </owl:Class>
+    
+    <owl:Ontology rdf:about="http://stanbol.apache.org/ontologies/test1.owl">
+		<owl:versionInfo xml:lang="en">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 &quot;License&quot;); 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 &quot;AS IS&quot; 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.
+		</owl:versionInfo>
+		<rdfs:comment>A dummy model whose only purpose if to test the presence of its members.</rdfs:comment>
+    </owl:Ontology>
+    
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.2.2.1785) http://owlapi.sourceforge.net -->
+

Added: stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/versiontest_v1.owl
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/versiontest_v1.owl?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/versiontest_v1.owl (added)
+++ stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/versiontest_v1.owl Fri Oct  5 15:35:22 2012
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+]>
+
+
+<rdf:RDF xmlns="http://stanbol.apache.org/ontologies/versiontest#"
+     xml:base="http://stanbol.apache.org/ontologies/versiontest"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+    <owl:Ontology rdf:about="http://stanbol.apache.org/ontologies/versiontest">
+        <owl:versionInfo xml:lang="en">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 &quot;License&quot;); 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 &quot;AS IS&quot; 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.
+		</owl:versionInfo>
+        <owl:versionIRI rdf:resource="http://stanbol.apache.org/ontologies/version/1"/>
+    </owl:Ontology>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Datatypes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/versiontest#Clazz1 -->
+
+    <owl:Class rdf:about="http://stanbol.apache.org/ontologies/versiontest#Clazz1">
+        <rdfs:label xml:lang="en">Clazz 1</rdfs:label>
+        <rdfs:comment xml:lang="en">Dummy type used for checking its absence in another ontology with the same ontology IRI but a different version IRI.</rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Individuals
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/versiontest#SharedIndividual1 -->
+
+    <owl:NamedIndividual rdf:about="http://stanbol.apache.org/ontologies/versiontest#SharedIndividual1">
+        <rdf:type rdf:resource="http://stanbol.apache.org/ontologies/versiontest#Clazz1"/>
+        <rdfs:label xml:lang="en">shared individual 1</rdfs:label>
+        <rdfs:comment xml:lang="en">An individual for whom axioms are featured on two ontologies with different versions</rdfs:comment>
+    </owl:NamedIndividual>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.2.3.1824) http://owlapi.sourceforge.net -->
+

Added: stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/versiontest_v2.owl
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/versiontest_v2.owl?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/versiontest_v2.owl (added)
+++ stanbol/trunk/ontologymanager/multiplexer/clerezza/src/test/resources/ontologies/versiontest_v2.owl Fri Oct  5 15:35:22 2012
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+
+<!DOCTYPE rdf:RDF [
+    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
+    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
+    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
+    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
+    <!ENTITY versiontest "http://stanbol.apache.org/ontologies/versiontest#" >
+]>
+
+
+<rdf:RDF xmlns="http://stanbol.apache.org/ontologies/versiontest#"
+     xml:base="http://stanbol.apache.org/ontologies/versiontest"
+     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+     xmlns:owl="http://www.w3.org/2002/07/owl#"
+     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+     xmlns:versiontest="http://stanbol.apache.org/ontologies/versiontest#">
+    <owl:Ontology rdf:about="http://stanbol.apache.org/ontologies/versiontest">
+		<owl:versionInfo xml:lang="en">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 &quot;License&quot;); 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 &quot;AS IS&quot; 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.
+		</owl:versionInfo>
+        <owl:versionIRI rdf:resource="version/2"/>
+    </owl:Ontology>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Annotation properties
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Datatypes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Classes
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/versiontest#Clazz1 -->
+
+    <owl:Class rdf:about="&versiontest;Clazz2">
+        <rdfs:label xml:lang="en">Clazz 2</rdfs:label>
+        <rdfs:comment xml:lang="en">Dummy type used for checking its absence in another ontology with the same ontology IRI but a different version IRI.</rdfs:comment>
+    </owl:Class>
+    
+
+
+    <!-- 
+    ///////////////////////////////////////////////////////////////////////////////////////
+    //
+    // Individuals
+    //
+    ///////////////////////////////////////////////////////////////////////////////////////
+     -->
+
+    
+
+
+    <!-- http://stanbol.apache.org/ontologies/versiontest#SharedIndividual1 -->
+
+    <!-- http://stanbol.apache.org/ontologies/versiontest#SharedIndividual1 -->
+
+    <owl:NamedIndividual rdf:about="http://stanbol.apache.org/ontologies/versiontest#SharedIndividual1">
+        <rdf:type rdf:resource="http://stanbol.apache.org/ontologies/versiontest#Clazz2"/>
+        <rdfs:label xml:lang="en">shared individual 1</rdfs:label>
+        <rdfs:comment xml:lang="en">An individual for whom axioms are featured on two ontologies with different versions</rdfs:comment>
+    </owl:NamedIndividual>
+</rdf:RDF>
+
+
+
+<!-- Generated by the OWL API (version 3.2.3.1824) http://owlapi.sourceforge.net -->
+

Modified: stanbol/trunk/ontologymanager/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/pom.xml?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/pom.xml (original)
+++ stanbol/trunk/ontologymanager/pom.xml Fri Oct  5 15:35:22 2012
@@ -33,7 +33,11 @@
   <inceptionYear>2011</inceptionYear>
 
   <modules>
-    <module>ontonet</module>
+    <module>generic/servicesapi</module>
+    <module>sources/clerezza</module>
+    <module>sources/owlapi</module>
+    <module>generic/core</module>
+    <module>multiplexer/clerezza</module>
     <module>registry</module>
     <module>web</module>
     <module>bundlelist</module>

Modified: stanbol/trunk/ontologymanager/registry/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/pom.xml?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/pom.xml (original)
+++ stanbol/trunk/ontologymanager/registry/pom.xml Fri Oct  5 15:35:22 2012
@@ -32,7 +32,7 @@
   <version>0.10.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
-  <name>Apache Stanbol Ontology Manager Registry Manager</name>
+  <name>Apache Stanbol Ontology Manager : Registry Manager</name>
   <description>
     A facility for storing, caching and managing local ontology registries and central repositories.
   </description>
@@ -52,7 +52,7 @@
               OSGI-INF
             </Bundle-ClassPath>
             <Export-Package>
-              org.apache.stanbol.ontologymanager.registry.*
+              org.apache.stanbol.ontologymanager.registry.*;version=${project.version}
             </Export-Package>
             <Import-Package>
               org.slf4j.*,
@@ -73,92 +73,47 @@
   </build>
 
   <dependencies>
-    <!-- Stanbol deps -->
+
+    <!-- Stanbol commons -->
     <dependency>
       <groupId>org.apache.stanbol</groupId>
-      <artifactId>org.apache.stanbol.commons.stanboltools.datafileprovider</artifactId>
-      <version>0.9.0-incubating</version>
+      <artifactId>org.apache.stanbol.commons.owl</artifactId>
+      <version>0.10.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.stanbol</groupId>
-      <artifactId>org.apache.stanbol.commons.stanboltools.offline</artifactId>
+      <artifactId>org.apache.stanbol.commons.stanboltools.datafileprovider</artifactId>
       <version>0.9.0-incubating</version>
     </dependency>
+
+    <!-- Stanbol deps -->
     <dependency>
       <groupId>org.apache.stanbol</groupId>
-      <artifactId>org.apache.stanbol.ontologymanager.ontonet</artifactId>
+      <artifactId>org.apache.stanbol.ontologymanager.multiplexer.clerezza</artifactId>
       <version>0.10.0-SNAPSHOT</version>
-    </dependency>
+    </dependency>  
     <dependency>
       <groupId>org.apache.stanbol</groupId>
-      <artifactId>org.apache.stanbol.commons.owl</artifactId>
+      <artifactId>org.apache.stanbol.ontologymanager.servicesapi</artifactId>
       <version>0.10.0-SNAPSHOT</version>
     </dependency>
-
-    <!-- OSGi deps -->
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.scr.annotations</artifactId>
-    </dependency>
-
-    <!-- OWL deps -->
-    <dependency>
-      <groupId>com.hp.hpl.jena</groupId>
-      <artifactId>jena</artifactId>
-    </dependency>
-
-    <!-- Persistence deps -->
     <dependency>
-      <groupId>org.apache.clerezza</groupId>
-      <artifactId>rdf.core</artifactId>
-    </dependency>
-
-    <!-- Diagnostics deps -->
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
+      <groupId>org.apache.stanbol</groupId>
+      <artifactId>org.apache.stanbol.ontologymanager.sources.owlapi</artifactId>
+      <version>0.10.0-SNAPSHOT</version>
     </dependency>
 
-    <!-- Testing deps -->
+    <!-- for testing -->
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.stanbol</groupId>
-      <artifactId>org.apache.stanbol.commons.testing.stanbol</artifactId>
-      <version>0.9.0-incubating</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.clerezza</groupId>
-      <artifactId>rdf.jena.parser</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.clerezza</groupId>
-      <artifactId>rdf.jena.serializer</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.clerezza</groupId>
-      <artifactId>rdf.rdfjson</artifactId>
-      <scope>test</scope>
-    </dependency>
+    </dependency>    
     <dependency>
       <groupId>org.apache.clerezza</groupId>
       <artifactId>rdf.simple.storage</artifactId>
       <scope>test</scope>
     </dependency>
-
+  
   </dependencies>
 
 </project>

Modified: stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/RegistryManager.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/RegistryManager.java?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/RegistryManager.java (original)
+++ stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/RegistryManager.java Fri Oct  5 15:35:22 2012
@@ -18,10 +18,10 @@ package org.apache.stanbol.ontologymanag
 
 import java.util.Set;
 
-import org.apache.stanbol.ontologymanager.ontonet.api.OfflineConfiguration;
 import org.apache.stanbol.ontologymanager.registry.api.model.CachingPolicy;
 import org.apache.stanbol.ontologymanager.registry.api.model.Library;
 import org.apache.stanbol.ontologymanager.registry.api.model.Registry;
+import org.apache.stanbol.ontologymanager.servicesapi.OfflineConfiguration;
 import org.semanticweb.owlapi.model.IRI;
 import org.semanticweb.owlapi.model.OWLOntology;
 

Modified: stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/model/Library.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/model/Library.java?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/model/Library.java (original)
+++ stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/model/Library.java Fri Oct  5 15:35:22 2012
@@ -18,8 +18,8 @@ package org.apache.stanbol.ontologymanag
 
 import java.util.Set;
 
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyProvider;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryContentException;
+import org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyProvider;
 import org.semanticweb.owlapi.model.IRI;
 
 /**

Modified: stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/model/RegistryOntology.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/model/RegistryOntology.java?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/model/RegistryOntology.java (original)
+++ stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/api/model/RegistryOntology.java Fri Oct  5 15:35:22 2012
@@ -16,7 +16,7 @@
  */
 package org.apache.stanbol.ontologymanager.registry.api.model;
 
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyProvider;
+import org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyProvider;
 import org.semanticweb.owlapi.model.IRI;
 import org.semanticweb.owlapi.model.OWLOntology;
 

Modified: stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/RegistryItemFactoryImpl.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/RegistryItemFactoryImpl.java?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/RegistryItemFactoryImpl.java (original)
+++ stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/RegistryItemFactoryImpl.java Fri Oct  5 15:35:22 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.stanbol.ontologymanager.registry.impl;
 
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyProvider;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryItemFactory;
 import org.apache.stanbol.ontologymanager.registry.api.model.Library;
 import org.apache.stanbol.ontologymanager.registry.api.model.Registry;
@@ -24,6 +23,7 @@ import org.apache.stanbol.ontologymanage
 import org.apache.stanbol.ontologymanager.registry.impl.model.LibraryImpl;
 import org.apache.stanbol.ontologymanager.registry.impl.model.RegistryImpl;
 import org.apache.stanbol.ontologymanager.registry.impl.model.RegistryOntologyImpl;
+import org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyProvider;
 import org.semanticweb.owlapi.model.OWLNamedObject;
 import org.semanticweb.owlapi.model.OWLOntology;
 

Modified: stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/RegistryManagerImpl.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/RegistryManagerImpl.java?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/RegistryManagerImpl.java (original)
+++ stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/RegistryManagerImpl.java Fri Oct  5 15:35:22 2012
@@ -36,9 +36,7 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Service;
 import org.apache.stanbol.commons.owl.OWLOntologyManagerFactory;
 import org.apache.stanbol.commons.stanboltools.datafileprovider.DataFileProvider;
-import org.apache.stanbol.ontologymanager.ontonet.api.OfflineConfiguration;
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyProvider;
-import org.apache.stanbol.ontologymanager.ontonet.impl.clerezza.ClerezzaOntologyProvider;
+import org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryContentException;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryContentListener;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryItemFactory;
@@ -51,6 +49,8 @@ import org.apache.stanbol.ontologymanage
 import org.apache.stanbol.ontologymanager.registry.api.model.RegistryOntology;
 import org.apache.stanbol.ontologymanager.registry.impl.util.RegistryUtils;
 import org.apache.stanbol.ontologymanager.registry.xd.vocabulary.CODOVocabulary;
+import org.apache.stanbol.ontologymanager.servicesapi.OfflineConfiguration;
+import org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyProvider;
 import org.osgi.service.component.ComponentContext;
 import org.semanticweb.owlapi.apibinding.OWLManager;
 import org.semanticweb.owlapi.io.IRIDocumentSource;

Modified: stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/model/LibraryImpl.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/model/LibraryImpl.java?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/model/LibraryImpl.java (original)
+++ stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/impl/model/LibraryImpl.java Fri Oct  5 15:35:22 2012
@@ -23,8 +23,7 @@ import java.util.Set;
 import org.apache.clerezza.rdf.core.access.TcManager;
 import org.apache.clerezza.rdf.core.access.TcProvider;
 import org.apache.clerezza.rdf.core.serializedform.Parser;
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyProvider;
-import org.apache.stanbol.ontologymanager.ontonet.impl.clerezza.ClerezzaOntologyProvider;
+import org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider;
 import org.apache.stanbol.ontologymanager.registry.api.IllegalRegistryCycleException;
 import org.apache.stanbol.ontologymanager.registry.api.LibraryContentNotLoadedException;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryContentException;
@@ -34,6 +33,7 @@ import org.apache.stanbol.ontologymanage
 import org.apache.stanbol.ontologymanager.registry.api.model.Registry;
 import org.apache.stanbol.ontologymanager.registry.api.model.RegistryItem;
 import org.apache.stanbol.ontologymanager.registry.api.model.RegistryOntology;
+import org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyProvider;
 import org.semanticweb.owlapi.model.IRI;
 import org.semanticweb.owlapi.model.OWLOntologyID;
 import org.semanticweb.owlapi.model.OWLOntologyManager;

Modified: stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/io/LibrarySource.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/io/LibrarySource.java?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/io/LibrarySource.java (original)
+++ stanbol/trunk/ontologymanager/registry/src/main/java/org/apache/stanbol/ontologymanager/registry/io/LibrarySource.java Fri Oct  5 15:35:22 2012
@@ -19,16 +19,16 @@ package org.apache.stanbol.ontologymanag
 import java.util.Set;
 
 import org.apache.stanbol.commons.owl.OWLOntologyManagerFactory;
-import org.apache.stanbol.ontologymanager.ontonet.api.OfflineConfiguration;
-import org.apache.stanbol.ontologymanager.ontonet.api.io.AbstractOWLOntologyInputSource;
-import org.apache.stanbol.ontologymanager.ontonet.api.io.OntologyInputSource;
-import org.apache.stanbol.ontologymanager.ontonet.api.io.RootOntologySource;
-import org.apache.stanbol.ontologymanager.ontonet.api.io.SetInputSource;
-import org.apache.stanbol.ontologymanager.ontonet.impl.util.OntologyUtils;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryContentException;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryManager;
 import org.apache.stanbol.ontologymanager.registry.api.model.Library;
 import org.apache.stanbol.ontologymanager.registry.impl.model.LibraryImpl;
+import org.apache.stanbol.ontologymanager.servicesapi.OfflineConfiguration;
+import org.apache.stanbol.ontologymanager.servicesapi.io.OntologyInputSource;
+import org.apache.stanbol.ontologymanager.servicesapi.io.SetInputSource;
+import org.apache.stanbol.ontologymanager.servicesapi.util.OntologyImportUtils;
+import org.apache.stanbol.ontologymanager.sources.owlapi.AbstractOWLOntologyInputSource;
+import org.apache.stanbol.ontologymanager.sources.owlapi.RootOntologySource;
 import org.semanticweb.owlapi.apibinding.OWLManager;
 import org.semanticweb.owlapi.model.IRI;
 import org.semanticweb.owlapi.model.OWLOntology;
@@ -173,9 +173,9 @@ public class LibrarySource extends Abstr
             // else
             try {
                 OWLOntology parent;
-                if (parentSrc != null) parent = OntologyUtils.buildImportTree(parentSrc, subtrees,
+                if (parentSrc != null) parent = OntologyImportUtils.buildImportTree(parentSrc, subtrees,
                     ontologyManager);
-                else parent = OntologyUtils.buildImportTree(subtrees, ontologyManager);
+                else parent = OntologyImportUtils.buildImportTree(subtrees, ontologyManager);
                 bindRootOntology(parent);
             } catch (OWLOntologyCreationException e) {
                 log.error("Failed to build import tree for library source " + libraryID, e);

Modified: stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestOntologyLibrary.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestOntologyLibrary.java?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestOntologyLibrary.java (original)
+++ stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestOntologyLibrary.java Fri Oct  5 15:35:22 2012
@@ -30,10 +30,8 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Set;
 
-import org.apache.stanbol.ontologymanager.ontonet.api.OfflineConfiguration;
-import org.apache.stanbol.ontologymanager.ontonet.api.io.OntologyInputSource;
-import org.apache.stanbol.ontologymanager.ontonet.impl.OfflineConfigurationImpl;
-import org.apache.stanbol.ontologymanager.ontonet.impl.clerezza.ClerezzaOntologyProvider;
+import org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl;
+import org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryManager;
 import org.apache.stanbol.ontologymanager.registry.api.model.Library;
 import org.apache.stanbol.ontologymanager.registry.api.model.Registry;
@@ -41,6 +39,8 @@ import org.apache.stanbol.ontologymanage
 import org.apache.stanbol.ontologymanager.registry.impl.RegistryManagerImpl;
 import org.apache.stanbol.ontologymanager.registry.impl.util.RegistryUtils;
 import org.apache.stanbol.ontologymanager.registry.io.LibrarySource;
+import org.apache.stanbol.ontologymanager.servicesapi.OfflineConfiguration;
+import org.apache.stanbol.ontologymanager.servicesapi.io.OntologyInputSource;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.BeforeClass;

Modified: stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestOntologyRegistry.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestOntologyRegistry.java?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestOntologyRegistry.java (original)
+++ stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestOntologyRegistry.java Fri Oct  5 15:35:22 2012
@@ -31,15 +31,15 @@ import java.util.Set;
 
 import org.apache.clerezza.rdf.core.serializedform.Parser;
 import org.apache.clerezza.rdf.simple.storage.SimpleTcProvider;
-import org.apache.stanbol.ontologymanager.ontonet.api.OfflineConfiguration;
-import org.apache.stanbol.ontologymanager.ontonet.impl.OfflineConfigurationImpl;
-import org.apache.stanbol.ontologymanager.ontonet.impl.clerezza.ClerezzaOntologyProvider;
+import org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl;
+import org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryManager;
 import org.apache.stanbol.ontologymanager.registry.api.model.Library;
 import org.apache.stanbol.ontologymanager.registry.api.model.Registry;
 import org.apache.stanbol.ontologymanager.registry.api.model.RegistryItem;
 import org.apache.stanbol.ontologymanager.registry.api.model.RegistryOntology;
 import org.apache.stanbol.ontologymanager.registry.impl.RegistryManagerImpl;
+import org.apache.stanbol.ontologymanager.servicesapi.OfflineConfiguration;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;

Modified: stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestRegistryManager.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestRegistryManager.java?rev=1394594&r1=1394593&r2=1394594&view=diff
==============================================================================
--- stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestRegistryManager.java (original)
+++ stanbol/trunk/ontologymanager/registry/src/test/java/org/apache/stanbol/ontologymanager/registry/TestRegistryManager.java Fri Oct  5 15:35:22 2012
@@ -29,16 +29,16 @@ import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Iterator;
 
-import org.apache.stanbol.ontologymanager.ontonet.api.OfflineConfiguration;
-import org.apache.stanbol.ontologymanager.ontonet.api.ontology.OntologyProvider;
-import org.apache.stanbol.ontologymanager.ontonet.impl.OfflineConfigurationImpl;
-import org.apache.stanbol.ontologymanager.ontonet.impl.clerezza.ClerezzaOntologyProvider;
+import org.apache.stanbol.ontologymanager.core.OfflineConfigurationImpl;
+import org.apache.stanbol.ontologymanager.multiplexer.clerezza.ontology.ClerezzaOntologyProvider;
 import org.apache.stanbol.ontologymanager.registry.api.RegistryManager;
 import org.apache.stanbol.ontologymanager.registry.api.model.CachingPolicy;
 import org.apache.stanbol.ontologymanager.registry.api.model.Library;
 import org.apache.stanbol.ontologymanager.registry.api.model.Registry;
 import org.apache.stanbol.ontologymanager.registry.api.model.RegistryItem;
 import org.apache.stanbol.ontologymanager.registry.impl.RegistryManagerImpl;
+import org.apache.stanbol.ontologymanager.servicesapi.OfflineConfiguration;
+import org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyProvider;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.BeforeClass;

Propchange: stanbol/trunk/ontologymanager/sources/clerezza/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Oct  5 15:35:22 2012
@@ -0,0 +1,4 @@
+.classpath
+.project
+.settings
+target

Added: stanbol/trunk/ontologymanager/sources/clerezza/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/sources/clerezza/pom.xml?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/sources/clerezza/pom.xml (added)
+++ stanbol/trunk/ontologymanager/sources/clerezza/pom.xml Fri Oct  5 15:35:22 2012
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.stanbol</groupId>
+		<artifactId>stanbol-parent</artifactId>
+		<version>2-SNAPSHOT</version>
+		<relativePath>../../../parent</relativePath>
+	</parent>
+
+	<groupId>org.apache.stanbol</groupId>
+	<artifactId>org.apache.stanbol.ontologymanager.sources.clerezza</artifactId>
+	<version>0.10.0-SNAPSHOT</version>
+	<packaging>bundle</packaging>
+
+	<name>Apache Stanbol Ontology Manager : Input Sources (Clerezza-based)</name>
+	<description>
+      Ontology Manager API extensions for submitting ontologies to the manager. 
+      These implementations are based on the Apache Clerezza RDF API, therefore 
+      can be used to store ontologies directly for space efficiency during the 
+      process.
+	</description>
+
+	<inceptionYear>2012</inceptionYear>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<Bundle-Activator/>
+						<Bundle-ClassPath>.</Bundle-ClassPath>
+						<Export-Package>
+						  org.apache.stanbol.ontologymanager.ontonet.io.*, <!-- DEPRECATED -->
+						  org.apache.stanbol.ontologymanager.sources.clerezza.*;version=${project.version}
+						</Export-Package>
+						<Import-Package>
+							org.apache.clerezza.rdf.core.*,
+							org.slf4j.*,
+							*
+						</Import-Package>
+						<_nouses>true</_nouses>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+	<dependencies>
+
+		<!-- Stanbol commons -->
+		<dependency>
+			<groupId>org.apache.stanbol</groupId>
+			<artifactId>org.apache.stanbol.commons.indexedgraph</artifactId>
+			<version>0.10.0-SNAPSHOT</version>
+		</dependency>
+		
+		<!-- Stanbol deps -->
+		<dependency>
+			<groupId>org.apache.stanbol</groupId>
+			<artifactId>org.apache.stanbol.ontologymanager.servicesapi</artifactId>
+			<version>0.10.0-SNAPSHOT</version>
+		</dependency>
+
+		<!-- for tests -->
+		<dependency>
+			<groupId>org.apache.clerezza</groupId>
+			<artifactId>rdf.simple.storage</artifactId>
+			<scope>test</scope>
+		</dependency>
+
+	</dependencies>
+
+</project>

Added: stanbol/trunk/ontologymanager/sources/clerezza/src/license/THIRD-PARTY.properties
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/sources/clerezza/src/license/THIRD-PARTY.properties?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/sources/clerezza/src/license/THIRD-PARTY.properties (added)
+++ stanbol/trunk/ontologymanager/sources/clerezza/src/license/THIRD-PARTY.properties Fri Oct  5 15:35:22 2012
@@ -0,0 +1,26 @@
+# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
+#-------------------------------------------------------------------------------
+# Already used licenses in project :
+# - Apache 2
+# - Apache License
+# - BSD
+# - BSD-style license
+# - CDDL 1.1
+# - Common Development and Distribution License (CDDL) v1.0
+# - Common Public License Version 1.0
+# - GPL2 w/ CPE
+# - ICU License
+# - MIT License
+# - The Apache Software License, Version 2.0
+#-------------------------------------------------------------------------------
+# Please fill the missing licenses for dependencies :
+#
+#
+#Wed Feb 15 19:05:02 CET 2012
+asm--asm--3.1=BSD License
+javax.servlet--servlet-api--2.4=Common Development And Distribution License (CDDL), Version 1.0
+org.codehaus.jettison--jettison--1.3=The Apache Software License, Version 2.0
+org.osgi--org.osgi.compendium--4.1.0=The Apache Software License, Version 2.0
+org.osgi--org.osgi.core--4.1.0=The Apache Software License, Version 2.0
+owlapi--owlapi--3.2.3=The Apache Software License, Version 2.0
+xerces--xercesImpl--2.7.1=The Apache Software License, Version 2.0

Added: stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/AbstractClerezzaGraphInputSource.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/AbstractClerezzaGraphInputSource.java?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/AbstractClerezzaGraphInputSource.java (added)
+++ stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/AbstractClerezzaGraphInputSource.java Fri Oct  5 15:35:22 2012
@@ -0,0 +1,23 @@
+/*
+ * 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.io;
+
+@Deprecated
+public abstract class AbstractClerezzaGraphInputSource extends
+        org.apache.stanbol.ontologymanager.sources.clerezza.AbstractClerezzaGraphInputSource {
+
+}

Added: stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/GraphContentInputSource.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/GraphContentInputSource.java?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/GraphContentInputSource.java (added)
+++ stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/GraphContentInputSource.java Fri Oct  5 15:35:22 2012
@@ -0,0 +1,53 @@
+/*
+ * 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.io;
+
+import java.io.InputStream;
+
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.access.TcProvider;
+import org.apache.clerezza.rdf.core.serializedform.Parser;
+import org.apache.stanbol.ontologymanager.servicesapi.io.OntologyInputSource;
+
+public class GraphContentInputSource extends
+        org.apache.stanbol.ontologymanager.sources.clerezza.GraphContentInputSource implements
+        OntologyInputSource<TripleCollection> {
+
+    public GraphContentInputSource(InputStream content) {
+        super(content);
+    }
+
+    public GraphContentInputSource(InputStream content, String formatIdentifier) {
+        super(content, formatIdentifier);
+    }
+
+    public GraphContentInputSource(InputStream content, String formatIdentifier, TcProvider tcProvider) {
+        super(content, formatIdentifier, tcProvider);
+    }
+
+    public GraphContentInputSource(InputStream content,
+                                   String formatIdentifier,
+                                   TcProvider tcProvider,
+                                   Parser parser) {
+        super(content, formatIdentifier, tcProvider, parser);
+    }
+
+    public GraphContentInputSource(InputStream content, TcProvider tcProvider) {
+        super(content, tcProvider);
+    }
+
+}

Added: stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/GraphSource.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/GraphSource.java?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/GraphSource.java (added)
+++ stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/ontonet/api/io/GraphSource.java Fri Oct  5 15:35:22 2012
@@ -0,0 +1,42 @@
+/*
+ * 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.io;
+
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.TcProvider;
+
+@Deprecated
+public class GraphSource extends org.apache.stanbol.ontologymanager.sources.clerezza.GraphSource {
+
+    public GraphSource(String graphId) {
+        super(graphId);
+    }
+
+    public GraphSource(TripleCollection graph) {
+        super(graph);
+    }
+
+    public GraphSource(UriRef graphId) {
+        super(graphId);
+    }
+
+    public GraphSource(UriRef graphId, TcProvider tcProvider) {
+        super(graphId, tcProvider);
+    }
+
+}

Added: stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/AbstractClerezzaGraphInputSource.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/AbstractClerezzaGraphInputSource.java?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/AbstractClerezzaGraphInputSource.java (added)
+++ stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/AbstractClerezzaGraphInputSource.java Fri Oct  5 15:35:22 2012
@@ -0,0 +1,46 @@
+/*
+ * 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.sources.clerezza;
+
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.stanbol.ontologymanager.servicesapi.io.AbstractGenericInputSource;
+import org.apache.stanbol.ontologymanager.servicesapi.io.OntologyInputSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Default implementation of an {@link OntologyInputSource} that returns {@link TripleCollection} objects as
+ * ontologies.
+ * 
+ * Subclasses must implement the {@link #getImports(boolean)} method, as the availability of imported
+ * ontologies might depend on the input source being able to access the {@link TcManager} where they are
+ * stored.
+ * 
+ * @author alexdma
+ * 
+ */
+public abstract class AbstractClerezzaGraphInputSource extends AbstractGenericInputSource<TripleCollection> {
+
+    protected Logger log = LoggerFactory.getLogger(getClass());
+
+    @Override
+    protected void bindRootOntology(TripleCollection ontology) {
+        super.bindRootOntology(ontology);
+    }
+
+}

Added: stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/GraphContentInputSource.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/GraphContentInputSource.java?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/GraphContentInputSource.java (added)
+++ stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/GraphContentInputSource.java Fri Oct  5 15:35:22 2012
@@ -0,0 +1,199 @@
+/*
+ * 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.sources.clerezza;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.TcProvider;
+import org.apache.clerezza.rdf.core.serializedform.Parser;
+import org.apache.clerezza.rdf.core.serializedform.UnsupportedFormatException;
+import org.apache.stanbol.commons.indexedgraph.IndexedMGraph;
+import org.apache.stanbol.ontologymanager.servicesapi.io.Origin;
+import org.apache.stanbol.ontologymanager.servicesapi.ontology.OntologyLoadingException;
+import org.apache.stanbol.ontologymanager.servicesapi.util.OntologyUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An ontology input source that returns a Clerezza {@link TripleCollection} ({@link Graph} or {@link MGraph})
+ * after parsing its serialized content from an input stream.
+ * 
+ * @author alexdma
+ * 
+ */
+public class GraphContentInputSource extends AbstractClerezzaGraphInputSource {
+
+    protected Logger log = LoggerFactory.getLogger(getClass());
+
+    /**
+     * Creates a new graph input source by parsing <code>content</code>. Every supported format will be tried
+     * until one is parsed successfully. The resulting graph is created in-memory, and its triples will have
+     * to be manually added to a stored graph if necessary.
+     * 
+     * @param content
+     *            the serialized graph content.
+     */
+    public GraphContentInputSource(InputStream content) {
+        this(content, (String) null);
+    }
+
+    /**
+     * Creates a new graph input source by parsing <code>content</code> assuming it has the given format. The
+     * resulting graph is created in-memory, and its triples will have to be manually added to a stored graph
+     * if necessary.
+     * 
+     * @param content
+     *            the serialized graph content.
+     * @param formatIdentifier
+     *            the format to parse the content as.
+     */
+    public GraphContentInputSource(InputStream content, String formatIdentifier) {
+        this(content, formatIdentifier, null);
+    }
+
+    /**
+     * Creates a new graph input source by parsing <code>content</code> into a graph created using the
+     * supplied {@link TcProvider}, assuming it has the given format.
+     * 
+     * @param content
+     *            the serialized graph content.
+     * @param formatIdentifier
+     *            the format to parse the content as.
+     * @param tcProvider
+     *            the provider that will create the graph where the triples will be stored.
+     */
+    public GraphContentInputSource(InputStream content, String formatIdentifier, TcProvider tcProvider) {
+        this(content, formatIdentifier, tcProvider, Parser.getInstance());
+    }
+
+    /**
+     * Creates a new graph input source by parsing <code>content</code> (using the supplied {@link Parser})
+     * into a graph created using the supplied {@link TcProvider}, assuming it has the given format. An
+     * {@link OntologyLoadingException} will be thrown if the parser fails.
+     * 
+     * @param content
+     *            the serialized graph content.
+     * @param formatIdentifier
+     *            the format to parse the content as. Blank or null values are allowed, but could cause
+     *            exceptions to be thrown if the supplied input stream cannot be reset.
+     * @param tcProvider
+     *            the provider that will create the graph where the triples will be stored. If null, an
+     *            in-memory graph will be created, in which case any ontology collectors using this input
+     *            source will most likely have to copy it to persistent storage.
+     * @param parser
+     *            the parser to use for creating the graph. If null, the default one will be used. * @deprecated
+     */
+    public GraphContentInputSource(InputStream content,
+                                   String formatIdentifier,
+                                   TcProvider tcProvider,
+                                   Parser parser) {
+        long before = System.currentTimeMillis();
+
+        if (content == null) throw new IllegalArgumentException("No content supplied");
+        if (parser == null) parser = Parser.getInstance();
+        boolean loaded = false;
+
+        // Check if we can make multiple attempts at parsing the data stream.
+        if (content.markSupported()) {
+            log.debug("Stream mark/reset supported. Can try multiple formats if necessary.");
+            content.mark(Integer.MAX_VALUE);
+        }
+
+        // Check for supported formats to try.
+        Collection<String> formats;
+        if (formatIdentifier == null || "".equals(formatIdentifier.trim())) formats = OntologyUtils
+                .getPreferredSupportedFormats(parser.getSupportedFormats());
+        else formats = Collections.singleton(formatIdentifier);
+
+        // TODO guess/lookahead the ontology ID and use it in the graph name.
+        UriRef name = new UriRef( /* "ontonet" + "::" + */
+        getClass().getCanonicalName() + "-time:" + System.currentTimeMillis());
+
+        TripleCollection graph = null;
+        if (tcProvider != null && tcProvider != null) {
+            // Graph directly stored in the TcProvider prior to using the source
+            graph = tcProvider.createMGraph(name);
+            bindPhysicalOrigin(Origin.create(name));
+            // XXX if addition fails, should rollback procedures also delete the graph?
+        } else {
+            // In memory graph, will most likely have to be copied afterwards.
+            graph = new IndexedMGraph();
+            bindPhysicalOrigin(null);
+        }
+
+        Iterator<String> itf = formats.iterator();
+        if (!itf.hasNext()) throw new OntologyLoadingException("No suitable format found or defined.");
+        do {
+            String f = itf.next();
+            log.debug("Parsing with format {}", f);
+            try {
+                parser.parse((MGraph) graph, content, f);
+                loaded = true;
+                log.info("Graph parsed, has {} triples", graph.size());
+            } catch (UnsupportedFormatException e) {
+                log.debug("Parsing format {} failed.", f);
+            } catch (Exception e) {
+                log.debug("Error parsing format " + f, e);
+            } finally {
+                if (!loaded && content.markSupported()) try {
+                    content.reset();
+                } catch (IOException e) {
+                    log.debug("Failed to reset data stream while parsing format {}.", f);
+                }
+            }
+        } while (!loaded && itf.hasNext());
+
+        if (loaded) {
+            bindRootOntology(graph);
+            log.debug("Root ontology is a {}.", getRootOntology().getClass().getCanonicalName());
+        } else {
+            // Rollback graph creation, if any
+            if (tcProvider != null && tcProvider != null) tcProvider.deleteTripleCollection(name);
+            throw new OntologyLoadingException("All parsers failed. Giving up.");
+        }
+
+        log.debug("Input source initialization completed in {} ms.", (System.currentTimeMillis() - before));
+    }
+
+    /**
+     * Creates a new graph input source by parsing <code>content</code> into a graph created using the
+     * supplied {@link TcProvider}. Every supported format will be tried until one is parsed successfully.
+     * 
+     * @param content
+     *            the serialized graph content.
+     * @param tcProvider
+     *            the provider that will create the graph where the triples will be stored.
+     * 
+     */
+    public GraphContentInputSource(InputStream content, TcProvider tcProvider) {
+        this(content, null, tcProvider);
+    }
+
+    @Override
+    public String toString() {
+        return "<GRAPH_CONTENT>" + getOrigin();
+    }
+
+}

Added: stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/GraphSource.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/GraphSource.java?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/GraphSource.java (added)
+++ stanbol/trunk/ontologymanager/sources/clerezza/src/main/java/org/apache/stanbol/ontologymanager/sources/clerezza/GraphSource.java Fri Oct  5 15:35:22 2012
@@ -0,0 +1,105 @@
+/*
+ * 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.sources.clerezza;
+
+import org.apache.clerezza.rdf.core.Graph;
+import org.apache.clerezza.rdf.core.MGraph;
+import org.apache.clerezza.rdf.core.TripleCollection;
+import org.apache.clerezza.rdf.core.UriRef;
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.access.TcProvider;
+import org.apache.stanbol.ontologymanager.servicesapi.io.OntologyInputSource;
+import org.apache.stanbol.ontologymanager.servicesapi.io.Origin;
+
+/**
+ * An {@link OntologyInputSource} that gets ontologies from either a stored {@link TripleCollection}, or its
+ * identifier and an optionally supplied triple collection manager.
+ * 
+ * @author alexdma
+ * 
+ */
+public class GraphSource extends AbstractClerezzaGraphInputSource {
+
+    /**
+     * Creates a new input source by querying the default triple collection manager for a graph named with the
+     * supplied <code>graphId</code>. A {@link UriRef} that represents the graph name will also be set as the
+     * graph origin.
+     * 
+     * @param graphId
+     *            the graph ID.
+     * @throws NullPointerException
+     *             if there is no default triple collection manager available.
+     * @throws org.apache.clerezza.rdf.core.access.NoSuchEntityException
+     *             if no such graph can be found.
+     */
+    public GraphSource(String graphId) {
+        this(new UriRef(graphId));
+    }
+
+    /**
+     * Wraps the supplied <code>graph</code> into a new input source. No origin will be set.
+     * 
+     * @param graph
+     *            the RDF graph
+     * @throws IllegalArgumentException
+     *             if <code>graph</code> is neither a {@link Graph} nor a {@link MGraph}.
+     */
+    public GraphSource(TripleCollection graph) {
+        if (graph instanceof Graph) bindRootOntology((Graph) graph);
+        else if (graph instanceof MGraph) bindRootOntology(((MGraph) graph).getGraph());
+        else throw new IllegalArgumentException("GraphSource supports only Graph and MGraph types. "
+                                                + graph.getClass() + " is not supported.");
+        bindPhysicalOrigin(null);
+    }
+
+    /**
+     * Creates a new input source by querying the default triple collection manager for a graph named with the
+     * supplied <code>graphId</code>. The supplied ID will also be set as the graph origin.
+     * 
+     * @param graphId
+     *            the graph ID.
+     * @throws NullPointerException
+     *             if there is no default triple collection manager available.
+     * @throws org.apache.clerezza.rdf.core.access.NoSuchEntityException
+     *             if no such graph can be found.
+     */
+    public GraphSource(UriRef graphId) {
+        this(graphId, TcManager.getInstance());
+    }
+
+    /**
+     * Creates a new input source by querying the supplied triple collection provider for a graph named with
+     * the supplied <code>graphId</code>. The supplied ID will also be set as the graph origin.
+     * 
+     * @param graphId
+     *            the graph ID.
+     * @throws NullPointerException
+     *             if <code>tcProvider</code> is null.
+     * @throws org.apache.clerezza.rdf.core.access.NoSuchEntityException
+     *             if no such graph can be found in <code>tcProvider</code>.
+     */
+    public GraphSource(UriRef graphId, TcProvider tcProvider) {
+        this(tcProvider.getTriples(graphId));
+        bindPhysicalOrigin(Origin.create(graphId));
+    }
+
+    @Override
+    public String toString() {
+        return "GRAPH<" + rootOntology.getClass() + "," + getOrigin() + ">";
+    }
+
+}

Added: stanbol/trunk/ontologymanager/sources/clerezza/src/test/java/org/apache/stanbol/ontologymanager/sources/clerezza/Locations.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/sources/clerezza/src/test/java/org/apache/stanbol/ontologymanager/sources/clerezza/Locations.java?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/sources/clerezza/src/test/java/org/apache/stanbol/ontologymanager/sources/clerezza/Locations.java (added)
+++ stanbol/trunk/ontologymanager/sources/clerezza/src/test/java/org/apache/stanbol/ontologymanager/sources/clerezza/Locations.java Fri Oct  5 15:35:22 2012
@@ -0,0 +1,75 @@
+/*
+ * 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.sources.clerezza;
+
+import org.semanticweb.owlapi.model.IRI;
+
+/**
+ * Physical and logical IRIs for unit tests.
+ */
+public class Locations {
+
+    /**
+     * Default namespace of Stanbol ontologies.
+     */
+    public static final IRI __STANBOL_ONT_NAMESPACE = IRI.create("http://stanbol.apache.org/ontologies/");
+
+    /**
+     * Default physical location of the ontology registry for testing.
+     */
+    public static final IRI _REGISTRY_TEST = IRI.create(__STANBOL_ONT_NAMESPACE + "registries/onmtest.owl");
+
+    /**
+     * Default physical location of the ontology registry for testing.
+     */
+    public static final IRI _REGISTRY_TEST_ADDITIONS = IRI.create(__STANBOL_ONT_NAMESPACE
+                                                                  + "registries/onmtest_additions.owl");
+
+    /**
+     * An ontology in test library 1 but not in test library 2.
+     */
+    public static final IRI CHAR_ACTIVE = IRI.create(__STANBOL_ONT_NAMESPACE + "pcomics/characters_all.owl");
+
+    /**
+     * An ontology in test library 2 but not in test library 1.
+     */
+    public static final IRI CHAR_DROPPED = IRI.create(__STANBOL_ONT_NAMESPACE
+                                                      + "pcomics/droppedcharacters.owl");
+
+    /**
+     * An ontology in test libraries 1 and 2.
+     */
+    public static final IRI CHAR_MAIN = IRI.create(__STANBOL_ONT_NAMESPACE + "pcomics/maincharacters.owl");
+
+    public static final IRI CHAR_MINOR = IRI.create(__STANBOL_ONT_NAMESPACE + "pcomics/minorcharacters.owl");
+    
+    /**
+     * Identifier of test ontology library 1.
+     */
+    public static final IRI LIBRARY_TEST1 = IRI.create(_REGISTRY_TEST + "#Library1");
+
+    /**
+     * Identifier of test ontology library 2.
+     */
+    public static final IRI LIBRARY_TEST2 = IRI.create(_REGISTRY_TEST + "#Library2");
+    
+    /**
+     * Identifier of test ontology library 1.
+     */
+    public static final IRI ONT_TEST1 = IRI.create(__STANBOL_ONT_NAMESPACE + "test1.owl");
+
+}

Added: stanbol/trunk/ontologymanager/sources/clerezza/src/test/java/org/apache/stanbol/ontologymanager/sources/clerezza/MockOsgiContext.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/ontologymanager/sources/clerezza/src/test/java/org/apache/stanbol/ontologymanager/sources/clerezza/MockOsgiContext.java?rev=1394594&view=auto
==============================================================================
--- stanbol/trunk/ontologymanager/sources/clerezza/src/test/java/org/apache/stanbol/ontologymanager/sources/clerezza/MockOsgiContext.java (added)
+++ stanbol/trunk/ontologymanager/sources/clerezza/src/test/java/org/apache/stanbol/ontologymanager/sources/clerezza/MockOsgiContext.java Fri Oct  5 15:35:22 2012
@@ -0,0 +1,71 @@
+package org.apache.stanbol.ontologymanager.sources.clerezza;
+
+/*
+ * 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.
+ */
+
+import java.util.Dictionary;
+import java.util.Hashtable;
+
+import org.apache.clerezza.rdf.core.access.TcManager;
+import org.apache.clerezza.rdf.core.serializedform.Parser;
+import org.apache.clerezza.rdf.core.serializedform.Serializer;
+import org.apache.clerezza.rdf.jena.parser.JenaParserProvider;
+import org.apache.clerezza.rdf.jena.serializer.JenaSerializerProvider;
+import org.apache.clerezza.rdf.rdfjson.parser.RdfJsonParsingProvider;
+import org.apache.clerezza.rdf.rdfjson.serializer.RdfJsonSerializingProvider;
+import org.apache.clerezza.rdf.simple.storage.SimpleTcProvider;
+
+/**
+ * Utility class that provides some objects that would otherwise be provided by SCR reference in an OSGi
+ * environment. Can be used to simulate OSGi in unit tests.
+ * 
+ * @author alexdma
+ * 
+ */
+public class MockOsgiContext {
+
+    private static Dictionary<String,Object> config;
+
+    public static Parser parser;
+
+    public static Serializer serializer;
+
+    public static TcManager tcManager;
+
+    static {
+        config = new Hashtable<String,Object>();
+        reset();
+    }
+
+    /**
+     * Sets up a new mock OSGi context and cleans all resources and components.
+     */
+    public static void reset() {
+        // reset Clerezza objects
+        tcManager = new TcManager();
+        tcManager.addWeightedTcProvider(new SimpleTcProvider());
+        parser = new Parser(); // add Jena-supported formats + RDF/JSON
+        parser.bindParsingProvider(new JenaParserProvider());
+        parser.bindParsingProvider(new RdfJsonParsingProvider());
+        serializer = new Serializer(); // add Jena-supported formats + RDF/JSON
+        serializer.bindSerializingProvider(new JenaSerializerProvider());
+        serializer.bindSerializingProvider(new RdfJsonSerializingProvider());
+
+        // reset Stanbol objects
+    }
+
+}