Skip to main content

Import or export your ontology

Submitted by rnsrk on

Prerequisites

Since WissKI needs an ontology to build the semantic relations, you have to import it into your triple store. Ensure, that you have ontology suitable to your needs, as described in chapter Develop the ontology and a running triplestore.

If you want to reimport or replace an existing ontology, you have to delete it first.

Import

WissKI Ontology

The advantage of importing the ontology this way, is that the shortnames of the namespaces of the owl will be stored in the drupal database and used in the pathbuilder ... is the place where you define the WissKI structure, configure groups and fields and tell WissKI to which adapter it should send the queries. You can export/import your pathbuilder setup. The administrative name of a pathbuilder could something like Collection and Collection Items or Named Entities. , that results in a more display friendly table. 

Open your .htaccess file in your root-dir ...is the directory, where your Drupal website files and folders are stored (core, modules, sites, themes, .htaccess etc.), if you follow the recommended project structure it's the web folder of your project directory, i.e. /var/www/html/wisski.com/web, or C:/xampp/htdocs/wisski.com/web. directory (i. e. /web/.htaccess)  and place this directly beneath the the line with RewriteEngine on:

AddType application/rdf+xml .owl
RewriteRule "^ontology/(.+)\.owl$" "sites/default/files/ontology/$1.owl" [PT]
RewriteRule "^ontology/$" "sites/default/files/ontology/current.owl" [PT,L]

Save your ontology at root-dir ...is the directory, where your Drupal website files and folders are stored (core, modules, sites, themes, .htaccess etc.), if you follow the recommended project structure it's the web folder of your project directory, i.e. /var/www/html/wisski.com/web, or C:/xampp/htdocs/wisski.com/web. /sites/default/files/ontology/current.owl or a name you prefer (i.e. CIDOC_CRM_v7.1.3.owl). You may want to use the IMCE module for this.

Visit Manage Configuration WissKI Ontology (WissKI) (/admin/config/wisski/ontology).

Select the SALZ Adapter in the field Select the store for which you want to load an ontology and enter your-domain "Your-Domain" refers to your unique address or location on the internet. It's essentially the name that people type into the web browser to visit your website, i. e. https://wiss-ki.eu. /ontology/ in the field Load Ontology for store Default WissKI Distillery Adapter : to refer to the file named current.owl or /ontology/ your-ontology.owl ...refers to a existing ontology like CIDOC-CRM or your custom-created ontology for your specific domain. Please note, that there are different notations and WissKI supports OWL 1 DL in XML/RDF.  for the file you prefer. Click Load.

Example Screencast

GraphDB

A direct import into the triplestore do not store the short names of the namespaces into the drupal database, this is not quite display friendly. You may try the the WissKI Ontology import.

Open GraphDB and be sure you are connected with your repository-id ... is the machine name of the repository, i. e. default-adapter, backend-data or just wisski. , then navigate to Import RDF, click on Upload RDF files and choose your ontology file. Click Import.

Specify your base-iri ... the namespace, to which relative paths should be resolved, should be your default-graph-uri ... is the leading IRI of your entities, which is used to identify and refer to objects of your knowledge domain, i. e. https://wisski.com/. Everytime you create a entity related to a adapter with the namespace, WissKI place this iri before the entity id. , i.e. https://wisski.com/. and ontology-graph ... the name of the graph your ontology should stored in, i.e. https://wisski.com/ontology. .

The base-iri ... the namespace, to which relative paths should be resolved, should be your default-graph-uri ... is the leading IRI of your entities, which is used to identify and refer to objects of your knowledge domain, i. e. https://wisski.com/. Everytime you create a entity related to a adapter with the namespace, WissKI place this iri before the entity id. , i.e. https://wisski.com/. and ontology-graph ... the name of the graph your ontology should stored in, i.e. https://wisski.com/ontology. must NOT be the same as your default-graph-uri ... is the leading IRI of your entities, which is used to identify and refer to objects of your knowledge domain, i. e. https://wisski.com/. Everytime you create a entity related to a adapter with the namespace, WissKI place this iri before the entity id. you entered at your salz adapter. If you delete it, because you want to update your ontology all data would be lost!

Example screencast

Delete existing ontology

WissKI Ontology

Ensure, that the ontology-graph ... the name of the graph your ontology should stored in, i.e. https://wisski.com/ontology. is not the same as the default-graph-uri ... is the leading IRI of your entities, which is used to identify and refer to objects of your knowledge domain, i. e. https://wisski.com/. Everytime you create a entity related to a adapter with the namespace, WissKI place this iri before the entity id. at /admin/config/wisski/salz/adapter/ repository-id ... is the machine name of the repository, i. e. default-adapter, backend-data or just wisski. in the field Default Graph. Otherwise all data will be deleted. 

Visit Manage Configuration WissKI Ontology (WissKI) (/admin/config/wisski/ontology).

Click Delete Ontology.

GraphDB

Open GraphDB and click on Explore Graphs overview. In the row of your ontology-graph ... the name of the graph your ontology should stored in, i.e. https://wisski.com/ontology. click on the garbage can to remove the graph. Confirm to clear the graph by clicking Yes.

Update salz adapter

Navigate to Configuration WissKI Salz Adapters (WissKI Salz section),  select the repository-id ... is the machine name of the repository, i. e. default-adapter, backend-data or just wisski. of the adapter you reimported the ontology and click on Compute Type and Property Hierarchy and Domains and Ranges, check Re-Compute results and start reasoning. You may see some errors of missing domains and ranges of some properties if you use Erlangen CRM / OWL. Check reasoning results if ontology is imported.

Example Screencast

Export

GraphDB

For an Export open GraphDB and navigate to Explore Graphs overview and unfold the the tab Export repository. Choose N-Quads from the list an save it.

Example Screencast

Need help?

Write an email or join chat.wiss-ki.eu!