Skip to content

Commit

Permalink
Merge pull request #328 from mpsonntag/templates
Browse files Browse the repository at this point in the history
Add odML templates support
  • Loading branch information
jgrewe authored Oct 18, 2019
2 parents 15bb570 + e627e76 commit a5ff665
Show file tree
Hide file tree
Showing 17 changed files with 237 additions and 38 deletions.
2 changes: 1 addition & 1 deletion doc/example_odMLs/THGTTG.odml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-stylesheet type="text/xsl" href="odmlTerms.xsl"?>
<?xml-stylesheet type="text/xsl" href="odml.xsl"?>
<odML version="1.1">
<repository>http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml</repository>
<repository>https://terminologies.g-node.org/v1.1/terminologies.xml</repository>
<version>42</version>
<section>
<name>TheCrew</name>
Expand Down
2 changes: 1 addition & 1 deletion doc/example_odMLs/sample_odml.odml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?xml-stylesheet type="text/xsl" href="odml.xsl"?>
<odML version="1.1">
<author>D. N. Adams</author>
<repository>http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml</repository>
<repository>https://terminologies.g-node.org/v1.1/terminologies.xml</repository>
<section>
<property>
<type>person</type>
Expand Down
2 changes: 1 addition & 1 deletion doc/example_odMLs/sample_odml.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ odml:d98afe9b-3982-44bf-9373-12aaa4798628 a rdf:Bag ;
"Tricia Marie McMillan",
"Zaphod Beeblebrox" .

<https://g-node.org/projects/odml-rdf#7e0e07c7-7501-454e-88e7-cfa072db94c1> a <http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml> .
<https://g-node.org/projects/odml-rdf#7e0e07c7-7501-454e-88e7-cfa072db94c1> a <https://terminologies.g-node.org/v1.1/terminologies.xml> .

2 changes: 1 addition & 1 deletion doc/example_odMLs/thgttg.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
save_to = os.path.join(output_directory, "THGTTG.odml")


odmlrepo = 'http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml'
odmlrepo = 'https://terminologies.g-node.org/v1.1/terminologies.xml'

# CREATE A DOCUMENT
doc = odml.Document(author="D. N. Adams",
Expand Down
2 changes: 1 addition & 1 deletion doc/example_rdfs/example_data/drosophila_2.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -643,5 +643,5 @@ odml:fadffec7-6b23-454e-bfd1-9d5884802abb a odml:Property ;
odml:ff5fb5e5-5104-41c8-ab45-9d8787e7fbdc a rdf:Bag ;
rdf:li "simpleErg" .

<https://g-node.org/projects/odml-rdf#7517fc3b-a12c-47b3-bfc5-96cc98fefa8a> a <http://portal.g-node.org/odml/terminologies/v1.0/terminologies.xml> .
<https://g-node.org/projects/odml-rdf#7517fc3b-a12c-47b3-bfc5-96cc98fefa8a> a <https://terminologies.g-node.org/v1.0/terminologies.xml> .

2 changes: 1 addition & 1 deletion doc/example_rdfs/example_data/drosophila_4.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -1352,5 +1352,5 @@ odml:fedefe26-0f36-433f-993d-ad827dcb0a50 a odml:Property ;
odml:hasUnit "ms" ;
odml:hasValue <https://g-node.org/projects/odml-rdf#7fe2ea64-262c-4cdd-acd2-4d59c42cd4aa> .

<https://g-node.org/projects/odml-rdf#9cf7f270-eb40-4406-a78b-d5de29fe5879> a <http://portal.g-node.org/odml/terminologies/v1.0/terminologies.xml> .
<https://g-node.org/projects/odml-rdf#9cf7f270-eb40-4406-a78b-d5de29fe5879> a <https://terminologies.g-node.org/v1.0/terminologies.xml> .

2 changes: 1 addition & 1 deletion doc/example_rdfs/example_data/drosophila_8.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -1351,5 +1351,5 @@ odml:fe6a8363-a5f4-46ed-8eea-b57257d4823b a odml:Property ;
odml:ff532446-ca25-4092-8abb-302e12344b3b a rdf:Bag ;
rdf:li "1.0" .

odml:b0d95b14-a12f-4057-aed3-fdd3a6ea5f82 a <http://portal.g-node.org/odml/terminologies/v1.0/terminologies.xml> .
odml:b0d95b14-a12f-4057-aed3-fdd3a6ea5f82 a <https://terminologies.g-node.org/v1.0/terminologies.xml> .

22 changes: 11 additions & 11 deletions doc/odml_ontology/root-ontology.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ rdf:Seq rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description"^^xsd:string ;
rdfs:label "Cell" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/cell/cell.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/cell/cell.xml> .


### https://g-node.org/projects/odml-rdf#CellProperties
Expand All @@ -242,15 +242,15 @@ rdf:Seq rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description"^^xsd:string ;
rdfs:label "DataAcquisition" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/hardware/daq.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/hardware/daq.xml> .


### https://g-node.org/projects/odml-rdf#Dataset
:Dataset rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description"^^xsd:string ;
rdfs:label "Dataset" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/dataset/dataset.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/dataset/dataset.xml> .


### https://g-node.org/projects/odml-rdf#Document
Expand Down Expand Up @@ -298,23 +298,23 @@ rdf:Seq rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description"^^xsd:string ;
rdfs:label "Electrode" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/electrode/electrode.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/electrode/electrode.xml> .


### https://g-node.org/projects/odml-rdf#Hardware
:Hardware rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description"^^xsd:string ;
rdfs:label "Hardware" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/hardware/hardware.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/hardware/hardware.xml> .


### https://g-node.org/projects/odml-rdf#HardwareSettings
:HardwareSettings rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description"^^xsd:string ;
rdfs:label "HardwareSettings" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/collection/hardware_settings.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/collection/hardware_settings.xml> .


### https://g-node.org/projects/odml-rdf#Hub
Expand All @@ -338,7 +338,7 @@ rdf:Seq rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description"^^xsd:string ;
rdfs:label "Preparation" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/preparation/preparation.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/preparation/preparation.xml> .


### https://g-node.org/projects/odml-rdf#Property
Expand Down Expand Up @@ -394,7 +394,7 @@ rdf:Seq rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description"^^xsd:string ;
rdfs:label "Recording" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/recording/recording.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/recording/recording.xml> .


### https://g-node.org/projects/odml-rdf#Section
Expand Down Expand Up @@ -457,23 +457,23 @@ rdf:Seq rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description"^^xsd:string ;
rdfs:label "Setup" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/setup/setup.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/setup/setup.xml> .


### https://g-node.org/projects/odml-rdf#Stimulus
:Stimulus rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description of the Stimulus."^^xsd:string ;
rdfs:label "Stimulus" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/stimulus/stimulus.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/stimulus/stimulus.xml> .


### https://g-node.org/projects/odml-rdf#Subject
:Subject rdf:type owl:Class ;
rdfs:subClassOf :Section ;
rdfs:comment "Description"^^xsd:string ;
rdfs:label "Subject" ;
rdfs:seeAlso <http://portal.g-node.org/odml/terminologies/v1.0/subject/subject.xml> .
rdfs:seeAlso <https://terminologies.g-node.org/v1.0/subject/subject.xml> .


### https://g-node.org/projects/odml-rdf#Terminology
Expand Down
6 changes: 3 additions & 3 deletions doc/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The code for the example odML files, which we use within this tutorial is part
of the documentation package (see doc/example_odMLs/).

A summary of available odML terminologies and templates can be found `here
<http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml>`_.
<https://terminologies.g-node.org/v1.1/terminologies.xml>`_.

-------------------------------------------------------------------------------

Expand Down Expand Up @@ -221,7 +221,7 @@ them to build your own metadata odML file will be described in later chapters.
Further advanced functions you can use to navigate through your odML files, or to
create an odML template file, or to make use of common odML terminologies
provided via `the G-Node repository
<http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml>`_ can also
<https://terminologies.g-node.org/v1.1/terminologies.xml>`_ can also
be found later on in this tutorial.

But now, let us first have a look at the example odML file (THGTTG.odml)!
Expand Down Expand Up @@ -289,7 +289,7 @@ Let's check out all attributes with the following commands::
>>> print(odmlEX.parent)
None
>>> print(odmlEX.repository)
http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml
https://terminologies.g-node.org/v1.1/terminologies.xml
>>> print(odmlEX.version)
42

Expand Down
14 changes: 7 additions & 7 deletions docs/data_model.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# odml data model
# The odML data model

Data exchange requires that also annoations, metadata, are
exchanged. In oder to allow interoperability we need both a common
Data exchange requires that annotations, metadata, are also
shared. In order to allow interoperability both a common
(meta) data model, the format in which the metadata are exchanged, and
a common terminology.
a common terminology are required.

Here, we briefly describe the *odML* data model. It is based on
the idea of key-value pairs like ``temperature = 26°C``.

The model is as simple as possible while being flexible, allowing
interoperability, and being customizable. The model defines four
entities (Property, Section, Value, RootSection) whose relations and
interoperability, and being customizable. The model defines three
entities (Property, Section, Document) whose relations and
elements are shown in the figure below.

![odml_logo](images/erModel.png "odml data model")
![odml_logo](images/erModel.png "odML data model")

Property and Section are the core entities. A Section contains
Properties and can further have subsection thus building a tree-like
Expand Down
18 changes: 14 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,18 @@ It is a registered research resource with the
- [odml-ui](https://github.com/g-node/odml-ui "odml-ui - editor for odml metadata files"): Graphical editor
- [odmlTables](https://github.com/INM-6/python-odmltables) Spreadsheet interface (by INM-6 FZ JÛlich) for odml files.


### Terminologies
*odML* facilitates and encourages standardization by providing
[terminologies](https://github.com/G-Node/odml-terminologies). An
odml-file can be based on such a terminology. In that case one does
not need to provide definitions since they are part of the linked
terminology.

Existing terminologies can be browsed and imported from
[terminologies.g-node.org](https://terminologies.g-node.org).


### Templates
Templates are odML documents that can be re-used when collecting the same kind of
information over the course of multiple identical experiments.
Expand All @@ -46,7 +51,10 @@ discussed and shared at the

If you have created your own templates that others might find useful,
you are encouraged to share your templates via this repository.


Currently available odML templates can be browsed and imported from
[templates.g-node.org](https://templates.g-node.org).


* * *

Expand All @@ -67,15 +75,17 @@ pip install odml

### Python convenience scripts

The Python installation features two convenience commandline scripts.
The Python installation features multiple convenience commandline scripts.

- `odmlconversion`: Converts odML files of previous file versions into the current one.
- `odmltordf`: Converts odML files to the supported RDF version of odML.
- `odmlview`: Render and browse local XML odML files in the webbrowser.

Both scripts provide detailed usage descriptions by adding the help flag to the command.
All scripts provide detailed usage descriptions by adding the `help` flag to the command.

odmlconversion -h
odmltordf -h
odmlview -h

### odML - NIX conversion script

Expand All @@ -90,7 +100,7 @@ You can install the command line script via pip:


The script can then be run from the command line and provides a detailed usage
description by adding the help flag to the command.
description by adding the `help` flag to the command.


nixodmlconverter -h
Expand Down
Loading

0 comments on commit a5ff665

Please sign in to comment.