View Source

h2. Integrating ontology extensions

In order to integrate an ontology extension, you have to accomplish two steps:
# the new classes should subclass {{protons:Entity}}
# set the new classes' visibility level

h3. Subclass {{protons:Entity}}

h4. Inheritance
Make sure that the new classes inherit at least [], directly or indirectly.

{tip}We recommend that, if applicable, your classes inherit one of these PROTON Top classes:
* []
* []
* []{tip}

h4. Configuration
By default, the ontology extension modules (\* .owl) are located in the *<KIM_HOME>/context/default/kb/owl* folder. You can place them somewhere else if you prefer, as long as you include them in the [OWLIM configuration file|Updating the OWLIM configuration] correctly.

h4. Schema specifics
All classes should have the "label" attribute set. You should pay special attention when using a third-party schema designer to create the ontology extension.

Here is an example extension module that defines "Robot" as a class and also defines the relation "createdBy":

<!DOCTYPE owl [
<!ENTITY rdf ''>
<!ENTITY rdfs ''>
<!ENTITY owl '' >
<!ENTITY xsd '' >
<!ENTITY psys ''>
<!ENTITY ptop ''>
<!ENTITY protonkm ''>

<owl:AnnotationProperty rdf:about="&rdfs;comment"/>
<owl:AnnotationProperty rdf:about="&rdfs;label"/>
<owl:AnnotationProperty rdf:about="&owl;versionInfo"/>

<owl:Ontology rdf:about="#RobotOntology">
<rdfs:label rdf:datatype="&xsd;string">InSpace</rdfs:label>
<rdfs:comment>InSpace Ontology</rdfs:comment>

<owl:Class rdf:ID="Robot">
A mechanical or electronic device that resembles a living animal and
moves automatically or by remote control.
<rdfs:subClassOf rdf:resource="&ptop;Object"/>

<owl:ObjectProperty rdf:about="#createdBy" rdfs:label="createdBy">
<rdfs:domain rdf:resource="#Robot"/>
<rdfs:range rdf:resource="&ptop;Person"/>


If you have an existing ontology in OWL, you can alternatively create a separate mapping file with only {{rdfs:subClass}} statements . Then add both your ontology and the mapping file to the KIM Server installation. See this step-by-step mapping from [DBPedia ontology integration case-study|Example - Integrating DBpedia in KIM] as an example:
@prefix protont: <> .
@prefix dbp_ont: <> .
@prefix rdfs: <> .

dbp_ont:Place rdfs:subClassOf protont:Location .
dbp_ont:Person rdfs:subClassOf protont:Person .
dbp_ont:Organisation rdfs:subClassOf protont:Organization .

h3. KIM User Interface (UI) visibility

All new classes that should be visible in the class hierarchy in the web interface and in the Structure/Patterns screens must be declared "visible" in the *<KIM_HOME>/context/default/kb/visibility.nt* file like this:
Example: *visibility.nt* (addition)
<> <> "" .