H2020-OpenModel / OMIKB-toolbox

The OpenModel Knowledge Base Tool Box
GNU General Public License v3.0
0 stars 0 forks source link

OMIKB-toolbox: The OpenModel Knowledge-Base Tool-Box

A python class with methods to make working with OMIKB as easy as possible.

Features:

How does it work

Once the user installes omikb, they need to configure an omikb.yml file and save it in their home folder. This will be read by omikb.

the user has to store the omi hub API key obtianed as described in the omi infrastructure project see omi docs on git hub for example.

once instantiated, omikb uses the API key to obtain an access key to the omi. This access key has a limited life span of 1 hour (can be extended if needed, please contact developers.)

Example

Here is a simple example, the same works on omi hub (https://hub.openmodel.app) or on your own machine running python.

from omikb.omikb import kb_toolbox
...

kb=kb_toolbox()
...

this creates an instance, which contains all the information you need to access the service, provides of course you have logged in.

Now we can use things like kb.query("some sparql query"), or kb.update("some INSERT statement"), etc to seamlessly interact with the knowledge base

see first steps example here

Installation

Install the package directly from GitHub:

pip install git+https://github.com/H2020-OpenModel/OMIKB-toolbox.git

to upgrade do:

pip install --upgrade git+https://github.com/H2020-OpenModel/OMIKB-toolbox.git

Developers guide and what next

currently, version 0.1 supports only one service, which is an apache jena fuseki end point, however, one can build support for other services by following the steps:

  1. copy the existing kb_toolbox class
  2. modify the methods according to the service end points as defined in omi
  3. add a services section to omikb.yml

for example, one can create remote access to OntoFlow or other services in a similar manner.

See the jupyter Notebook demo in doc folder


from omikb.omikb import kb_toolbox