Author: alexdma
Date: Mon Jan 23 15:52:42 2012
New Revision: 1234862

URL: http://svn.apache.org/viewvc?rev=1234862&view=rev
Log:
SSTANBOL-461 : fixed code snippet columns, added use case, features and 
references to ontology manager.

Modified:
    
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/ontologymanager.mdtext
    
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/ontologymanager/ontonet.mdtext

Modified: 
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/ontologymanager.mdtext
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/site/trunk/content/stanbol/docs/trunk/ontologymanager.mdtext?rev=1234862&r1=1234861&r2=1234862&view=diff
==============================================================================
--- 
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/ontologymanager.mdtext 
(original)
+++ 
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/ontologymanager.mdtext 
Mon Jan 23 15:52:42 2012
@@ -14,19 +14,35 @@ Using a [reasoner](reasoners.html) you c
 
 ### Knowledge within content
 
+Hierarchical, tree-like structures are a tried-and-true mechanism for 
organizing documents, applications and in fact any content items. What users 
are required to do is select _one_ set of criteria and organize the directory 
structure accordingly. For instance, if journalists were to classify the 
reserch papers on their file system, they could do as follows:
+
+* `articles/mine` (articles authored by the users)
+* `articles/ours` (articles authored by colleagues from the same publication)
+* `articles/others` (articles of any other kind)
+
+This simple structure works well because it creates a perfect partition, i.e. 
you will always know in which _one_ of these directories any article should go. 
But what if the user also wanted to create directories by year of publication, 
or by section (politics, sports etc.)? In a file system it is possible to 
create these directories and add symbolic links as needed, but what if the user 
does not want to _know_ a priori the categories to create directories for? Why 
not have a system that creates them aoutomatically according to the semantics 
of content that create "good" directories (e.g. not too many directories with 
just one content item)?
+
+Organizing a network of ontologies that describe content items can allow such 
an application to be built. Having a dataset that represent the metadata of 
content stored in a CMS, it is possible to attach different ontology scopes, 
e.g. those with domain knowledge, or with the user's organizational hierarchy. 
This "virtual directory" structure can also update automatically as the 
knowledge does. For instance, if the user removes another user from a "friends" 
list, that user's contributions will also be moved out of a `articles/friends` 
directory but stay in a `articles/friends_of_friends` directory.
+
 ## Features
 
-A Web __Ontology__ in computer and information science is a shareable 
conceptual model of a part of the world <a href="#ref1">[1]</a>. This model 
describes concepts terms of their characteristics and their relations with 
other concepts.
+A Web __Ontology__ in computer and information science is a shareable 
conceptual model of a part of the world <a href="#ref1">[1]</a>. This model 
describes concepts terms of their characteristics and their relations with 
other concepts. By means of OntoNet, it is possible to improve ontology 
managers like this:
+
+* Setup multiple __Ontology networks__ simultaneously, by interconnecting the 
knowledge contained in ontologies that normally would not be aware of one 
another.
+* Dynamic __(de-)activation__ of parts of any ontology network, as needed by 
specific reasoning, rule execution, or other knowledge processing tasks.
+* Organize ontologies into __ontology libraries__, which can be populated by 
setting up simple RDF graphs called __registries__.
+* Use Stanbol as a central __ontology repository__ that mirrors the ontologies 
scattered aound the Web, so that there will be no need to query more than a 
single server for all the formal knowledge managed by the CMS.
 
 ### Sub-Components
 
-   - [OntoNet](ontologymanager/ontonet.html)     - allows to construct subsets 
of the knowledge base managed by Stanbol into OWL/OWL2 ontology networks
+   - [OntoNet](ontologymanager/ontonet.html)     - allows to construct subsets 
of the knowledge base managed by Stanbol into OWL/OWL2 <a 
href="#ref2">[2]</a>ontology networks
    - [Registry](ontologymanager/registry.html)  - manages ontology libraries 
for bootstrapping the network using both external and internal ontologies
    - Store       - create, read, update and delete operations on single 
ontologies stored in Stanbol. These operations can be performed on entities, 
axioms, and whole ontologies.
 
 ## References:
 
 * [1] <a name="ref1" 
href="http://tomgruber.org/writing/ontolingua-kaj-1993.pdf"; 
target="_blank">Ontologies (PDF)</a></li>
+* [2] <a name="ref2" href="http://www.w3.org/TR/owl-overview/"; 
target="_blank">The OWL 2 ontology language</a></li>
 
 ____
 _[Back to components](components.html)_
\ No newline at end of file

Modified: 
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/ontologymanager/ontonet.mdtext
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/site/trunk/content/stanbol/docs/trunk/ontologymanager/ontonet.mdtext?rev=1234862&r1=1234861&r2=1234862&view=diff
==============================================================================
--- 
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/ontologymanager/ontonet.mdtext
 (original)
+++ 
incubator/stanbol/site/trunk/content/stanbol/docs/trunk/ontologymanager/ontonet.mdtext
 Mon Jan 23 15:52:42 2012
@@ -54,35 +54,56 @@ In a non-OSGi environment they must be i
 Let us now show an example of how to setup an ontology scope, which you should 
use for storing the models for a certain domain of your knowledge base. In this 
example we will refer to social networks and communities.
 
        ScopeRegistry registry = onMgr.getScopeRegistry();
-    OntologyScopeFactory factory = onMgr.getOntologyScopeFactory();
+    OntologyScopeFactory factory 
+      = onMgr.getOntologyScopeFactory();
 
     /*
-     * Here we create a scope called "Social" where we intend to place all the 
-     * knowledge needed for modeling social networks and communities.
+     * Here we create a scope called "social" where we intend 
+     * to place all the knowledge needed for modeling social 
+     * networks and communities.
      *
-     * Suppose the FOAF and SIOC ontologies are the only ones we are concerned
-     * with at scope creation time. We tell the scope factory method to fetch 
-     * them from their original locations on the Web.
+     * Suppose the FOAF and SIOC ontologies are the only ones 
+     * we are concerned with at scope creation time. We tell 
+     * the scope factory method to fetch them from their 
+     * original locations on the Web.
      */
     try {
       
-      // You can have as many ontology input source as you want, even none at 
all.
-      OntologyScope scope = factory.createOntologyScope("social", 
-        new 
RootOntologyIRISource(IRI.create("http://xmlns.com/foaf/spec/index.rdf";)),
-        new RootOntologyIRISource(IRI.create("http://rdfs.org/sioc/ns";)));
+      /* 
+       * You can include as many ontology input source as 
+       * you want, even none at all.
+       */
+      OntologyScope scope = factory.createOntologyScope(
+        "social", 
+        new RootOntologyIRISource(
+          IRI.create("http://xmlns.com/foaf/spec/index.rdf";)),
+        new RootOntologyIRISource(
+          IRI.create("http://rdfs.org/sioc/ns";)));
     
       /*
-       * Setup the scope, so its ontologies will be available via the RESTful 
API
+       * Setup the scope, so its ontologies will be available 
+       * via the RESTful API
        */
-      scope.setUp();  // Lock the ontology scope
-      registry.registerScope(scope, true); // Register the scope and activate 
it
+      // Lock the ontology scope 
+      scope.setUp(); 
+      // Register the scope and activate it
+      registry.registerScope(scope, true); 
     } catch (OWLOntologyCreationException e1) {
-      // Thrown if there was an error creating one of the ontology sources
-      // (e.g. if some URL could not be resolved or it is not an ontology.
+      /* 
+       * Thrown if there was an error creating one of the 
+       * ontology sources (e.g. if some URL could not be 
+       * resolved or it is not an ontology.
+       */
       e1.printStackTrace();
     } catch (DuplicateIDException e1) {
-      // Thrown if there is already a scope called "social".
-      e1.printStackTrace();
+      /*
+       * Thrown if there is already a scope called "social".
+       * In this case we may decide to use the existing one, 
+       * so we get it. Note that wen reusing a scope, you
+       * lose the provilege of writing in its core space.
+       * Only the custom space will be open for modification.
+       */
+      scope = registry.getScope("social");
     }
     
 If you have not changed any parameters in the OntoNet configuration and have 
the Ontology Manager Web Service endpoint up and running, you should be able to 
fetch an RDF file at `http://localhost:8080/ontonet/ontology/social`. Let us 
check it (in Turtle Syntax):
@@ -91,30 +112,31 @@ If you have not changed any parameters i
 
     @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
     @prefix owl: <http://www.w3.org/2002/07/owl#> .
-    @prefix : <http://localhost:8080/ontonet/ontology/social#> .
+    @prefix : 
+      <http://localhost:8080/ontonet/ontology/social#> .
     @prefix xml: <http://www.w3.org/XML/1998/namespace> .
-    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+    @prefix rdf: 
+      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
     @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
     @base <http://localhost:8080/ontonet/ontology/social> .
     
-    <http://localhost:8080/ontonet/ontology/social> rdf:type owl:Ontology ;
-      owl:imports <http://localhost:8080/ontonet/ontology/social/core> .
+    <http://localhost:8080/ontonet/ontology/social> 
+      rdf:type owl:Ontology ;
+      owl:imports 
+        <http://localhost:8080/ontonet/ontology/social/core> .
 
 Let us take a look at the imported ontology that represents the core space of 
the "social" scope.
 
     % curl -H "Accept: application/turtle" 
http://localhost:8080/ontonet/ontology/social/core
 
-    @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-    @prefix owl: <http://www.w3.org/2002/07/owl#> .
-    @prefix : <http://localhost:8080/ontonet/ontology/social/core#> .
-    @prefix xml: <http://www.w3.org/XML/1998/namespace> .
-    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-    @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-    @base <http://localhost:8080/ontonet/ontology/social/core> .
+    @base 
+      <http://localhost:8080/ontonet/ontology/social/core> .
 
-    <http://localhost:8080/ontonet/ontology/social/core> rdf:type owl:Ontology 
;
-      owl:imports 
<http://localhost:8080/ontonet/ontology/social/http://rdfs.org/sioc/ns> ,
-                  
<http://localhost:8080/ontonet/ontology/social/http://xmlns.com/foaf/0.1/> .
+    <http://localhost:8080/ontonet/ontology/social/core> 
+      rdf:type owl:Ontology ;
+      owl:imports 
+        
<http://localhost:8080/ontonet/ontology/social/http://rdfs.org/sioc/ns> ,
+        
<http://localhost:8080/ontonet/ontology/social/http://xmlns.com/foaf/0.1/> .
 
 Here are the `owl:imports` statements for the FOAF and SIOC ontologies, which 
are hijacked to "internal" versions managed by Stanbol. Of course if a domain 
namespace other than "http://localhost:8080/"; was configured, you will see that 
one in each import statement. 
 
@@ -125,17 +147,21 @@ The FOAF and SIOC ontologies are importe
 Of course it is possible to onbtain a Java object for the ontology using the 
Java API. Here is how to export an entire scope to an OWL API object of type 
`OWLOntology`:
 
     /*
-     * To obtain the OWLOntology, we must specify its class as a return 
parameter.
-     * We also set the second argument to true, to specifiy that we want it 
-     * merged with its imports, so that the resulting object contains all 
axioms.
+     * To obtain the OWLOntology, we must specify its class as
+     * a return parameter.
+     * We also set the second argument to true, to specifiy 
+     * that we want it merged with its imports, so that the 
+     * resulting object contains all axioms.
      */
-    OWLOntology scopeAsOWL = scope.export(OWLOntology.class, true);
+    OWLOntology scopeAsOWL 
+      = scope.export(OWLOntology.class, true);
 
 An scope can be exported either as an OWL API object or as a Clerezza object.
 
     /*
-     * In Clerezza, a Graph is a subclass of TripleCollection, so it is 
supported 
-     * by OntoNet. We could also export a scope to a MGraph (modifiable Graph).
+     * In Clerezza, a Graph is a subclass of TripleCollection, 
+     * so it is supported by OntoNet. We could also export a 
+     * scope to a MGraph (modifiable Graph).
      */
     Graph scopeAsClerezza = scope.export(Graph, false);
 


Reply via email to