-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from INCATools/custom-schema
custom schema
- Loading branch information
Showing
22 changed files
with
1,271 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. cli: | ||
Command Line | ||
============ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.. _tutorial: | ||
|
||
Tutorial | ||
=============== | ||
|
||
.. note:: | ||
|
||
The tutorial is still highly incomplete. Additions welcome! | ||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
:caption: Contents: | ||
|
||
tutorial01 | ||
tutorial02 | ||
tutorial03 | ||
tutorial04 | ||
tutorial05 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Part 2: Basic Python | ||
===================== | ||
|
||
Some basic Python knowledge is assumed | ||
|
||
Install Poetry | ||
-------------- | ||
|
||
For this section we are going to use `Poetry <https://python-poetry.org/>`_ to set up a project. If you are an experienced | ||
developer feel free to adapt these instructions to your favored package manager, otherwise we advise sticking closely to | ||
the instructions. | ||
|
||
Create a new project | ||
-------------- | ||
|
||
.. code-block:: | ||
poetry new --src -n my-oak-demo | ||
cd my-oak-demo | ||
poetry add oaklib | ||
Code the first example | ||
---------- | ||
|
||
We are going to use an example from the :ref:`BasicOntologyInterface`, using a :ref:`ProntoImplementation` | ||
|
||
Edit a file using your favorite IDE | ||
|
||
``src/my_oak_demo/demo.py`` | ||
|
||
.. code-block:: python | ||
TODO | ||
.. note:: | ||
|
||
this is still to be filled in. For now consult test_pronto.py in tests/test_implementations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Part 3: Ubergraph | ||
======= | ||
|
||
Previously we have been working with local ontology files in obo format | ||
|
||
TODO: fill this part of the tutorial in; for now see test_ubergraph is tests/test_implementations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Part 4: OboGraphs | ||
======= | ||
|
||
So far we have been using the :ref:`BasicOntologyInterface` which provides basic lookup operations. All methods in this interface | ||
return 'simple' python objects, such as strings, lists of strings, or dictionaries or :ref:`iterators` composing these elements. | ||
|
||
Sometimes more powerful abstractions are required. For example, many bioinformatics applications work with a graph-abstraction | ||
of an ontology which allows for graph-theoretic operations and visualizations. In contrast, many ontology management and QC | ||
applications require an OWL "axiom-oriented" view of an ontology. | ||
|
||
OAK does not favor any one view or abstraction or datamodel. The general philosophy is: | ||
|
||
- be pluralistic - provide different interfaces with different abstractions, and allow the application developer or user to choose | ||
- ensure each interface follows a well-documented datamodel, adhering to standards if they exist | ||
|
||
To illustrate this we will first introduce the :ref:`OboGraphInterface` which uses the :ref:`OboGraph` datamodel | ||
|
||
OboGraphs | ||
--------- | ||
|
||
In this datamodel, an ontology is conceived of as a Graph, with a graph consisting of | ||
|
||
- nodes | ||
- edges | ||
|
||
Nodes are typically ontology :ref:`Class`es but are not restricted to this. | ||
|
||
Edges are typed relationships between nodes - for example, finger part-of hand. | ||
|
||
OboGraph Interface | ||
----------- | ||
|
||
Like most datamodels in OAK, the OboGraph datamodel follows a Data Access Object (DAO) pattern - the objects are intentionally limited | ||
in their behavior. For example, you cannot ask a node what edges come out or go in; these is stored at the top level graph object. | ||
|
||
"Smarter" operations are provided by the interface | ||
|
||
|
||
|
||
TODO: see tests for examples for now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Part 5: Graph Visualization | ||
===================== | ||
|
||
Install OBOGraphViz | ||
-------------- | ||
|
||
.. code-block:: | ||
npm install obographviz | ||
Command Line Usage | ||
----------------- | ||
|
||
.. code-block:: | ||
runoak -i obolibrary:fbbt.obo viz FBbt:00004751 -p i,p -o wing-vein.png | ||
Then open wing-vein.png | ||
|
||
If you omit the --output option then the png will be written to a temp file and immediately opened: | ||
|
||
.. code-block:: | ||
runoak -i obolibrary:fbbt.obo viz FBbt:00004751 -p i,p | ||
How this works | ||
--------------- | ||
|
||
- First, | ||
|
||
Programmatic usage | ||
--------------- | ||
|
||
TODO: use test_obograph_utils for example | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Part 6: Working With OWO | ||
===================== | ||
|
||
OAK comes bundled with the `funowl <https://github.com/hsolbrig/funowl/>`_ library | ||
|
||
TODO: funowl is not yet bundled, we are waiting for one rdflib PR (https://github.com/RDFLib/rdflib/pull/1686) to be merged... | ||
|
||
OWL Datamodel | ||
-------------- | ||
|
||
|
||
OwlInterface | ||
------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Part 7: SQLite files | ||
============= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.