Browse Source

Update local odml to version 1.5.1

Julia Sprenger 3 years ago
parent
commit
44badbca05
100 changed files with 55 additions and 15534 deletions
  1. 0 35
      code/python-odml/.gitignore
  2. 0 70
      code/python-odml/.travis.yml
  3. 1 326
      code/python-odml/CHANGELOG.md
  4. 0 77
      code/python-odml/CONTRIBUTING.md
  5. 0 31
      code/python-odml/GSoC.md
  6. 1 28
      code/python-odml/LICENSE
  7. 1 3
      code/python-odml/MANIFEST.in
  8. 1 0
      code/python-odml/PKG-INFO
  9. 1 0
      code/python-odml/README.md
  10. 0 110
      code/python-odml/README.rst
  11. 0 23
      code/python-odml/appveyor.yml
  12. 0 89
      code/python-odml/doc/Makefile
  13. BIN
      code/python-odml/doc/RDF_example_graph.png
  14. 0 732
      code/python-odml/doc/RDF_tools.ipynb
  15. 0 39
      code/python-odml/doc/base-classes.rst
  16. 0 231
      code/python-odml/doc/conf.py
  17. 0 312
      code/python-odml/doc/example_odMLs/THGTTG.odml
  18. 0 343
      code/python-odml/doc/example_odMLs/sample_odml.json
  19. 0 52
      code/python-odml/doc/example_odMLs/sample_odml.odml
  20. 0 87
      code/python-odml/doc/example_odMLs/sample_odml.rdf
  21. 0 215
      code/python-odml/doc/example_odMLs/sample_odml.yaml
  22. 0 313
      code/python-odml/doc/example_odMLs/thgttg.py
  23. 0 516
      code/python-odml/doc/example_rdfs/example_data/2010-04-16-ab_cutoff_300_contrast_20%.ttl
  24. 0 647
      code/python-odml/doc/example_rdfs/example_data/drosophila_2.ttl
  25. 0 1356
      code/python-odml/doc/example_rdfs/example_data/drosophila_4.ttl
  26. 0 1355
      code/python-odml/doc/example_rdfs/example_data/drosophila_8.ttl
  27. 0 25
      code/python-odml/doc/example_rdfs/generated_rdf.xml
  28. 0 33
      code/python-odml/doc/example_rdfs/rdf_generator.py
  29. 0 86
      code/python-odml/doc/example_rdfs/sparql_example_queries.py
  30. 0 23
      code/python-odml/doc/index.rst
  31. 0 519
      code/python-odml/doc/odml_ontology/root-ontology.ttl
  32. 0 9
      code/python-odml/doc/reference.rst
  33. 0 54
      code/python-odml/doc/section_subclasses.yaml
  34. 0 57
      code/python-odml/doc/tools.rst
  35. 0 963
      code/python-odml/doc/tutorial.rst
  36. 0 4
      code/python-odml/docs/_config.yml
  37. 0 544
      code/python-odml/docs/_sass/jekyll-theme-leap-day.scss
  38. BIN
      code/python-odml/docs/assets/images/background.png
  39. BIN
      code/python-odml/docs/assets/images/g-node-logo.png
  40. BIN
      code/python-odml/docs/assets/images/g-node_logo2.png
  41. 0 22
      code/python-odml/docs/data_model.md
  42. BIN
      code/python-odml/docs/images/erModel.png
  43. BIN
      code/python-odml/docs/images/odMLLogo.png
  44. 0 106
      code/python-odml/docs/index.md
  45. 1 115
      code/python-odml/odml/__init__.py
  46. 1 633
      code/python-odml/odml/base.py
  47. 1 143
      code/python-odml/odml/doc.py
  48. 1 253
      code/python-odml/odml/dtypes.py
  49. 1 48
      code/python-odml/odml/fileio.py
  50. 1 191
      code/python-odml/odml/format.py
  51. 1 16
      code/python-odml/odml/info.json
  52. 1 15
      code/python-odml/odml/info.py
  53. 1 660
      code/python-odml/odml/property.py
  54. 1 0
      code/python-odml/odml/rdf/__init__.py
  55. 1 0
      code/python-odml/odml/rdf/fuzzy_finder.py
  56. 1 0
      code/python-odml/odml/rdf/query_creator.py
  57. 1 0
      code/python-odml/odml/resources/odml-ontology.ttl
  58. 1 0
      code/python-odml/odml/resources/section_subclasses.yaml
  59. 1 0
      code/python-odml/odml/scripts/__init__.py
  60. 0 127
      code/python-odml/odml/scripts/odml_conversion.py
  61. 1 0
      code/python-odml/odml/scripts/odml_convert.py
  62. 1 156
      code/python-odml/odml/scripts/odml_to_rdf.py
  63. 1 0
      code/python-odml/odml/scripts/odml_view.py
  64. 1 640
      code/python-odml/odml/section.py
  65. 1 0
      code/python-odml/odml/templates.py
  66. 1 110
      code/python-odml/odml/terminology.py
  67. 1 0
      code/python-odml/odml/tools/__init__.py
  68. 1 0
      code/python-odml/odml/tools/converters/__init__.py
  69. 1 0
      code/python-odml/odml/tools/converters/format_converter.py
  70. 1 0
      code/python-odml/odml/tools/converters/version_converter.py
  71. 1 208
      code/python-odml/odml/tools/dict_parser.py
  72. 1 31
      code/python-odml/odml/tools/doc_inherit.py
  73. 1 47
      code/python-odml/odml/tools/dumper.py
  74. 0 150
      code/python-odml/odml/tools/format_converter.py
  75. 0 207
      code/python-odml/odml/tools/fuzzy_finder.py
  76. 1 199
      code/python-odml/odml/tools/odmlparser.py
  77. 1 20
      code/python-odml/odml/tools/parser_utils.py
  78. 0 284
      code/python-odml/odml/tools/query_creator.py
  79. 1 314
      code/python-odml/odml/tools/rdf_converter.py
  80. 1 465
      code/python-odml/odml/tools/version_converter.py
  81. 1 342
      code/python-odml/odml/tools/xmlparser.py
  82. 1 0
      code/python-odml/odml/util.py
  83. 1 299
      code/python-odml/odml/validation.py
  84. 1 0
      code/python-odml/setup.cfg
  85. 1 52
      code/python-odml/setup.py
  86. 0 0
      code/python-odml/test/__init__.py
  87. 1 311
      code/python-odml/test/resources/example.odml
  88. 1 0
      code/python-odml/test/resources/ignore_errors.xml
  89. 1 5
      code/python-odml/test/resources/invalid_root.xml
  90. 1 9
      code/python-odml/test/resources/invalid_version.json
  91. 1 5
      code/python-odml/test/resources/invalid_version.xml
  92. 1 6
      code/python-odml/test/resources/invalid_version.yaml
  93. 1 6
      code/python-odml/test/resources/local_repository_file_v1.0.xml
  94. 1 6
      code/python-odml/test/resources/local_repository_file_v1.1.xml
  95. 1 6
      code/python-odml/test/resources/missing_root.json
  96. 1 2
      code/python-odml/test/resources/missing_root.yaml
  97. 1 8
      code/python-odml/test/resources/missing_version.json
  98. 1 5
      code/python-odml/test/resources/missing_version.xml
  99. 1 5
      code/python-odml/test/resources/missing_version.yaml
  100. 0 0
      code/python-odml/test/resources/scripts/odml_convert/conversion_example_A.xml

+ 0 - 35
code/python-odml/.gitignore

@@ -1,35 +0,0 @@
-# python files and dirs
-*.pyc
-*.pyo
-*.egg
-*.egg-info
-dist
-build
-eggs
-.eggs
-parts
-
-# odml files
-# *.odml
-
-# Include a sample file
-!THGTTG.odml
-
-# installer logs
-pip-log.txt
-
-# Unit test / coverage reports
-.coverage
-.tox
-.cache
-
-# temp files
-*~
-*.log
-
-# idea / pycharm files
-.idea
-*.iml
-
-# doc/_build files
-doc/_build/

+ 0 - 70
code/python-odml/.travis.yml

@@ -1,70 +0,0 @@
-sudo: required
-dist: trusty
-
-language: python
-
-matrix:
-  include:
-    - os: linux
-      python: "2.7"
-      env: COVERALLS=1
-    - os: linux
-      python: "3.4"
-    - os: linux
-      python: "3.5"
-    - os: linux
-      python: "3.6"
-
-    - os: osx
-      language: generic
-      env:
-        - OSXENV=3.6.0
-    - os: osx
-      language: generic
-      env:
-        - OSXENV=2.7.14
-
-install:
-  - export PYVER=${TRAVIS_PYTHON_VERSION:0:1}
-  - if [ $PYVER = 3 ]; then
-      export PYCMD=python3;
-      export PIPCMD=pip3;
-    else
-      export PYCMD=python;
-      export PIPCMD=pip;
-    fi;
-
-  - if [ $COVERALLS = 1 ]; then
-        $PIPCMD install --upgrade coveralls;
-    fi;
-
-  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
-      brew update;
-      brew install pyenv;
-      brew upgrade pyenv;
-      brew install pyenv-virtualenv;
-      eval "$(pyenv init -)";
-      eval "$(pyenv virtualenv-init -)";
-      pyenv install $OSXENV;
-      pyenv virtualenv $OSXENV venv;
-      pyenv activate venv;
-      which python;
-      python --version;
-      which pip;
-      export PYCMD=python;
-      export PIPCMD=pip;
-    fi;
-
-  - $PIPCMD install lxml enum34 pyyaml rdflib
-
-script:
-  - which $PYCMD
-  - $PYCMD setup.py build
-  - if [ $COVERALLS = 1 ]; then
-        coverage${PYVER} run --source=odml setup.py test && coverage${PYVER} report -m;
-    else
-        $PYCMD setup.py test;
-    fi;
-
-after_success:
-- if [ $COVERALLS = 1 ]; then coveralls; fi;

+ 1 - 326
code/python-odml/CHANGELOG.md

@@ -1,326 +1 @@
-# Changelog
-
-Used to document all changes from previous releases and collect changes 
-until the next release.
-
-# Latest changes in master
-
-...
-
-# Version 1.4.2
-
-## Print methods
-
-`pprint` methods have been added to both `Section` and `Property`
-to print whole Section trees with their child sections and properties.
-The `__repr__` style of `Section` and `Property` has been changed to
-be more similar to the [nixpy](https://github.com/G-Node/nixpy) `__repr__` style.
-Printing a `Section` now also features the immediate `Property` child count
-in addition to the immediate `Section` child count. See #309.
-
-## Deprecation of 'Property.value' in favor of 'Property.values'
-
-To make working with odML more similar to working with the 
-metadata part of [nixpy](https://github.com/G-Node/nixpy), the `Property.value` 
-attribute has been marked deprecated and the `Property.values` 
-attribute has been added. See #308. 
-
-## Uncertainty changes
-
-Uncertainty is now limited to float only. See #294.
-
-## Version converter changes
-
-The VersionConverter dealt with an edge case of XML test files with opening <B0> tags 
-that were missing their closing tag rendering them broken. Catching this one edge case 
-circumvented opening XML files via lxml, leaving the resulting document open to various 
-encoding problems.
-
-Support to resolve the specific tag edge cases is dropped in favour of properly opening 
-XML files via lxml. See #301.
-
-## Additional console script
-
-The `odmlconversion` convenience console script has been added to convert multiple 
-previous odML version files to the latest odML version.
-
-## Changes in cloning behaviour
-
-When cloning a `Section` or a `Property` by default the id of any object is changed
-to a new UUID. The cloning methods now feature a new `keep_id` attribute. If set to
-`True`, the cloned object and any cloned children retain their original id. This
-is meant to create exact copies of Section-Property trees in different documents.
-
-## Additional validation
-
-When a document is saved, a new validation check makes sure, that a document
-contains only unique UUIDs this is required due to the introduction of creating
-clones with identical ids. 
-
-
-# Version 1.4.1
-
-## Dependency changes
-
-- `pyyaml` was version fixed on 3.13 to circumvent introduced breaking changes in the library. See #291, #292, #296, #298.
-- `docopt` was added to support console scripts
-
-## Converter and Parser fixes
-
-- Fixes that an XML file with an UTF-8 encoding file header was not being properly parsed by the `VersionConverter` XML parser. See #288, #296.
-- Fixes the `XMLParser` that when reading a single string value from csv which contains commata, it now remains a single value and is not split up at each comma. See #295, #296.
-- In the `XMLParser` any leading or trailing whitespaces are removed from any string values when it is written to csv. Along the same lines, multiple values that are saved to file via the `VersionConverter` do not contain leading whitespaces any longer. See #296.
-- Thorough encoding and usage of `unicode` has been introduced to all Parsers and Converters to avoid encoding errors with Python 2 and Python 3. See #297.
-
-## Changes in `Section` and `Property` SmartList
-
-- Adds `SmartList.sort()`. By default `Document` and `Section` child lists will retain the order in which child elements were added, but now a sort by name can be manually triggered. See #290.
-- Adds `SmartList` comparison magic methods to partially address #265. The introduction of the RDF backend led to an issue when comparing odML entities. The used RDF library `rdflib` does not respect child order upon loading of a file, odML entities with children can not be compared without sorting the child elements. The added magic methods sort child elements by name before comparison without changing the actual order of the child elements. This only addresses the issue for `Section` and `Property` child lists, but does not solve the problem for the order of `Property.values`. See #290.
-
-## Document format update
-
-- A new private attribute `_origin_file_name` is added to the `Document` entity. When an odML document is loaded from file, this attribute is now set with the file name from whence the document was loaded. See #297.
-
-## RDF format changes
-
-- The RDF class `Seq` is now used instead of `Bag` to store `odml.Property` values to respect the order of values. See #292.
-- Since `rdflib` currently does not support proper `Seq` behaviour with RDF `li` items, for now the index of the value items will be manually written as RDF properties, which `rdflib` supports when reading an RDF file. See #292.
-- When writing an RDF file from an odML document that features an `_origin_file_name`, the value is exported as `odml:hasFileName`. See #297.
-- `xml` is now the default `ODMLWriter` format when writing a document to RDF since the XML format of RDF is still the format with the broadest acceptance. See #297.
-
-## Addition of console scripts
-
-- The `odmltordf` convenience console script has been added to convert multiple odML files to the RDF format from any odML format or version. See #298.
-
-
-# Version 1.4.0
-## Breaking changes
-
-The switch from odML version 1.3 to 1.4 contains many cool updates which should make work more comfortable, but also includes some breaking changes.
-
-### Update of the odML file format version
-- The odML format version number in odML files has changed from "1" to "1.1".
-
-### Changes in odML classes
-- The odML class hierarchy has been flattened:
-  - removing `base._baseobj` class, leaving `BaseObject` as the root odML class.
-  - removing `doc.Document` class, leaving `BaseDocument` as the only odML Document class.
-  - removing `section.Section` class, leaving `BaseSection` as the only odML Section class.
-  - removing `property.Property` class leaving `BaseProperty` as the only odML Property class.
-- `baseobject` and `sectionable` are renamed to `BaseObject` and `Sectionable` respectively.
-- `base.SafeList` and `base.SmartList` have been merged, `base.SafeList` has been removed.
-- `base.SmartList` can now only contain Sections or Properties. See #272.
-- The `reorder` method is moved from the `base` to the `Section` class. See #267.
-
-### Changes in Value handling: 
-- The `Value` class has been removed.
-- `Property.value` now always holds a list of uniform values. `Property.value` always 
-    returns a copy of the actual value list. See #227.
-- Values can only be changed directly via the `__setitem__` method of a `Property`
-- `Value` attributes `uncertainty`, `unit`, `dtype` and `reference` have been moved to 
-    `Property` and now apply to all values of the `Property.value` list.
-- The `Value` attributes `filename`, `encoder` and `checksum` have been removed.
-
-### DType changes:
-- The `binary` dtype has been removed. Providing binary content via odML files is 
-    discouraged in favor of providing a reference to the origin files using the `URL` 
-    dtype instead.
-
-### Mapping
-- Any `mapping` functionality has been removed.
-
-### Minor breaking changes
-- `XMLReader.fromFile()` and `.fromString()` have been renamed to `.from_file()` and `.from_string()` respectively.
-
-
-## Features and changes
-
-### Required odML entity attributes handling
-- Required attributes of odML entities in `odml.format` where changed: `Section.name`, 
-    `Section.type` and `Property.name` are the only attributes set to be required for 
-    their respective odML entities. See #240.
-- `Section.name` and `Property.name` can now be `None` on init. If this is the case, the 
-    entities' `id` value is used as `name` value.
-- Hardcoded checks for existing `name` attributes in the XML Parser are removed. Only 
-    attributes set as required in `format` are now used to check for missing required odML 
-    entity attributes. See #241.
-- The `name` attribute of a `Section` or a `Property` can now only be rewritten if there 
-    is no sibling with the same name on the same hierarchical level. See #283.
-
-### Addition of the 'id' attribute
-- `Document`, `Section` and `Property` now have an `id` attribute to uniquely identify any 
-    entity. If no valid id is provided when an entity is initialized, an id is 
-    automatically generated and assigned.
-- Adding the `new_id()` method to `Document`, `Section` and `Property` which generates 
-    and sets a new valid id for any entity. See #262.
-
-### Changes in DType handling
-- Setting a dtype now also supports odML style tuple types. See #254.
-- DTypes now always return the defined default values if a value is `None` or `""`.
-- Any boolean dtype value other than `"false", "f", 0, False, "true", "t", 1` or `True` 
-    will now raise a `ValueError`. See #224
-
-### 'base.Sectionable' (Document and Section) changes
-- Adds a `base.Sectionable.extend` method for child Sections and Properties. See #237.
-- Refactors the `base.Sectionable.insert` and `.append` methods. Only proper 
-    `BaseSections` with a unique name can be added to the Section child list of a 
-    `Sectionable`.
-- Appending multiple Sections or Properties has been removed from the `append` method to 
-    mirror Property `append` functionality and since `extend` now serves this need.
-
-### 'Section' and 'Property' merge 
-- `Property` now provides a `merge` method to merge two properties. This will sync all but 
-    the dependency and dependencyValue attributes. ValueErrors are raised, if information 
-    is set in both properties but are in conflict. See #221.
-- Adds a `Section.merge_check()` method which validates whether a Section including all 
-    its sub-sections and sub-properties can properly be merged. A `ValueError` is raised 
-    if any potential merge problem arises. This is necessary since a recursive Section 
-    merge cannot be easily rolled back once begun.
-- A Section merge imports `reference` and `definition` from the "source" Section if they 
-    were `None` in the "destination" Section. See #273.
-- Adds a `strict` flag to any `merge` method. Now all `Section` and `Property` attribute 
-    checks during a merge will only be done, if `strict=True`. On `strict=False` a 
-    `Section` or `Property` attribute will only be replaced with the "source" value, if 
-    the "destination" value is `None`. Otherwise the "destination" value will be kept and 
-    the "source" value lost. See #270.
-
-### Changes of 'Section' and 'Property' clone
-- When a `Section` or a `Property` is cloned, a new id is set for the clone and of any 
-    cloned children. See #259.
-
-### 'Document' changes
-- Tuples of Sections can now no longer be used with `Document.append` since 
-    `Document.extend` should be used to add multiple new Sections to a Document.
-
-### 'Section' changes
-- Adds a `Section.extend` method.
-
-### 'Property' changes
-- `Property` has the new attribute `value_origin` which may contain the origin of the 
-    property's value e.g. a filename.
-- `Property` init now supports setting all attributes as well as its parent.
-- `Property` now provides `append`, `extend` and `remove` methods to change the actual 
-    value list. This approach is required to ensure DType checks when adding new values 
-    to an existing list. See #223. 
-- Only valid dtypes can now be set on `Property` init. See #253.
-
-### Terminology changes
-- The default odML terminology repository is set to `http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml`.
-
-### Changes in Tools and IO
-- The `XMLParser` can now be run in warning mode: any errors encountered during parsing 
-    will just print a warning, but will not stop and exit during the parsing process.
-- An odML document can now only be saved, if the validation does not show any errors. 
-    Saving an invalid document will stop the process before saving and print all 
-    encountered errors.
-- All parsers are now more relaxed when encountering unsupported or missing tags and only 
-    print warnings instead of ending with an exception. Warnings are collected and can be 
-    accessed via the parser object.
-- When trying to open a file with any of the odML parsers, the document format version 
-    number is checked. If the version number does not match the supported one, file 
-    loading will fail with an exception. 
-
-## New tools
-- Added the `tools.RDFWriter` and `toosl.RDFReader` classes, which enable the export of 
-    odML documents to RDF and also provides the used ontology OWL file at `doc/odml_terminology/`.
-- Added the `tools.ODMLWriter` and `tools.ODMLReader` classes which serve as an easy 
-    entry point to saving and loading for all the supported file formats `XML`, `YAML`, 
-    `JSON` and `RDF`.
-- Added the `tools.DictWriter` and `tools.DictReader` classes which convert Python 
-    dictionary data to odML data and vice versa, which in turn is required for both YAML 
-    and JSON format loading and saving.
-- Removed the `tools.jsonparser` file which is no longer required due to the classes in 
-    `tools.odmlparser` and `tools.dict_parser`. 
-- Added the `tools.FormatConverter` class which enables batch conversion of one odML 
-    format into another.
-- Added the `tools.VersionConverter` class which enables conversion of pre-v1.4 odML files 
-    into valid v1.4 odML.
-  - The `VersionConverter` converts `XML`, `JSON` and `YAML` based odML files of odML file 
-        version 1.0 to odML file version 1.1.
-  - Only attributes supported by `Document`, `Section` and `Property` are exported. Any 
-        non supported attribute will produce a warning message, the content will be 
-        discarded.
-  - The value content is moved from a `Value` object to its parent `Property` value list.
-  - The first encountered `unit` or `uncertainty` of values of a `Property` will be moved 
-        to its parent `Property`. Any differing subsequent `unit` or `uncertainty` of 
-        values of the same `Property` will produce a warning message, the content will be 
-        discarded.
-  - The first `filename` attribute content of a `Value` is moved to the `value_origin` 
-        attribute of its parent `Property`.
-  - Any g-node terminology URL in `repository` or `link` is updated from v1.0 to their 
-        v1.1 counterparts if available. 
-  - A `VersionConverter` object provides a `.conversion_log` list attribute to access all 
-        info and warning messages after a conversion has taken place. See #234.
-
-## Fixes
-- Various installation issues have been resolved for Linux and MacOS.
-- `False` as well as `F` are now properly converted to bool values in both 
-    Python 2 and 3. See #222.
-- Fixes saving datetime related values to JSON. See #248.
-- odML style custom tuples can now properly be saved using the `XMLParser`.
-- `Document` now properly uses the dtypes date setter on init. See #249.
-- Fixes load errors on Empty and `None` boolean and datetime related values. See #245.
-- Excludes `id` when comparing odML entities for equality. See #260.
-- When a `Property` is cloned, the parent of the clone is now properly set to `None`.
-- Avoids an `AttributeError` on `get_path()` when a `Property` has no parent. See #256.
-- Avoids an `AttributeError` on `get_merged_equivalent()` when a `Property` 
-    has no parent. See #257.
-- Avoids an error on `Property.append()`, if the dtype was not set. See #266.
-- Makes sure that `Property.append()` exits on empty values but accepts `0` and `False`.
-- Sets `Property.uncertainty` to `None` if an empty string is passed to it.
-- Changes the `Property.__init__` set attributes order: In the previous set attribute 
-    order, the repository attribute was overwritten with `None` by the `super.__init__` 
-    after it had been set.
-- Fixes set `Property.parent = None` bugs in `remove()` and `insert()` methods.
-- Consistently use relative imports to address circular imports and remove code that 
-    circumvents previous circular import errors in the `ODMLParser` class. See #199.
-- Consistently uses `BaseSection` or `BaseDocument` for isinstance checks throughout 
-    `base` instead of a mixture of `BaseSection` and `Section`.
-
-
-# Version 1.3.4
-
-## Fixes
-- Potential installation issues due to import from `info.py`.
-
-
-# Version 1.3.3
-## Features
-
-- Terminology caching and loading update.
-- Terminology section access and type listing functions.
-- Define and use common format version number for all parsers.
-- Supported format version check: When trying to open a file with any of the odml parsers, 
-    first the document format version number is checked. If the found version number does 
-    not match the supported one, file loading will fail an exception, since this is the 
-    oldest format version. If anyone tries to open a newer format, they should first 
-    update their odML package and not use this one.
-- Document saving: An odML document can now only be saved, if the validation does not show 
-    any errors. Saving an invalid document will exit while printing all encountered 
-    errors.
-- Parser: All parsers are now more relaxed when encountering unsupported tags or missing 
-    tags and only print warnings instead of ending with an exception. Warnings are 
-    collected and can be accessed via the parser object (required for display in 
-    [odml-ui](https://github.com/G-Node/odml-ui) to avoid potential loss of information).
-- Package and format information added or updated: `Version`, `Format version`, `Contact`, 
-    `Homepage`, `Author`, PyPI `Classifiers`, `Copyright`.
-- Removes the license text from `setup.py`. The license text interfered with the PyPI 
-    process in a way, that the description was not displayed on PyPI.
-- Removes the image folder from the project, since they are exclusively used in the 
-    outsourced [odml-ui](https://github.com/G-Node/odml-ui) project.
-
-## Fixes
-- Fixes a bug that prohibits the parsing of `json` or `yaml` files; #191.
-- Fixes a bug that fails parsing of `json` or `yaml` files when `Section.repository`, `Section.link` or `Section.include` are present; #194.
-
-
-# Version 1.3.2
-- Expose load, save, and display functions to top level module
-    - These functions accept a `backend` argument that specifies the parser or writer. 
-        Can be one of `XML`, `JSON`, or `YAML`.
-
-
-# Version 1.3.1
-- move ui to a separate repository https://github.com/g-node/odml-ui
-- python3 compatibility
-- add json and yaml storage backends
+/annex/objects/MD5-s34332--68d1a533e617162095054b6f31a65cc3

+ 0 - 77
code/python-odml/CONTRIBUTING.md

@@ -1,77 +0,0 @@
-How to contribute to python-odml
-================================
-
-This document gives some information about how to contribute to the odML project.
-
-
-Contributing
-------------
-
-If you want to contribute to the project please first create a fork of the repository on GitHub.
-When you are done with implementing a new feature or with fixing a bug, please send
-us a pull request.
-
-If you contribute to the project regularly, it would be very much appreciated if you
-would stick to the following development workflow:
-
-1. Select an *issue* from the issue tracker that you want to work on and assign the issue to your account.
-   If the *issue* is about a relatively complex matter or requires larger API changes the description of the
-   *issue* or its respective discussion should contain a brief concept about how the solution will look like.
-
-2. During the implementation of the feature or bug-fix add your changes in small atomic commits.
-   Commit messages should be short but expressive.
-   The first line of the message should not exceed **50** characters and the 2nd line should be empty.
-   If you want to add further text you can do so from the 3rd line on without limitations.
-   If possible reference fixed issues in the commit message (e.g. "fixes #101").
-
-3. When done with the implementation, compile and test the code.
-   If your work includes a new function or class please write a small unit test for it.
-
-4. Send us a pull request with your changes.
-   The pull request message should explain the changes and reference the *issue* addressed by your code.
-   Your pull request will be reviewed by one of our team members.
-   Pull requests should never be merged by the author of the contribution, but by another team member.
-   Merge conflicts or errors reported by travis should be resolved by the original author before the request is merged.
-
-
-Google Summer of Code contributors
----------------------
-
-Please see the corresponding [Google Summer of Code](GSoC.md) file if you are interested in contributing as part of the GSoC programme.
-
-
-The issue tracker
------------------
-
-Please try to avoid duplicates of issues. If you encounter duplicated issues, please close all of them except
-one, reference the closed issues in the one that is left open and add missing information from the closed issues
-(if necessary) to the remaining issue.
-
-Assign meaningful tags to newly crated issues and if possible assign them to milestones.
-
-
-Reviewing pull requests
------------------------
-
-Every code (even small contributions from core developers) should be added to the project via pull requests.
-Before reviewing a pull request it should pass all builds and tests on travis-ci.
-Each pull request that passes all builds and tests should be reviewed by at least one of the core developers.
-If a contribution is rather complex or leads to significant API changes, the respective pull request should be
-reviewed by two other developers.
-In such cases the first reviewer or the contributor should request a second review in a comment.
-
-
-Testing
--------
-
-* Unit test can be found in the test sub directory. Currently, the test coverage is a bit low but we are working on improving it.
-
-* Provide a unit test for every class, method or function.
-
-* Please make sure that all tests pass before merging/sending pull requests.
-
-
-Style guide
------------
-
-Always keep your code PEP8 compliant.

+ 0 - 31
code/python-odml/GSoC.md

@@ -1,31 +0,0 @@
-Google Summer of Code contributions
-===================================
-
-
-General guidelines
-------------------
-
-Google Summer of Code candidates should follow the [general contribution guidelines](CONTRIBUTING.md) before beginning work on an issue and submitting pull requests.
-Students interested in working on python-odml as part of GSoC 2017 should read the guidelines described in the [GSoC student guide](http://write.flossmanuals.net/gsocstudentguide/making-first-contact/) regarding making first contact.
-They're quite useful for general open source contributions as well.
-
-
-Open communication
-------------------
-
-The GSoC programme encourages open communication and so do we.
-While directly contacting the mentors may get a response, please refrain from doing so unless discussing personal matters.
-For all topics regarding the project, issues, patches, preparing proposals, please use the [discussion thread on Trellis](https://www.trelliscience.com/#/discussions-about/13798/0), or comment directly on a relevant issue or pull request, whichever is more appropriate.
-
-There is a #gnode IRC channel on Freenode which you may join for more casual discussions with the team.
-
-
-Discussion venues
------------------
-
-Please keep discussion topics in their relevant venue.
-Thoughts and concerns regarding python-odml should be discussed in GitHub issues.
-Project ideas should be discussed on Trellis.
-Less formal discussions can be had in the IRC chatroom.
-If you are new to IRC, this [etiquette guide](https://github.com/fizerkhan/irc-etiquette) may be useful.
-

+ 1 - 28
code/python-odml/LICENSE

@@ -1,28 +1 @@
-Copyright (c) 2011-2018, German Neuroinformatics Node (G-Node)
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-3. All advertising materials mentioning features or use of this software
-   must display the following acknowledgement:
-   This product includes software developed by the G-Node.
-4. Neither the name of the G-Node nor the
-   names of its contributors may be used to endorse or promote products
-   derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY G-NODE ''AS IS'' AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL G-NODE BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/annex/objects/MD5-s1635--3dafc3c7105fee857cd2bb5729f8ce57

+ 1 - 3
code/python-odml/MANIFEST.in

@@ -1,3 +1 @@
-include LICENSE
-include README.rst
-include odml/info.json
+/annex/objects/MD5-s132--fee5f475668383a29ce685aedfab54ce

+ 1 - 0
code/python-odml/PKG-INFO

@@ -0,0 +1 @@
+/annex/objects/MD5-s7101--cd4e05ece5ebb844c5b16eeb1258d5c5

+ 1 - 0
code/python-odml/README.md

@@ -0,0 +1 @@
+/annex/objects/MD5-s5181--f228d84edfaf6f7251ee9f50815ed694

+ 0 - 110
code/python-odml/README.rst

@@ -1,110 +0,0 @@
-.. image:: https://travis-ci.org/G-Node/python-odml.svg?branch=master
-    :target: https://travis-ci.org/G-Node/python-odml
-.. image:: https://ci.appveyor.com/api/projects/status/2wfvsu7boe18kwjy?svg=true
-    :target: https://ci.appveyor.com/project/mpsonntag/python-odml
-.. image:: https://coveralls.io/repos/github/G-Node/python-odml/badge.svg?branch=master
-    :target: https://coveralls.io/github/G-Node/python-odml?branch=master
-
-odML (Open metaData Markup Language) core library
-=================================================
-
-The open metadata Markup Language is a file based format (XML, JSON, YAML) for storing
-metadata in an organised human- and machine-readable way. odML is an initiative to define
-and establish an open, flexible, and easy-to-use format to transport metadata.
-
-The Python-odML library can be easily installed via :code:`pip`. The source code is freely
-available on `GitHub <https://github.com/G-Node/python-odml>`_. If you are not familiar
-with the version control system **git**, but still want to use it, have a look at the
-documentation available on the `git-scm website <https://git-scm.com/>`_.
-
-
-Breaking changes
-----------------
-
-odML Version 1.4 introduced breaking format and API changes compared to the previous
-versions of odML. Files saved in the previous format versions can be converted to a 1.4
-compatible format using the version converter from the odml/tools package.
-
-Be aware that the value dtype :code:`binary` has been removed. Incorporating actual binary
-data into odML files is discouraged, provide references to the original files using the
-:code:`URL` dtype instead.
-
-For details regarding the introduced changes please check the `github release notes
-<https://github.com/G-Node/python-odml/releases>`_.
-
-
-Dependencies
-------------
-
-* Python 2.7 or 3.5
-* Python packages:
-
-  * enum (version 0.4.4)
-  * lxml (version 3.7.2)
-  * yaml (version 3.12)
-  * rdflib (version >=4.2.2)
-
-* These packages will be downloaded and installed automatically if the :code:`pip`
-  method is used to install odML. Alternatively, they can be installed from the OS
-  package manager. On Ubuntu, they are available as:
-
-  * python-enum
-  * python-lxml
-  * python-yaml
-  * python-rdflib
-
-* If you prefer installing using the Python package manager, the following packages are
-  required to build the lxml Python package on Ubuntu 14.04:
-
-  * libxml2-dev
-  * libxslt1-dev
-  * lib32z1-dev
-
-
-Installation
-------------
-
-The simplest way to install Python-odML is from PyPI using the pip tool::
-
-  $ pip install odml
-
-On Ubuntu, the pip package manager is available in the repositories as :code:`python-pip`.
-
-If this method is used, the appropriate Python dependencies are downloaded and installed
-automatically.
-
-
-Building from source
---------------------
-
-To download the Python-odML library please either use git and clone the
-repository from GitHub::
-
-  $ git clone https://github.com/G-Node/python-odml.git
-
-If you don't want to use git download the ZIP file also provided on
-GitHub to your computer (e.g. as above on your home directory under a "toolbox"
-folder).
-
-To install the Python-odML library, enter the corresponding directory and run::
-
-  $ cd python-odml
-  $ python setup.py install
-
-**Note** The master branch is our current development branch, not all features might be
-working as expected. Use the release tags instead.
-
-odML Project page
------------------
-
-More information about the project including related projects as well as tutorials and
-examples can be found at our odML `project page <https://g-node.github.io/python-odml>`_.
-
-Bugs & Questions
-----------------
-
-Should you find a behaviour that is likely a bug, please file a bug report at
-`the github bug tracker <https://github.com/G-Node/python-odml/issues>`_.
-
-If you have questions regarding the use of the library, feel free to join the
-`#gnode <http://webchat.freenode.net?channels=%23gnode>`_ IRC channel on freenode.

+ 0 - 23
code/python-odml/appveyor.yml

@@ -1,23 +0,0 @@
-environment:
-  matrix:
-    - PYTHON: "C:\\Python27"
-      PYVER: "2.7"
-    - PYTHON: "C:\\Python35"
-      PYVER: "3.5"
-    - PYTHON: "C:\\Python36"
-      PYVER: "3.6"
-    - PYTHON: "C:\\Python27-x64"
-      PYVER: "2.7"
-    - PYTHON: "C:\\Python35-x64"
-      PYVER: "3.5"
-    - PYTHON: "C:\\Python36-x64"
-      PYVER: "3.6"
-
-build: false
-
-install:
-  - python -m pip install lxml enum34 pyyaml rdflib
-
-test_script:
-  - python --version
-  - python setup.py test

+ 0 - 89
code/python-odml/doc/Makefile

@@ -1,89 +0,0 @@
-# Makefile for Sphinx documentation
-#
-
-# You can set these variables from the command line.
-SPHINXOPTS    =
-SPHINXBUILD   = sphinx-build
-PAPER         =
-BUILDDIR      = _build
-
-# Internal variables.
-PAPEROPT_a4     = -D latex_paper_size=a4
-PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
-
-.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest
-
-help:
-	@echo "Please use \`make <target>' where <target> is one of"
-	@echo "  html      to make standalone HTML files"
-	@echo "  dirhtml   to make HTML files named index.html in directories"
-	@echo "  pickle    to make pickle files"
-	@echo "  json      to make JSON files"
-	@echo "  htmlhelp  to make HTML files and a HTML help project"
-	@echo "  qthelp    to make HTML files and a qthelp project"
-	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
-	@echo "  changes   to make an overview of all changed/added/deprecated items"
-	@echo "  linkcheck to check all external links for integrity"
-	@echo "  doctest   to run all doctests embedded in the documentation (if enabled)"
-
-clean:
-	-rm -rf $(BUILDDIR)/*
-
-html:
-	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
-	@echo
-	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
-
-dirhtml:
-	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
-	@echo
-	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
-
-pickle:
-	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
-	@echo
-	@echo "Build finished; now you can process the pickle files."
-
-json:
-	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
-	@echo
-	@echo "Build finished; now you can process the JSON files."
-
-htmlhelp:
-	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
-	@echo
-	@echo "Build finished; now you can run HTML Help Workshop with the" \
-	      ".hhp project file in $(BUILDDIR)/htmlhelp."
-
-qthelp:
-	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
-	@echo
-	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
-	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
-	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/python-odml.qhcp"
-	@echo "To view the help file:"
-	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/python-odml.qhc"
-
-latex:
-	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
-	@echo
-	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
-	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
-	      "run these through (pdf)latex."
-
-changes:
-	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
-	@echo
-	@echo "The overview file is in $(BUILDDIR)/changes."
-
-linkcheck:
-	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
-	@echo
-	@echo "Link check complete; look for any errors in the above output " \
-	      "or in $(BUILDDIR)/linkcheck/output.txt."
-
-doctest:
-	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
-	@echo "Testing of doctests in the sources finished, look at the " \
-	      "results in $(BUILDDIR)/doctest/output.txt."

BIN
code/python-odml/doc/RDF_example_graph.png


+ 0 - 732
code/python-odml/doc/RDF_tools.ipynb

@@ -1,732 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "# What is Semantic Web and RDF?"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "**RDF (Resource Description Framework)** is one of the three foundational [Semantic Web](https://en.wikipedia.org/wiki/Semantic_Web) technologies, the other two being SPARQL and OWL.\n",
-    "\n",
-    "In particular, RDF is the data model of the Semantic Web. That means that all data in Semantic Web technologies is represented as RDF. If you store Semantic Web data, it's in RDF. If you query Semantic Web data (typically using SPARQL), it's RDF data. If you send Semantic Web data to your friend, it's RDF.\n",
-    "\n",
-    "RDF data model is based upon the idea of making statements about resources (in particular web resources) in the form of *subject–predicate–object* expressions, known as [*triples*](https://en.wikipedia.org/wiki/Semantic_triple). The *subject* denotes the resource, and the *predicate* denotes traits or aspects of the resource, and expresses a relationship between the *subject* and the *object*.\n",
-    "\n",
-    "For example, one way to represent the notion \"The sky has the color blue\" in RDF is as the triple: a **subject** denoting *\"the sky\"*, a **predicate** denoting *\"has the color\"*, and an **object** denoting *\"blue\"*. Therefore, RDF uses subject instead of object(or entity) in contrast to the typical approach of an entity–attribute–value model in object-oriented design: entity (sky), attribute (color), and value (blue). <br>\n",
-    "(Resource Description Framework, Wikipedia, 2017)"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "![RDF_example_graph.png](RDF_example_graph.png)"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "Find out more: <br>\n",
-    "- http://fast.wistia.net/embed/iframe/8nm9xf4jip?popover=true <br>\n",
-    "- https://en.wikipedia.org/wiki/Resource_Description_Framework <br>\n",
-    "- https://www.cambridgesemantics.com/semantic-university/rdf-101 <br>\n",
-    "- http://www.cambridgesemantics.com/semantic-university/introduction-semantic-web-0"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {
-    "collapsed": true
-   },
-   "source": [
-    "# RDF<->odML converter"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "Here we will explore RDF-odML and odML-RDF conversion in `odml/tools/rdf_converter.py` module.\n",
-    "\n",
-    "If you are new python odML please read the tutorial first:\n",
-    "https://g-node.github.io/python-odml/tutorial.html"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "Let's create the example odML document."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 1,
-   "metadata": {
-    "collapsed": true
-   },
-   "outputs": [],
-   "source": [
-    "import os\n",
-    "os.chdir('..')\n",
-    "\n",
-    "import odml\n",
-    "import datetime\n",
-    "\n",
-    "doc = odml.Document(author=\"D. N. Adams\",\n",
-    "                    date=datetime.date(1979, 10, 12))\n",
-    "\n",
-    "# CREATE AND APPEND THE MAIN SECTIONs\n",
-    "doc.append(odml.Section(name=\"Arthur Philip Dent\",\n",
-    "                           type=\"crew/person\",\n",
-    "                           definition=\"Information on Arthur Dent\"))\n",
-    "\n",
-    "# SET NEW PARENT NODE\n",
-    "parent = doc['Arthur Philip Dent']\n",
-    "\n",
-    "\n",
-    "# APPEND PROPERTIES WITH VALUES\n",
-    "parent.append(odml.Property(name=\"Species\",\n",
-    "                            value=\"Human\",\n",
-    "                            dtype=odml.DType.string,\n",
-    "                            definition=\"Species to which subject belongs to\"))"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## RDFWriter class"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "RDFWriter class is used for conversion documents from odML to one of the supported RDF formats:<br>\n",
-    "'xml', 'pretty-xml', 'trix', 'n3', 'turtle', 'ttl', 'ntriples', 'nt', 'nt11', 'trig', 'json-ld'.<br>\n",
-    "Both one document or list of multiple documents can be passed to `RDFWriter()` constructor.\n",
-    "\n",
-    "It's possible to get the output as a string."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 2,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "@prefix odml: <https://g-node.org/projects/odml-rdf#> .\n",
-      "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n",
-      "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n",
-      "@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n",
-      "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n",
-      "\n",
-      "odml:Hub odml:hasDocument <https://g-node.org/projects/odml-rdf#02e1d29e-937d-4de7-a83e-3e756d954c92> .\n",
-      "\n",
-      "<https://g-node.org/projects/odml-rdf#02e1d29e-937d-4de7-a83e-3e756d954c92> a odml:Document ;\n",
-      "    odml:hasAuthor \"D. N. Adams\" ;\n",
-      "    odml:hasDate \"1979-10-12\"^^xsd:date ;\n",
-      "    odml:hasSection odml:f3de1e21-f6f5-4eae-8f58-db94ee10f812 .\n",
-      "\n",
-      "<https://g-node.org/projects/odml-rdf#8e59c55a-ac69-4b71-b101-61f3b8b8590f> a rdf:Bag ;\n",
-      "    rdf:li \"Human\" .\n",
-      "\n",
-      "odml:c46a5ee8-811a-4947-8e4b-7f164fbf4c8a a odml:Property ;\n",
-      "    odml:hasDefinition \"Species to which subject belongs to\" ;\n",
-      "    odml:hasDtype \"string\" ;\n",
-      "    odml:hasName \"Species\" ;\n",
-      "    odml:hasValue <https://g-node.org/projects/odml-rdf#8e59c55a-ac69-4b71-b101-61f3b8b8590f> .\n",
-      "\n",
-      "odml:f3de1e21-f6f5-4eae-8f58-db94ee10f812 a odml:Section ;\n",
-      "    odml:hasDefinition \"Information on Arthur Dent\" ;\n",
-      "    odml:hasName \"Arthur Philip Dent\" ;\n",
-      "    odml:hasProperty odml:c46a5ee8-811a-4947-8e4b-7f164fbf4c8a ;\n",
-      "    odml:hasType \"crew/person\" .\n",
-      "\n",
-      "\n"
-     ]
-    }
-   ],
-   "source": [
-    "from odml.tools.rdf_converter import RDFWriter\n",
-    "\n",
-    "print(RDFWriter(doc).get_rdf_str('turtle'))"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "Or write the output to the specified file."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 3,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "@prefix odml: <https://g-node.org/projects/odml-rdf#> .\n",
-      "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n",
-      "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n",
-      "@prefix xml: <http://www.w3.org/XML/1998/namespace> .\n",
-      "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n",
-      "\n",
-      "odml:Hub odml:hasDocument <https://g-node.org/projects/odml-rdf#02e1d29e-937d-4de7-a83e-3e756d954c92> .\n",
-      "\n",
-      "<https://g-node.org/projects/odml-rdf#02e1d29e-937d-4de7-a83e-3e756d954c92> a odml:Document ;\n",
-      "    odml:hasAuthor \"D. N. Adams\" ;\n",
-      "    odml:hasDate \"1979-10-12\"^^xsd:date ;\n",
-      "    odml:hasSection odml:f3de1e21-f6f5-4eae-8f58-db94ee10f812 .\n",
-      "\n",
-      "odml:c46a5ee8-811a-4947-8e4b-7f164fbf4c8a a odml:Property ;\n",
-      "    odml:hasDefinition \"Species to which subject belongs to\" ;\n",
-      "    odml:hasDtype \"string\" ;\n",
-      "    odml:hasName \"Species\" ;\n",
-      "    odml:hasValue odml:ddde531a-663a-46f5-b474-edbc73254077 .\n",
-      "\n",
-      "odml:ddde531a-663a-46f5-b474-edbc73254077 a rdf:Bag ;\n",
-      "    rdf:li \"Human\" .\n",
-      "\n",
-      "odml:f3de1e21-f6f5-4eae-8f58-db94ee10f812 a odml:Section ;\n",
-      "    odml:hasDefinition \"Information on Arthur Dent\" ;\n",
-      "    odml:hasName \"Arthur Philip Dent\" ;\n",
-      "    odml:hasProperty odml:c46a5ee8-811a-4947-8e4b-7f164fbf4c8a ;\n",
-      "    odml:hasType \"crew/person\" .\n",
-      "\n",
-      "\n"
-     ]
-    }
-   ],
-   "source": [
-    "import tempfile\n",
-    "import os\n",
-    "\n",
-    "# Create temporary file\n",
-    "f = tempfile.NamedTemporaryFile(mode='w', suffix=\".ttl\")\n",
-    "path = f.name\n",
-    "\n",
-    "RDFWriter(doc).write_file(path, \"turtle\")\n",
-    "\n",
-    "with open(path) as ff:\n",
-    "    data = ff.read()\n",
-    "    print(data)\n",
-    "\n",
-    "f.close()"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## RDFReader class"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {
-    "collapsed": true
-   },
-   "source": [
-    "RDFReader class enables RDF to odML conversion.\n",
-    "\n",
-    "There are 2 ways to obtain objects with converted odML documents:\n",
-    "- from **RDF file**  ( `RDFReader().from_file(\"/path_to_input_rdf\", \"rdf_format\")` )\n",
-    "- from **RDF string**  ( `RDFReader().from_string(\"rdf file as a string\", \"rdf_format\")` )"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 4,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "[<Doc None by D. N. Adams (1 sections)>]\n"
-     ]
-    }
-   ],
-   "source": [
-    "from odml.tools.rdf_converter import RDFReader\n",
-    "\n",
-    "rdf_file = RDFWriter(doc).get_rdf_str('turtle')\n",
-    "odml_doc = RDFReader().from_string(rdf_file, \"turtle\")\n",
-    "\n",
-    "print(odml_doc)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 5,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "[<Doc None by D. N. Adams (1 sections)>]\n"
-     ]
-    }
-   ],
-   "source": [
-    "# Create temporary file\n",
-    "rdf_file = tempfile.NamedTemporaryFile(mode='w', suffix=\".ttl\")\n",
-    "rdf_path = rdf_file.name\n",
-    "RDFWriter(doc).write_file(rdf_path, \"turtle\")\n",
-    "\n",
-    "odml_doc = RDFReader().from_file(rdf_path, \"turtle\")\n",
-    "\n",
-    "print(odml_doc)"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "Another option is to write the output to one or multiple files. <br>\n",
-    "`RDFReader().write_file(\"/input_path\", \"rdf_format\", \"/output_path_to_file\")`"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 6,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
-      "<?xml-stylesheet  type=\"text/xsl\" href=\"odmlTerms.xsl\"?>\n",
-      "<?xml-stylesheet  type=\"text/xsl\" href=\"odml.xsl\"?>\n",
-      "<odML version=\"1.1\">\n",
-      "  <section>\n",
-      "    <name>Arthur Philip Dent</name>\n",
-      "    <id>f3de1e21-f6f5-4eae-8f58-db94ee10f812</id>\n",
-      "    <property>\n",
-      "      <name>Species</name>\n",
-      "      <id>c46a5ee8-811a-4947-8e4b-7f164fbf4c8a</id>\n",
-      "      <value>[Human]</value>\n",
-      "      <definition>Species to which subject belongs to</definition>\n",
-      "      <type>string</type>\n",
-      "    </property>\n",
-      "    <definition>Information on Arthur Dent</definition>\n",
-      "    <type>crew/person</type>\n",
-      "  </section>\n",
-      "  <id>02e1d29e-937d-4de7-a83e-3e756d954c92</id>\n",
-      "  <date>1979-10-12</date>\n",
-      "  <author>D. N. Adams</author>\n",
-      "</odML>\n",
-      "\n"
-     ]
-    }
-   ],
-   "source": [
-    "# If RDF file contains one odML document, specify output path as file\n",
-    "odml_file = tempfile.NamedTemporaryFile(mode='w', suffix=\".odml\")\n",
-    "odml_path = odml_file.name\n",
-    "\n",
-    "RDFReader().write_file(rdf_path, \"turtle\", odml_path)\n",
-    "\n",
-    "with open(odml_path) as ff:\n",
-    "    data = ff.read()\n",
-    "    print(data)"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {
-    "collapsed": true
-   },
-   "source": [
-    "If RDF file contains several odML docs, specify output path as a directory.<br>\n",
-    "`RDFReader().write_file(\"/input_path\", \"rdf_format\", \"/output_path_to_directory\")`\n",
-    "\n",
-    "Module creates files in specified directory and writes parsed docs to them.\n",
-    "Example of created file: `/<dir_path>/doc_<id>.odml`\n",
-    "(`<id>` - id of the document)."
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## Quering the data with rdflib and SPARQL"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 3,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "Total number of triples:  3041\n"
-     ]
-    }
-   ],
-   "source": [
-    "# please run the first code snipet to change working directory if you have\n",
-    "# [Errno 2] No such file or directory: '/home/rick/g-node/python-odml/doc/doc/example_rdfs/example_data/'\n",
-    "# or insert this line after `import os`: `os.chdir('..')` below\n",
-    "from rdflib import Graph\n",
-    "import os\n",
-    "\n",
-    "graph = Graph()\n",
-    "input_dir = os.path.join(os.getcwd(), 'doc/example_rdfs/example_data/')\n",
-    "for file_name in os.listdir(input_dir):\n",
-    "    f = os.path.join(input_dir, file_name)\n",
-    "    if os.path.isfile(f):\n",
-    "        graph.parse(f, format=\"turtle\")\n",
-    "print('Total number of triples: ', len(graph))"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "Quick video about what is SPARQL: https://www.youtuboe.com/watch?v=FvGndkpa4K0 <br> <br>\n",
-    "Example query using rdflib tool to find each section with type `Recording`, that has property with the name `Recording duration` and prints its value:"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 3,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "Doc: https://g-node.org/projects/odml-rdf#cd24b60f-1d5e-4040-9881-5e5a597baef7, Sec: https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd, \n",
-      "Prop: https://g-node.org/projects/odml-rdf#9aeede78-678c-4db8-acb5-fbd6d408b762, Val:13.9\n",
-      "Doc: https://g-node.org/projects/odml-rdf#537c6cc8-7dfe-4d53-a111-24b3ce0f3c1a, Sec: https://g-node.org/projects/odml-rdf#346773f2-abee-4892-b052-840ddcff35ee, \n",
-      "Prop: https://g-node.org/projects/odml-rdf#1636af03-8e97-4ef2-9d7d-6c7db23dcd02, Val:11.88\n",
-      "Doc: https://g-node.org/projects/odml-rdf#24066355-1ee8-4eb5-a715-96bbb6231cd5, Sec: https://g-node.org/projects/odml-rdf#bbd44815-5016-49e0-9f4b-5b83778d00de, \n",
-      "Prop: https://g-node.org/projects/odml-rdf#0ed215a2-5d20-48eb-b744-bf3b731459fc, Val:0.33\n",
-      "Doc: https://g-node.org/projects/odml-rdf#cc66e78a-3742-490a-9fdb-1c66761d7652, Sec: https://g-node.org/projects/odml-rdf#5365f7e5-603c-4154-a5ea-33bb1a07a956, \n",
-      "Prop: https://g-node.org/projects/odml-rdf#41316903-80f1-45a3-9b06-400a02903531, Val:11.25\n"
-     ]
-    }
-   ],
-   "source": [
-    "from rdflib import Graph, Namespace, RDF\n",
-    "from rdflib.plugins.sparql import prepareQuery\n",
-    "\n",
-    "q = prepareQuery(\"\"\"SELECT ?d ?s ?p ?value WHERE {\n",
-    "    ?d odml:hasSection ?s .\n",
-    "    ?s rdf:type odml:Section .\n",
-    "    ?s odml:hasType \"Recording\" .\n",
-    "    ?s odml:hasProperty ?p .\n",
-    "    ?p rdf:type odml:Property .\n",
-    "    ?p odml:hasName \"Recording duration\" .\n",
-    "    ?p odml:hasValue ?v .\n",
-    "    ?v rdf:type rdf:Bag .\n",
-    "    ?v rdf:li ?value .}\"\"\", initNs={\"odml\": Namespace(\"https://g-node.org/projects/odml-rdf#\"),\n",
-    "                          \"rdf\": RDF})\n",
-    "\n",
-    "for row in graph.query(q):\n",
-    "    print(\"Doc: {0}, Sec: {1}, \\n\"\n",
-    "          \"Prop: {2}, Val:{3}\".format(row.d, row.s, row.p, row.value))"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "## FuzzyFinder class"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "**FuzzyFinder** is the tool for querying graph through *fuzzy* queries. The finder executes multiple queries to better match input parameters and returns sets of triples, prioritized from more to less amount of matched parameters. <br>\n",
-    "\n",
-    "The function `find()` accepts several oprtional parameters.\n",
-    "- `graph`: rdflib graph object\n",
-    "- `q_str`: fuzzy query string, we explore it later\n",
-    "- `q_params`: dict object with parameters of a query\n",
-    "- `mode`: default 'fuzzy' and 'match'\n",
-    "\n",
-    "Each mode works with specific type of fuzzy query (`q_str`).\n",
-    "Let's see on the `match` mode in the example:"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 4,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "SELECT * WHERE {\n",
-      "?d odml:hasSection ?s .\n",
-      "?s rdf:type odml:Section .\n",
-      "?s odml:hasType \"Recording\" .\n",
-      "?s odml:hasProperty ?p .\n",
-      "?p rdf:type odml:Property .\n",
-      "?p odml:hasName \"Date\" .\n",
-      "}\n",
-      "Document: https://g-node.org/projects/odml-rdf#cc66e78a-3742-490a-9fdb-1c66761d7652\n",
-      "Property: https://g-node.org/projects/odml-rdf#f1699eb6-4cab-4dd0-9327-120eab2089ae\n",
-      "Section: https://g-node.org/projects/odml-rdf#5365f7e5-603c-4154-a5ea-33bb1a07a956\n",
-      "Document: https://g-node.org/projects/odml-rdf#537c6cc8-7dfe-4d53-a111-24b3ce0f3c1a\n",
-      "Property: https://g-node.org/projects/odml-rdf#138f08f7-23c7-4722-8577-85a6fa633ae1\n",
-      "Section: https://g-node.org/projects/odml-rdf#346773f2-abee-4892-b052-840ddcff35ee\n",
-      "Document: https://g-node.org/projects/odml-rdf#cd24b60f-1d5e-4040-9881-5e5a597baef7\n",
-      "Property: https://g-node.org/projects/odml-rdf#1d6db4ce-87f3-4e9c-b221-e76ba05b2759\n",
-      "Section: https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd\n",
-      "Document: https://g-node.org/projects/odml-rdf#24066355-1ee8-4eb5-a715-96bbb6231cd5\n",
-      "Property: https://g-node.org/projects/odml-rdf#fadffec7-6b23-454e-bfd1-9d5884802abb\n",
-      "Section: https://g-node.org/projects/odml-rdf#bbd44815-5016-49e0-9f4b-5b83778d00de\n",
-      "\n",
-      "SELECT * WHERE {\n",
-      "?d odml:hasSection ?s .\n",
-      "?s rdf:type odml:Section .\n",
-      "?s odml:hasName \"Recording-2013-02-08-ak\" .\n",
-      "?s odml:hasType \"Recording\" .\n",
-      "}\n",
-      "Document: https://g-node.org/projects/odml-rdf#537c6cc8-7dfe-4d53-a111-24b3ce0f3c1a\n",
-      "Section: https://g-node.org/projects/odml-rdf#346773f2-abee-4892-b052-840ddcff35ee\n",
-      "\n",
-      "SELECT * WHERE {\n",
-      "?s odml:hasProperty ?p .\n",
-      "?p rdf:type odml:Property .\n",
-      "?p odml:hasName \"Date\" .\n",
-      "}\n",
-      "Property: https://g-node.org/projects/odml-rdf#1d6db4ce-87f3-4e9c-b221-e76ba05b2759\n",
-      "Section: https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd\n",
-      "Property: https://g-node.org/projects/odml-rdf#fadffec7-6b23-454e-bfd1-9d5884802abb\n",
-      "Section: https://g-node.org/projects/odml-rdf#bbd44815-5016-49e0-9f4b-5b83778d00de\n",
-      "Property: https://g-node.org/projects/odml-rdf#f1699eb6-4cab-4dd0-9327-120eab2089ae\n",
-      "Section: https://g-node.org/projects/odml-rdf#5365f7e5-603c-4154-a5ea-33bb1a07a956\n",
-      "Property: https://g-node.org/projects/odml-rdf#138f08f7-23c7-4722-8577-85a6fa633ae1\n",
-      "Section: https://g-node.org/projects/odml-rdf#346773f2-abee-4892-b052-840ddcff35ee\n",
-      "\n",
-      "SELECT * WHERE {\n",
-      "?d odml:hasSection ?s .\n",
-      "?s rdf:type odml:Section .\n",
-      "?s odml:hasName \"Recording-2013-02-08-ak\" .\n",
-      "}\n",
-      "Document: https://g-node.org/projects/odml-rdf#537c6cc8-7dfe-4d53-a111-24b3ce0f3c1a\n",
-      "Section: https://g-node.org/projects/odml-rdf#346773f2-abee-4892-b052-840ddcff35ee\n",
-      "\n",
-      "SELECT * WHERE {\n",
-      "?d odml:hasSection ?s .\n",
-      "?s rdf:type odml:Section .\n",
-      "?s odml:hasType \"Recording\" .\n",
-      "}\n",
-      "Document: https://g-node.org/projects/odml-rdf#cc66e78a-3742-490a-9fdb-1c66761d7652\n",
-      "Section: https://g-node.org/projects/odml-rdf#5365f7e5-603c-4154-a5ea-33bb1a07a956\n",
-      "Document: https://g-node.org/projects/odml-rdf#537c6cc8-7dfe-4d53-a111-24b3ce0f3c1a\n",
-      "Section: https://g-node.org/projects/odml-rdf#346773f2-abee-4892-b052-840ddcff35ee\n",
-      "Document: https://g-node.org/projects/odml-rdf#cd24b60f-1d5e-4040-9881-5e5a597baef7\n",
-      "Section: https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd\n",
-      "Document: https://g-node.org/projects/odml-rdf#24066355-1ee8-4eb5-a715-96bbb6231cd5\n",
-      "Section: https://g-node.org/projects/odml-rdf#bbd44815-5016-49e0-9f4b-5b83778d00de\n",
-      "\n",
-      "\n"
-     ]
-    }
-   ],
-   "source": [
-    "from odml.tools.fuzzy_finder import FuzzyFinder\n",
-    "\n",
-    "query_string = 'prop(name:Date) section(name:Recording-2013-02-08-ak, type:Recording)'\n",
-    "\n",
-    "f = FuzzyFinder(graph)\n",
-    "print(f.find(mode='match', q_str=query_string))"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "As you can see from the output, finder builds multiple sparql queries from 'match' queries, executes them and returns some matched results. The first result always represents the most specific query (the biggest combination of input parameters that returned at least one triple).\n",
-    "\n",
-    "The query syntax is pretty straightforward. Just write the name of the entity `property`, `section` or `document` (also possible to use shortened names `prop`, `sec` and `doc`) and add attributes with their values inside the parentheses divided by colon.\n",
-    "\n",
-    "Example from code: `prop(name:Date) section(name:Recording-2013-02-08-ak, type:Recording)`.\n",
-    "Here we search for sections and properties that `property` has attribute `name` and its value is `Date`.\n",
-    "\n",
-    "For building 'match' queries you should need to know exactly for which odML attribute the value(subject) is related. So if you write `prop(name:Date) section(name:Recording, type:Recording-2013-02-08-ak)` the `find()` method would not return any triples with section parameters. Because it's likely that there is no section with type `Recording-2013-02-08-ak`.\n",
-    "\n",
-    "Non-odML entities' attributes here also will be ignored (e.g. only `id, author, date, version, repository, sections` can exist in the `Document` object).\n",
-    "In the example `section(not-odml-name:Recording-2013-02-08-ak, record:Recording)` the find method return nothing."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 5,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "\n"
-     ]
-    }
-   ],
-   "source": [
-    "from odml.tools.fuzzy_finder import FuzzyFinder\n",
-    "\n",
-    "query_string = 'section(not-odml-name:Recording-2013-02-08-ak, record:Recording)'\n",
-    "\n",
-    "f = FuzzyFinder(graph)\n",
-    "print(f.find(mode='match', q_str=query_string))"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "metadata": {},
-   "source": [
-    "This is often inconvinient if you do not know exactly what the information is related to in the graph. For situations like this *'fuzzy'* mode comes into play. It is also set by default.\n",
-    "\n",
-    "The output logic is similair to the previous mode, but there you can provide more broad information, the finder will match the parameters and create meaningful queries based on the input.\n",
-    "\n",
-    "The query string consists of two parts: *FIND* and *HAVING*.\n",
-    "\n",
-    "In the *FIND* part a user specifies the set of odML objects and its attributes. \n",
-    "e.g. `FIND prop(name) section(name, type)`\n",
-    "\n",
-    "In the *HAVING* part a user specifies set of search values which could relate to the attributes in *FIND* part.\n",
-    "e.g `HAVING Recording, Recording-2012-04-04-ab, Date`\n",
-    "\n",
-    "Finally, the complete query will look like this:\n",
-    "`FIND sec(name, type) prop(name) HAVING Recording, Recording-2012-04-04-ab, Date`\n",
-    "\n",
-    "As you can see in the example you should not really know to which attribute search values in *HAVING* part relates to, the finder can do it for you."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 6,
-   "metadata": {},
-   "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "SELECT * WHERE {\n",
-      "?d odml:hasSection ?s .\n",
-      "?s rdf:type odml:Section .\n",
-      "?s odml:hasType \"Recording\" .\n",
-      "?s odml:hasProperty ?p .\n",
-      "?p rdf:type odml:Property .\n",
-      "?p odml:hasName \"Date\" .\n",
-      "}\n",
-      "Document: https://g-node.org/projects/odml-rdf#cc66e78a-3742-490a-9fdb-1c66761d7652\n",
-      "Property: https://g-node.org/projects/odml-rdf#f1699eb6-4cab-4dd0-9327-120eab2089ae\n",
-      "Section: https://g-node.org/projects/odml-rdf#5365f7e5-603c-4154-a5ea-33bb1a07a956\n",
-      "Document: https://g-node.org/projects/odml-rdf#537c6cc8-7dfe-4d53-a111-24b3ce0f3c1a\n",
-      "Property: https://g-node.org/projects/odml-rdf#138f08f7-23c7-4722-8577-85a6fa633ae1\n",
-      "Section: https://g-node.org/projects/odml-rdf#346773f2-abee-4892-b052-840ddcff35ee\n",
-      "Document: https://g-node.org/projects/odml-rdf#cd24b60f-1d5e-4040-9881-5e5a597baef7\n",
-      "Property: https://g-node.org/projects/odml-rdf#1d6db4ce-87f3-4e9c-b221-e76ba05b2759\n",
-      "Section: https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd\n",
-      "Document: https://g-node.org/projects/odml-rdf#24066355-1ee8-4eb5-a715-96bbb6231cd5\n",
-      "Property: https://g-node.org/projects/odml-rdf#fadffec7-6b23-454e-bfd1-9d5884802abb\n",
-      "Section: https://g-node.org/projects/odml-rdf#bbd44815-5016-49e0-9f4b-5b83778d00de\n",
-      "\n",
-      "SELECT * WHERE {\n",
-      "?d odml:hasSection ?s .\n",
-      "?s rdf:type odml:Section .\n",
-      "?s odml:hasName \"Recording\" .\n",
-      "?s odml:hasType \"Recording\" .\n",
-      "}\n",
-      "Document: https://g-node.org/projects/odml-rdf#cd24b60f-1d5e-4040-9881-5e5a597baef7\n",
-      "Section: https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd\n",
-      "\n",
-      "SELECT * WHERE {\n",
-      "?s odml:hasProperty ?p .\n",
-      "?p rdf:type odml:Property .\n",
-      "?p odml:hasName \"Date\" .\n",
-      "}\n",
-      "Property: https://g-node.org/projects/odml-rdf#1d6db4ce-87f3-4e9c-b221-e76ba05b2759\n",
-      "Section: https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd\n",
-      "Property: https://g-node.org/projects/odml-rdf#fadffec7-6b23-454e-bfd1-9d5884802abb\n",
-      "Section: https://g-node.org/projects/odml-rdf#bbd44815-5016-49e0-9f4b-5b83778d00de\n",
-      "Property: https://g-node.org/projects/odml-rdf#f1699eb6-4cab-4dd0-9327-120eab2089ae\n",
-      "Section: https://g-node.org/projects/odml-rdf#5365f7e5-603c-4154-a5ea-33bb1a07a956\n",
-      "Property: https://g-node.org/projects/odml-rdf#138f08f7-23c7-4722-8577-85a6fa633ae1\n",
-      "Section: https://g-node.org/projects/odml-rdf#346773f2-abee-4892-b052-840ddcff35ee\n",
-      "\n",
-      "SELECT * WHERE {\n",
-      "?d odml:hasSection ?s .\n",
-      "?s rdf:type odml:Section .\n",
-      "?s odml:hasName \"Recording\" .\n",
-      "}\n",
-      "Document: https://g-node.org/projects/odml-rdf#cd24b60f-1d5e-4040-9881-5e5a597baef7\n",
-      "Section: https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd\n",
-      "\n",
-      "SELECT * WHERE {\n",
-      "?d odml:hasSection ?s .\n",
-      "?s rdf:type odml:Section .\n",
-      "?s odml:hasType \"Recording\" .\n",
-      "}\n",
-      "Document: https://g-node.org/projects/odml-rdf#cc66e78a-3742-490a-9fdb-1c66761d7652\n",
-      "Section: https://g-node.org/projects/odml-rdf#5365f7e5-603c-4154-a5ea-33bb1a07a956\n",
-      "Document: https://g-node.org/projects/odml-rdf#537c6cc8-7dfe-4d53-a111-24b3ce0f3c1a\n",
-      "Section: https://g-node.org/projects/odml-rdf#346773f2-abee-4892-b052-840ddcff35ee\n",
-      "Document: https://g-node.org/projects/odml-rdf#cd24b60f-1d5e-4040-9881-5e5a597baef7\n",
-      "Section: https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd\n",
-      "Document: https://g-node.org/projects/odml-rdf#24066355-1ee8-4eb5-a715-96bbb6231cd5\n",
-      "Section: https://g-node.org/projects/odml-rdf#bbd44815-5016-49e0-9f4b-5b83778d00de\n",
-      "\n",
-      "\n"
-     ]
-    }
-   ],
-   "source": [
-    "from odml.tools.fuzzy_finder import FuzzyFinder\n",
-    "\n",
-    "query_string = 'FIND sec(name, type) prop(name) HAVING Recording, Recording-2012-04-04-ab, Date, Some_value'\n",
-    "\n",
-    "f = FuzzyFinder(graph)\n",
-    "print(f.find(mode='fuzzy', q_str=query_string))"
-   ]
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Python 3",
-   "language": "python",
-   "name": "python3"
-  },
-  "language_info": {
-   "codemirror_mode": {
-    "name": "ipython",
-    "version": 3.0
-   },
-   "file_extension": ".py",
-   "mimetype": "text/x-python",
-   "name": "python",
-   "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython3",
-   "version": "3.5.2"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 0
-}

+ 0 - 39
code/python-odml/doc/base-classes.rst

@@ -1,39 +0,0 @@
-.. _class-reference:
-
-odML-Base Classes
-=================
-
-These classes are the core data-structures of odML.
-To sum things up, an odML-Document consists of several Sections.
-Each Section may contain other Sections and Properties.
-Again each Property can have multiple Values.
-
-The odml Module contains wrappers, that are shortcuts for creating the main objects::
-
-    >>> from odml import Document, Section, Property
-    >>> Document(version=0.9, author="Kermit")
-    <Doc 0.9 by Kermit (0 sections)>
-
-Several modules exist to extend the implementation.
-The ones included in the library are those:
-
-Document
---------
-.. autoclass:: odml.doc.BaseDocument
-   :members:
-   :inherited-members:
-   :undoc-members:
-
-Section
--------
-.. autoclass:: odml.section.BaseSection
-   :members:
-   :inherited-members:
-   :undoc-members:
-
-Property
---------
-.. autoclass:: odml.property.BaseProperty
-   :members:
-   :inherited-members:
-   :undoc-members:

+ 0 - 231
code/python-odml/doc/conf.py

@@ -1,231 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# python-odml documentation build configuration file, created by
-# sphinx-quickstart on Wed Mar  2 14:54:09 2011.
-#
-# This file is execfile()d with the current directory set to its containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
-
-import json
-import os
-import pathlib
-import sys
-
-from distutils.version import LooseVersion as CheckVer
-
-currdir = os.path.dirname(os.path.abspath(__file__))
-parent = pathlib.Path(currdir).parent
-path = os.path.join(parent, "odml", "info.json")
-
-with open(path) as infofile:
-    infodict = json.load(infofile)
-
-version_str = infodict["VERSION"]
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('..'))
-
-
-class DocStringInheritor(type):
-    """A variation on
-    http://groups.google.com/group/comp.lang.python/msg/26f7b4fcb4d66c95
-    by Paul McGuire
-    """
-    def __new__(meta, name, bases, clsdict):
-        if not('__doc__' in clsdict and clsdict['__doc__']):
-            for mro_cls in (mro_cls for base in bases for mro_cls in base.mro()):
-                doc=mro_cls.__doc__
-                if doc:
-                    clsdict['__doc__']=doc
-                    break
-        for attr, attribute in clsdict.items():
-            if not attribute.__doc__:
-                for mro_cls in (mro_cls for base in bases for mro_cls in base.mro()
-                                if hasattr(mro_cls, attr)):
-                    doc=getattr(getattr(mro_cls,attr),'__doc__')
-                    if doc:
-                        attribute.__doc__=doc
-                        break
-        return type.__new__(meta, name, bases, clsdict)
-
-# -- General configuration -----------------------------------------------------
-
-# Add any Sphinx extension module names here, as strings. They can be extensions
-# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc']
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General information about the project.
-project = u'python-odml'
-copyright = u'2011-2018, German Neuroinformatics Node (G-Node); based on work by Hagen Fritsch'
-
-# The version info for the project you're documenting, acts as replacement for
-# |version| and |release|, also used in various other places throughout the
-# built documents.
-#
-# The short X.Y version.
-version = "%s.%s" % (CheckVer(version_str).version[0], CheckVer(version_str).version[1])
-# The full version, including alpha/beta/rc tags.
-release = version_str
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
-
-# List of documents that shouldn't be included in the build.
-#unused_docs = []
-
-# List of directories, relative to source directory, that shouldn't be searched
-# for source files.
-exclude_trees = ['_build']
-
-# The reST default role (used for this markup: `text`) to use for all documents.
-#default_role = None
-
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-
-# -- Options for HTML output ---------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages.  Major themes that come with
-# Sphinx are currently 'default' and 'sphinxdoc'.
-html_theme = 'sphinxdoc'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
-# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
-
-# The name for this set of Sphinx documents.  If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
-
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_use_modindex = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it.  The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
-#html_file_suffix = ''
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'python-odmldoc'
-
-
-# -- Options for LaTeX output --------------------------------------------------
-
-# The paper size ('letter' or 'a4').
-#latex_paper_size = 'letter'
-
-# The font size ('10pt', '11pt' or '12pt').
-#latex_font_size = '10pt'
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title, author, documentclass [howto/manual]).
-latex_documents = [
-  ('index', 'python-odml.tex', u'python-odml Documentation',
-   u'Hagen Fritsch', 'manual'),
-]
-
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
-
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# Additional stuff for the LaTeX preamble.
-#latex_preamble = ''
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_use_modindex = True

+ 0 - 312
code/python-odml/doc/example_odMLs/THGTTG.odml

@@ -1,312 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?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>
-  <version>42</version>
-  <section>
-    <name>TheCrew</name>
-    <property>
-      <type>person</type>
-      <name>NameCrewMembers</name>
-      <value>[Arthur Philip Dent,Zaphod Beeblebrox,Tricia Marie McMillan,Ford Prefect]</value>
-      <id>77cdad5c-5d74-4e9f-9d74-c1ce8e79e951</id>
-      <definition>List of crew members names</definition>
-    </property>
-    <property>
-      <type>int</type>
-      <uncertainty>1</uncertainty>
-      <name>NoCrewMembers</name>
-      <reference>The Hitchhiker's guide to the Galaxy (novel)</reference>
-      <value>[4]</value>
-      <id>05e14adf-1ca2-4b2d-984d-6c84814a84de</id>
-      <definition>Number of crew members</definition>
-    </property>
-    <section>
-      <name>Arthur Philip Dent</name>
-      <property>
-        <type>string</type>
-        <name>Species</name>
-        <value>[Human]</value>
-        <id>f64e9d6a-e38d-499e-a03f-fe59b91ad6ba</id>
-        <definition>Species to which subject belongs to</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Nickname</name>
-        <value>[The sandwich-maker]</value>
-        <id>c9dd7ae6-66a1-49f0-9853-80f2cdf6b574</id>
-        <definition>Nickname(s) of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Occupation</name>
-        <value>[]</value>
-        <id>76941971-132a-4b3a-94db-e3cf356ea429</id>
-        <definition>Occupation of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Gender</name>
-        <value>[male]</value>
-        <id>5f1a5e56-d893-47bd-989a-9d3a596bc29e</id>
-        <definition>Sex of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>HomePlanet</name>
-        <value>[Earth]</value>
-        <id>6470acca-5457-4a43-a61c-6744372dff3b</id>
-        <definition>Home planet of the subject</definition>
-      </property>
-      <definition>Information on Arthur Dent</definition>
-      <id>e547c987-4beb-4250-bcb3-1991c535e7e8</id>
-      <type>crew/person</type>
-    </section>
-    <section>
-      <name>Zaphod Beeblebrox</name>
-      <property>
-        <type>string</type>
-        <name>Species</name>
-        <value>[Betelgeusian]</value>
-        <id>861a8469-708e-4950-be71-12c640d7e7d6</id>
-        <definition>Species to which subject belongs to</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Nickname</name>
-        <value>[]</value>
-        <id>ba06784b-d323-45c8-bb52-918b727f2ef1</id>
-        <definition>Nickname(s) of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Occupation</name>
-        <value>[Ex-Galactic President]</value>
-        <id>09b96b49-7bf3-4449-9e43-62d87bb23f16</id>
-        <definition>Occupation of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Gender</name>
-        <value>[male]</value>
-        <id>41f4ab65-afda-43c9-aa08-a384c9fba585</id>
-        <definition>Sex of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>HomePlanet</name>
-        <value>[A planet in the vicinity of Betelgeuse]</value>
-        <id>c81063a1-4727-4d51-bdfd-574923f387ab</id>
-        <definition>Home planet of the subject</definition>
-      </property>
-      <definition>Information on Zaphod Beeblebrox</definition>
-      <id>5d22732f-ebfd-494d-9fb0-0e938fc83291</id>
-      <type>crew/person</type>
-    </section>
-    <section>
-      <name>Tricia Marie McMillan</name>
-      <property>
-        <type>string</type>
-        <name>Species</name>
-        <value>[Human]</value>
-        <id>087d4862-50a5-4764-a2b5-01dded29ccab</id>
-        <definition>Species to which subject belongs to</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Nickname</name>
-        <value>[Trillian Astra]</value>
-        <id>15fef4d3-a9ed-4fc2-95db-7f7c90d85a8c</id>
-        <definition>Nickname(s) of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Occupation</name>
-        <value>[]</value>
-        <id>4ab85d8a-f884-4ef7-bf33-0d42044d95bb</id>
-        <definition>Occupation of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Gender</name>
-        <value>[female]</value>
-        <id>dd553e39-b3b1-4ef2-9b21-6145a3222d15</id>
-        <definition>Sex of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>HomePlanet</name>
-        <value>[Earth]</value>
-        <id>fe2abddf-f2e7-43f3-b3db-0932f94e17e9</id>
-        <definition>Home planet of the subject</definition>
-      </property>
-      <definition>Information on Trillian Astra</definition>
-      <id>b85c4c2d-4722-48fa-a118-5c2f553d7282</id>
-      <type>crew/person</type>
-    </section>
-    <section>
-      <name>Ford Prefect</name>
-      <property>
-        <type>string</type>
-        <name>Species</name>
-        <value>[Betelgeusian]</value>
-        <id>1493fb9b-6fb2-479e-923c-61242567ffd7</id>
-        <definition>Species to which subject belongs to</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Nickname</name>
-        <value>[Ix]</value>
-        <id>4b6eb605-dbfb-40e0-83c4-acca43e4fdbb</id>
-        <definition>Nickname(s) of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Occupation</name>
-        <value>[Researcher/Reporter]</value>
-        <id>3a69dba5-c780-447a-b9d9-e8da3cbbd4f4</id>
-        <definition>Occupation of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Gender</name>
-        <value>[male]</value>
-        <id>01b8b16c-c80b-4432-93a9-0fab8de74e22</id>
-        <definition>Sex of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>HomePlanet</name>
-        <value>[A planet in the vicinity of Betelgeuse]</value>
-        <id>f47c0d5e-e2b8-425b-83f3-57bcbe44164d</id>
-        <definition>Home planet of the subject</definition>
-      </property>
-      <definition>Information on Ford Prefect</definition>
-      <id>97cbf33c-5aa8-41af-b158-13247e7481dd</id>
-      <type>crew/person</type>
-    </section>
-    <definition>Information on the crew</definition>
-    <id>6df940b5-b502-4749-8ad9-33d7432064f3</id>
-    <type>crew</type>
-  </section>
-  <section>
-    <name>TheStarship</name>
-    <property>
-      <type>string</type>
-      <name>Name</name>
-      <value>[Heart of Gold]</value>
-      <id>b0f80f23-e976-4a06-b146-b81e5f565d6b</id>
-      <definition>Name of person/device</definition>
-    </property>
-    <property>
-      <type>string</type>
-      <name>OwnerStatus</name>
-      <value>[stolen]</value>
-      <id>43b26234-6023-4e7f-8bc4-401b0fd0504a</id>
-      <definition>Owner status of device</definition>
-    </property>
-    <property>
-      <type>string</type>
-      <name>DriveType</name>
-      <value>[Infinite Propability Drive]</value>
-      <id>828d51ea-f5c8-4525-b2ff-757555449190</id>
-      <definition>Type of drive</definition>
-    </property>
-    <property>
-      <type>string</type>
-      <name>Technology</name>
-      <value>[secret]</value>
-      <id>0117aaa2-fa5d-4623-a63c-4342733205ec</id>
-      <definition>Technology used to built device</definition>
-    </property>
-    <property>
-      <type>float</type>
-      <name>Length</name>
-      <unit>m</unit>
-      <value>[150.0]</value>
-      <id>7e2a3940-833c-407b-9047-918d317af204</id>
-      <definition>Length of device</definition>
-    </property>
-    <property>
-      <type>string</type>
-      <name>Shape</name>
-      <value>[various]</value>
-      <id>f34bfcbb-1a57-4905-bc8b-ef953c0e736e</id>
-      <definition>Shape of device</definition>
-    </property>
-    <property>
-      <type>string</type>
-      <name>FactoryPlanet</name>
-      <value>[Damogran]</value>
-      <id>c39386b4-2023-4dd3-bf03-57bd3c65d5c0</id>
-      <definition>Planet where device was constructed</definition>
-    </property>
-    <section>
-      <name>Cybernetics</name>
-      <property>
-        <type>int</type>
-        <name>NoOfCybernetics</name>
-        <value>[2]</value>
-        <id>534155a2-8d6a-471d-a7cb-8a950ff5e157</id>
-        <definition>Number of cybernetic robots on the ship</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>NamesOfCybernetics</name>
-        <value>[Marvin,Eddie]</value>
-        <id>7c00d7e3-2822-42b5-b5b3-b5c7dc51f67e</id>
-        <definition>Names of cybernetic robots on the ship</definition>
-      </property>
-      <section>
-        <name>Marvin</name>
-        <property>
-          <type>string</type>
-          <name>Type</name>
-          <value>[Genuine People Personality]</value>
-          <id>7f74bd80-4d08-43b3-aedc-7e3668b48d34</id>
-          <definition>Type of robot</definition>
-        </property>
-        <property>
-          <type>string</type>
-          <name>Manufacturer</name>
-          <value>[Sirius Cybernetics Corporation]</value>
-          <id>45cb21b1-b0e6-4eb0-a153-2059dd3d3444</id>
-          <definition>Manufacturer of robots</definition>
-        </property>
-        <definition>Information on Marvin</definition>
-        <id>2d66ac3e-5d25-45cc-89c1-1cc5890daa7b</id>
-        <type>starship/cybernetics</type>
-      </section>
-      <section>
-        <name>Eddie</name>
-        <property>
-          <type>string</type>
-          <name>Type</name>
-          <value>[Genuine People Personality]</value>
-          <id>2899d6df-7f15-48f5-aa11-aa368ba75eeb</id>
-          <definition>Type of robot</definition>
-        </property>
-        <property>
-          <type>string</type>
-          <name>Manufacturer</name>
-          <value>[Sirius Cybernetics Corporation]</value>
-          <id>dda738bb-47e4-462b-821c-ea900633dbee</id>
-          <definition>Manufacturer of robots</definition>
-        </property>
-        <definition>Information on Eddie</definition>
-        <id>953852d6-bbca-44d5-bad1-fb9bbca08655</id>
-        <type>starship/cybernetics</type>
-      </section>
-      <definition>Information on cybernetics present on the ship</definition>
-      <id>4f6f4994-cc0f-4d10-a643-4cdda5aa8248</id>
-      <type>starship/cybernetics</type>
-    </section>
-    <definition>Information on the starship</definition>
-    <id>38a36e78-ceca-4045-87a5-53a4dac29f10</id>
-    <type>starship</type>
-  </section>
-  <author>D. N. Adams</author>
-  <date>1979-10-12</date>
-  <id>cf6d24de-c780-4ad2-91ce-45dd5157d6b8</id>
-</odML>

+ 0 - 343
code/python-odml/doc/example_odMLs/sample_odml.json

@@ -1,343 +0,0 @@
-{
-    "odml-version": "1.1",
-    "Document": {
-        "date": "1979-10-12",
-        "version": "42",
-        "author": "D. N. Adams",
-        "sections": [
-            {
-                "name": "TheCrew",
-                "definition": "Information on the crew",
-                "type": "crew",
-                "sections": [
-                    {
-                        "name": "Arthur Philip Dent",
-                        "definition": "Information on Arthur Dent",
-                        "type": "crew/person",
-                        "sections": [],
-                        "properties": [
-                            {
-                                "name": "Species",
-                                "definition": "Species to which subject belongs to",
-                                "dtype": "string",
-                                "value": [
-                                    "Human"
-                                ]
-                            },
-                            {
-                                "name": "Nickname",
-                                "definition": "Nickname(s) of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "The sandwich-maker"
-                                ]
-                            },
-                            {
-                                "name": "Occupation",
-                                "definition": "Occupation of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "-"
-                                ]
-                            },
-                            {
-                                "name": "Gender",
-                                "definition": "Sex of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "male"
-                                ]
-                            },
-                            {
-                                "name": "HomePlanet",
-                                "definition": "Home planet of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "Earth"
-                                ]
-                            }
-                        ]
-                    },
-                    {
-                        "name": "Zaphod Beeblebrox",
-                        "definition": "Information on Zaphod Beeblebrox",
-                        "type": "crew/person",
-                        "sections": [],
-                        "properties": [
-                            {
-                                "name": "Species",
-                                "definition": "Species to which subject belongs to",
-                                "dtype": "string",
-                                "value": [
-                                    "Betelgeusian"
-                                ]
-                            },
-                            {
-                                "name": "Nickname",
-                                "definition": "Nickname(s) of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "-"
-                                ]
-                            },
-                            {
-                                "name": "Occupation",
-                                "definition": "Occupation of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "Ex-Galactic President"
-                                ]
-                            },
-                            {
-                                "name": "Gender",
-                                "definition": "Sex of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "male"
-                                ]
-                            },
-                            {
-                                "name": "HomePlanet",
-                                "definition": "Home planet of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "A planet in the vicinity of Betelgeuse"
-                                ]
-                            }
-                        ]
-                    },
-                    {
-                        "name": "Tricia Marie McMillan",
-                        "definition": "Information on Trillian Astra",
-                        "type": "crew/person",
-                        "sections": [],
-                        "properties": [
-                            {
-                                "name": "Species",
-                                "definition": "Species to which subject belongs to",
-                                "dtype": "string",
-                                "value": [
-                                    "Betelgeusian"
-                                ]
-                            },
-                            {
-                                "name": "Nickname",
-                                "definition": "Nickname(s) of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "Trillian Astra"
-                                ]
-                            },
-                            {
-                                "name": "Occupation",
-                                "definition": "Occupation of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "-"
-                                ]
-                            },
-                            {
-                                "name": "Gender",
-                                "definition": "Sex of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "female"
-                                ]
-                            },
-                            {
-                                "name": "HomePlanet",
-                                "definition": "Home planet of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "Earth"
-                                ]
-                            }
-                        ]
-                    },
-                    {
-                        "name": "Ford Prefect",
-                        "definition": "Information on Ford Prefect",
-                        "type": "crew/person",
-                        "sections": [],
-                        "properties": [
-                            {
-                                "name": "Species",
-                                "definition": "Species to which subject belongs to",
-                                "dtype": "string",
-                                "value": [
-                                    "Betelgeusian"
-                                ]
-                            },
-                            {
-                                "name": "Nickname",
-                                "definition": "Nickname(s) of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "Ix"
-                                ]
-                            },
-                            {
-                                "name": "Occupation",
-                                "definition": "Occupation of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "Researcher for the Hitchhiker's Guide to the Galaxy"
-                                ]
-                            },
-                            {
-                                "name": "Gender",
-                                "definition": "Sex of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "male"
-                                ]
-                            },
-                            {
-                                "name": "HomePlanet",
-                                "definition": "Home planet of the subject",
-                                "dtype": "string",
-                                "value": [
-                                    "A planet in the vicinity of Betelgeuse"
-                                ]
-                            }
-                        ]
-                    }
-                ],
-                "properties": [
-                    {
-                        "name": "NameCrewMembers",
-                        "definition": "List of crew members names",
-                        "dtype": "person",
-                        "value": [
-                            "Arthur Philip Dent",
-                            "Zaphod Beeblebrox",
-                            "Tricia Marie McMillan",
-                            "Ford Prefect"
-                        ]
-                    },
-                    {
-                        "name": "NoCrewMembers",
-                        "definition": "Number of crew members",
-                        "dtype": "int",
-                        "value": [
-                            4
-                        ]
-                    }
-                ]
-            },
-            {
-                "name": "TheStarship",
-                "definition": "Information on the crew",
-                "type": "crew",
-                "sections": [
-                    {
-                        "name": "Cybernetics",
-                        "definition": "Information on cybernetics present on the ship",
-                        "type": "starship/cybernetics",
-                        "sections": [
-                            {
-                                "name": "Marvin",
-                                "definition": "Information on Marvin",
-                                "type": "starship/cybernetics",
-                                "sections": [],
-                                "properties": []
-                            },
-                            {
-                                "name": "Eddie",
-                                "definition": "Information on Eddie",
-                                "type": "starship/cybernetics",
-                                "sections": [],
-                                "properties": []
-                            }
-                        ],
-                        "properties": [
-                            {
-                                "name": "RobotType",
-                                "definition": "Type of robots",
-                                "dtype": "string",
-                                "value": [
-                                    "Genuine People Personalities"
-                                ]
-                            },
-                            {
-                                "name": "Manufacturer",
-                                "definition": "Manufacturer of robots",
-                                "dtype": "string",
-                                "value": [
-                                    "Sirius Cybernetics Corporation"
-                                ]
-                            },
-                            {
-                                "name": "NoOfCybernetics",
-                                "definition": "Number of cybernetic robots on the ship",
-                                "dtype": "int",
-                                "value": [
-                                    2
-                                ]
-                            }
-                        ]
-                    }
-                ],
-                "properties": [
-                    {
-                        "name": "Name",
-                        "definition": "Name of person/device",
-                        "dtype": "string",
-                        "value": [
-                            "Heart of Gold"
-                        ]
-                    },
-                    {
-                        "name": "OwnerStatus",
-                        "definition": "Owner status of device",
-                        "dtype": "string",
-                        "value": [
-                            "stolen"
-                        ]
-                    },
-                    {
-                        "name": "DriveType",
-                        "definition": "Type of drive",
-                        "dtype": "string",
-                        "value": [
-                            "Infinite Propability Drive"
-                        ]
-                    },
-                    {
-                        "name": "Technology",
-                        "definition": "Technology used to built device",
-                        "dtype": "string",
-                        "value": [
-                            "secret"
-                        ]
-                    },
-                    {
-                        "unit": "m",
-                        "name": "Length",
-                        "definition": "Length of device",
-                        "dtype": "float",
-                        "value": [
-                            150.0
-                        ]
-                    },
-                    {
-                        "name": "Shape",
-                        "definition": "Shape of device",
-                        "dtype": "string",
-                        "value": [
-                            "various"
-                        ]
-                    },
-                    {
-                        "name": "FactoryPlanet",
-                        "definition": "Planet where device was constructed",
-                        "dtype": "string",
-                        "value": [
-                            "Damogran"
-                        ]
-                    }
-                ]
-            }
-        ]
-    }
-}

+ 0 - 52
code/python-odml/doc/example_odMLs/sample_odml.odml

@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet  type="text/xsl" href="odmlTerms.xsl"?>
-<?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>
-  <section>
-    <property>
-      <type>person</type>
-      <value>[Arthur Philip Dent,Zaphod Beeblebrox,Tricia Marie McMillan,Ford Prefect]</value>
-      <id>7b0572c1-fcfc-4010-aebf-730397ac29af</id>
-      <name>NameCrewMembers</name>
-      <definition>List of crew members names</definition>
-    </property>
-    <property>
-      <type>int</type>
-      <uncertainty>1</uncertainty>
-      <value>[4]</value>
-      <reference>The Hitchhiker's guide to the Galaxy (novel)</reference>
-      <id>298938a6-0996-4a92-982b-837a08a1a220</id>
-      <name>NoCrewMembers</name>
-      <definition>Number of crew members</definition>
-    </property>
-    <type>crew</type>
-    <definition>Information on the crew</definition>
-    <id>0f96a050-2d9b-498f-a532-fbfcc6aae55e</id>
-    <name>TheCrew</name>
-    <section>
-      <property>
-        <type>string</type>
-        <value>[Human]</value>
-        <id>635035cc-1c05-4e44-a4b7-0fb3d6295abf</id>
-        <name>Species</name>
-        <definition>Species to which subject belongs to</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <value>[]</value>
-        <id>0cec018b-20e3-4b13-bb95-b41de12db97f</id>
-        <name>Nickname</name>
-        <definition>Nickname(s) of the subject</definition>
-      </property>
-      <type>crew/person</type>
-      <definition>Information on Arthur Dent</definition>
-      <id>1d6469b5-5322-408b-916e-3224b7a22008</id>
-      <name>Arthur Philip Dent</name>
-    </section>
-  </section>
-  <date>1979-10-12</date>
-  <id>79b613eb-a256-46bf-84f6-207df465b8f7</id>
-  <version>42</version>
-</odML>

+ 0 - 87
code/python-odml/doc/example_odMLs/sample_odml.rdf

@@ -1,87 +0,0 @@
-@prefix odml: <https://g-node.org/projects/odml-rdf#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix xml: <http://www.w3.org/XML/1998/namespace> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-odml:Hub odml:hasDocument <https://g-node.org/projects/odml-rdf#3f995de3-fdb3-4f41-9daa-f85e001445c6>,
-        <https://g-node.org/projects/odml-rdf#79b613eb-a256-46bf-84f6-207df465b8f7> ;
-    odml:hasTerminology <https://g-node.org/projects/odml-rdf#7e0e07c7-7501-454e-88e7-cfa072db94c1> .
-
-<https://g-node.org/projects/odml-rdf#0cec018b-20e3-4b13-bb95-b41de12db97f> a odml:Property ;
-    odml:hasDefinition "Nickname(s) of the subject" ;
-    odml:hasDtype "string" ;
-    odml:hasName "Nickname" .
-
-<https://g-node.org/projects/odml-rdf#0f96a050-2d9b-498f-a532-fbfcc6aae55e> a odml:Section ;
-    odml:hasDefinition "Information on the crew" ;
-    odml:hasName "TheCrew" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#298938a6-0996-4a92-982b-837a08a1a220>,
-        <https://g-node.org/projects/odml-rdf#7b0572c1-fcfc-4010-aebf-730397ac29af> ;
-    odml:hasSection <https://g-node.org/projects/odml-rdf#1d6469b5-5322-408b-916e-3224b7a22008> ;
-    odml:hasType "crew" .
-
-<https://g-node.org/projects/odml-rdf#1d6469b5-5322-408b-916e-3224b7a22008> a odml:Section ;
-    odml:hasDefinition "Information on Arthur Dent" ;
-    odml:hasName "Arthur Philip Dent" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#0cec018b-20e3-4b13-bb95-b41de12db97f>,
-        <https://g-node.org/projects/odml-rdf#635035cc-1c05-4e44-a4b7-0fb3d6295abf> ;
-    odml:hasType "crew/person" .
-
-<https://g-node.org/projects/odml-rdf#298938a6-0996-4a92-982b-837a08a1a220> a odml:Property ;
-    odml:hasDefinition "Number of crew members" ;
-    odml:hasDtype "int" ;
-    odml:hasName "NoCrewMembers" ;
-    odml:hasUncertainty "1" ;
-    odml:hasValue odml:ce5f326a-91c9-4c41-9425-d4b8495aa832 .
-
-<https://g-node.org/projects/odml-rdf#3f995de3-fdb3-4f41-9daa-f85e001445c6> a odml:Document ;
-    odml:hasAuthor "D. N. Adams" ;
-    odml:hasDate "1979-10-12"^^xsd:date ;
-    odml:hasDocVersion "42" ;
-    odml:hasSection odml:b44da455-8ee8-47b7-a011-016b9c3a6f9d .
-
-<https://g-node.org/projects/odml-rdf#4a9891e7-b970-46fb-80d6-60ec8b2535e3> a rdf:Bag ;
-    rdf:li "Human" .
-
-<https://g-node.org/projects/odml-rdf#635035cc-1c05-4e44-a4b7-0fb3d6295abf> a odml:Property ;
-    odml:hasDefinition "Species to which subject belongs to" ;
-    odml:hasDtype "string" ;
-    odml:hasName "Species" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#4a9891e7-b970-46fb-80d6-60ec8b2535e3> .
-
-<https://g-node.org/projects/odml-rdf#79b613eb-a256-46bf-84f6-207df465b8f7> a odml:Document ;
-    odml:hasAuthor "D. N. Adams" ;
-    odml:hasDate "1979-10-12"^^xsd:date ;
-    odml:hasDocVersion "42" ;
-    odml:hasSection <https://g-node.org/projects/odml-rdf#0f96a050-2d9b-498f-a532-fbfcc6aae55e> ;
-    odml:hasTerminology <https://g-node.org/projects/odml-rdf#7e0e07c7-7501-454e-88e7-cfa072db94c1> .
-
-<https://g-node.org/projects/odml-rdf#7b0572c1-fcfc-4010-aebf-730397ac29af> a odml:Property ;
-    odml:hasDefinition "List of crew members names" ;
-    odml:hasDtype "person" ;
-    odml:hasName "NameCrewMembers" ;
-    odml:hasValue odml:d98afe9b-3982-44bf-9373-12aaa4798628 .
-
-odml:b44da455-8ee8-47b7-a011-016b9c3a6f9d a odml:Section ;
-    odml:hasDefinition "Information on the crew" ;
-    odml:hasName "TheCrew" ;
-    odml:hasProperty odml:bb02a18d-7de2-45aa-8be1-ca34b74f2360 ;
-    odml:hasType "crew" .
-
-odml:bb02a18d-7de2-45aa-8be1-ca34b74f2360 a odml:Property ;
-    odml:hasDefinition "Number of crew members" ;
-    odml:hasDtype "int" ;
-    odml:hasName "NoCrewMembers" .
-
-odml:ce5f326a-91c9-4c41-9425-d4b8495aa832 a rdf:Bag ;
-    rdf:li 4 .
-
-odml:d98afe9b-3982-44bf-9373-12aaa4798628 a rdf:Bag ;
-    rdf:li "Arthur Philip Dent",
-        "Ford Prefect",
-        "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> .
-

+ 0 - 215
code/python-odml/doc/example_odMLs/sample_odml.yaml

@@ -1,215 +0,0 @@
-Document:
-  author: D. N. Adams
-  date: '1979-10-12'
-  sections:
-  - definition: Information on the crew
-    name: TheCrew
-    properties:
-    - definition: List of crew members names
-      dtype: person
-      name: NameCrewMembers
-      value:
-      - Arthur Philip Dent
-      - Zaphod Beeblebrox
-      - Tricia Marie McMillan
-      - Ford Prefect
-    - definition: Number of crew members
-      dtype: int
-      name: NoCrewMembers
-      value:
-      - 4
-    sections:
-    - definition: Information on Arthur Dent
-      name: Arthur Philip Dent
-      properties:
-      - definition: Species to which subject belongs to
-        dtype: string
-        name: Species
-        value:
-        - Human
-      - definition: Nickname(s) of the subject
-        dtype: string
-        name: Nickname
-        value:
-        - The sandwich-maker
-      - definition: Occupation of the subject
-        dtype: string
-        name: Occupation
-        value:
-        - '-'
-      - definition: Sex of the subject
-        dtype: string
-        name: Gender
-        value:
-        - male
-      - definition: Home planet of the subject
-        dtype: string
-        name: HomePlanet
-        value:
-        - Earth
-      sections: []
-      type: crew/person
-    - definition: Information on Zaphod Beeblebrox
-      name: Zaphod Beeblebrox
-      properties:
-      - definition: Species to which subject belongs to
-        dtype: string
-        name: Species
-        value:
-        - Betelgeusian
-      - definition: Nickname(s) of the subject
-        dtype: string
-        name: Nickname
-        value:
-        - '-'
-      - definition: Occupation of the subject
-        dtype: string
-        name: Occupation
-        value:
-        - Ex-Galactic President
-      - definition: Sex of the subject
-        dtype: string
-        name: Gender
-        value:
-        - male
-      - definition: Home planet of the subject
-        dtype: string
-        name: HomePlanet
-        value:
-        - A planet in the vicinity of Betelgeuse
-      sections: []
-      type: crew/person
-    - definition: Information on Trillian Astra
-      name: Tricia Marie McMillan
-      properties:
-      - definition: Species to which subject belongs to
-        dtype: string
-        name: Species
-        value:
-        - Betelgeusian
-      - definition: Nickname(s) of the subject
-        dtype: string
-        name: Nickname
-        value:
-        - Trillian Astra
-      - definition: Occupation of the subject
-        dtype: string
-        name: Occupation
-        value:
-        - '-'
-      - definition: Sex of the subject
-        dtype: string
-        name: Gender
-        value:
-        - female
-      - definition: Home planet of the subject
-        dtype: string
-        name: HomePlanet
-        value:
-        - Earth
-      sections: []
-      type: crew/person
-    - definition: Information on Ford Prefect
-      name: Ford Prefect
-      properties:
-      - definition: Species to which subject belongs to
-        dtype: string
-        name: Species
-        value:
-        - Betelgeusian
-      - definition: Nickname(s) of the subject
-        dtype: string
-        name: Nickname
-        value:
-        - Ix
-      - definition: Occupation of the subject
-        dtype: string
-        name: Occupation
-        value:
-        - Researcher for the Hitchhiker's Guide to the Galaxy
-      - definition: Sex of the subject
-        dtype: string
-        name: Gender
-        value:
-        - male
-      - definition: Home planet of the subject
-        dtype: string
-        name: HomePlanet
-        value:
-        - A planet in the vicinity of Betelgeuse
-      sections: []
-      type: crew/person
-    type: crew
-  - definition: Information on the crew
-    name: TheStarship
-    properties:
-    - definition: Name of person/device
-      dtype: string
-      name: Name
-      value:
-      - Heart of Gold
-    - definition: Owner status of device
-      dtype: string
-      name: OwnerStatus
-      value:
-      - stolen
-    - definition: Type of drive
-      dtype: string
-      name: DriveType
-      value:
-      - Infinite Propability Drive
-    - definition: Technology used to built device
-      dtype: string
-      name: Technology
-      value:
-      - secret
-    - definition: Length of device
-      dtype: float
-      name: Length
-      unit: m
-      value:
-      - 150.0
-    - definition: Shape of device
-      dtype: string
-      name: Shape
-      value:
-      - various
-    - definition: Planet where device was constructed
-      dtype: string
-      name: FactoryPlanet
-      value:
-      - Damogran
-    sections:
-    - definition: Information on cybernetics present on the ship
-      name: Cybernetics
-      properties:
-      - definition: Type of robots
-        dtype: string
-        name: RobotType
-        value:
-        - Genuine People Personalities
-      - definition: Manufacturer of robots
-        dtype: string
-        name: Manufacturer
-        value:
-        - Sirius Cybernetics Corporation
-      - definition: Number of cybernetic robots on the ship
-        dtype: int
-        name: NoOfCybernetics
-        value:
-        - 2
-      sections:
-      - definition: Information on Marvin
-        name: Marvin
-        properties: []
-        sections: []
-        type: starship/cybernetics
-      - definition: Information on Eddie
-        name: Eddie
-        properties: []
-        sections: []
-        type: starship/cybernetics
-      type: starship/cybernetics
-    type: crew
-  version: '42'
-odml-version: '1.1'

+ 0 - 313
code/python-odml/doc/example_odMLs/thgttg.py

@@ -1,313 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-Created on Thu Mar 20 08:58:56 2014
-
-Script to generate intro-example.odml
-
-@author: zehl
-"""
-
-import datetime
-import os
-import odml
-import sys
-
-
-if len(sys.argv) != 2:
-    print("Please provide an existing directory for the example odml file.")
-    quit()
-
-output_directory = sys.argv[-1]
-if not os.path.isdir(output_directory):
-    print("Please provide an existing directory for the example odml file.")
-    quit()
-
-save_to = os.path.join(output_directory, "THGTTG.odml")
-
-
-odmlrepo = 'http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml'
-
-# CREATE A DOCUMENT
-doc = odml.Document(author="D. N. Adams",
-                    date=datetime.date(1979, 10, 12),
-                    version=42,
-                    repository=odmlrepo)
-
-# CREATE AND APPEND THE MAIN SECTIONs
-doc.append(odml.Section(name="TheCrew",
-                        definition="Information on the crew",
-                        type="crew"))
-
-doc.append(odml.Section(name="TheStarship",
-                        type="starship",
-                        definition="Information on the starship"))
-
-# SET NEW PARENT NODE
-parent = doc['TheCrew']
-
-# APPEND SUBSECTIONS
-parent.append(odml.Section(name="Arthur Philip Dent",
-                           type="crew/person",
-                           definition="Information on Arthur Dent"))
-
-parent.append(odml.Section(name="Zaphod Beeblebrox",
-                           type="crew/person",
-                           definition="Information on Zaphod Beeblebrox"))
-
-parent.append(odml.Section(name="Tricia Marie McMillan",
-                           type="crew/person",
-                           definition="Information on Trillian Astra"))
-
-parent.append(odml.Section(name="Ford Prefect",
-                           type="crew/person",
-                           definition="Information on Ford Prefect"))
-
-
-# APPEND PROPERTIES WITH VALUES
-parent.append(odml.Property(name="NameCrewMembers",
-                            value=["Arthur Philip Dent",
-                                   "Zaphod Beeblebrox",
-                                   "Tricia Marie McMillan",
-                                   "Ford Prefect"],
-                            dtype=odml.DType.person,
-                            definition="List of crew members names"))
-
-parent.append(odml.Property(name="NoCrewMembers",
-                            value=4,
-                            dtype=odml.DType.int,
-                            definition="Number of crew members",
-                            uncertainty=1,
-                            reference="The Hitchhiker's guide to the Galaxy (novel)"))
-
-
-# SET NEW PARENT NODE
-parent = doc['TheCrew']['Arthur Philip Dent']
-
-# APPEND SUBSECTIONS
-
-# APPEND PROPERTIES WITH VALUES
-parent.append(odml.Property(name="Species",
-                            value="Human",
-                            dtype=odml.DType.string,
-                            definition="Species to which subject belongs to"))
-
-parent.append(odml.Property(name="Nickname",
-                            value="The sandwich-maker",
-                            dtype=odml.DType.string,
-                            definition="Nickname(s) of the subject"))
-
-parent.append(odml.Property(name="Occupation",
-                            value=None,
-                            dtype=odml.DType.string,
-                            definition="Occupation of the subject"))
-
-parent.append(odml.Property(name="Gender",
-                            value="male",
-                            dtype=odml.DType.string,
-                            definition="Sex of the subject"))
-
-parent.append(odml.Property(name="HomePlanet",
-                            value="Earth",
-                            dtype=odml.DType.string,
-                            definition="Home planet of the subject"))
-
-
-# SET NEW PARENT NODE
-parent = doc['TheCrew']['Zaphod Beeblebrox']
-
-# APPEND SUBSECTIONS
-
-# APPEND PROPERTIES WITH VALUES
-parent.append(odml.Property(name="Species",
-                            value="Betelgeusian",
-                            dtype=odml.DType.string,
-                            definition="Species to which subject belongs to"))
-
-parent.append(odml.Property(name="Nickname",
-                            value=None,
-                            dtype=odml.DType.string,
-                            definition="Nickname(s) of the subject"))
-
-parent.append(odml.Property(name="Occupation",
-                            value="Ex-Galactic President",
-                            dtype=odml.DType.string,
-                            definition="Occupation of the subject"))
-
-parent.append(odml.Property(name="Gender",
-                            value="male",
-                            dtype=odml.DType.string,
-                            definition="Sex of the subject"))
-
-parent.append(odml.Property(name="HomePlanet",
-                            value="A planet in the vicinity of Betelgeuse",
-                            dtype=odml.DType.string,
-                            definition="Home planet of the subject"))
-
-
-# SET NEW PARENT NODE
-parent = doc['TheCrew']['Tricia Marie McMillan']
-
-# APPEND SUBSECTIONS
-
-# APPEND PROPERTIES WITH VALUES
-parent.append(odml.Property(name="Species",
-                            value="Human",
-                            dtype=odml.DType.string,
-                            definition="Species to which subject belongs to"))
-
-parent.append(odml.Property(name="Nickname",
-                            value="Trillian Astra",
-                            dtype=odml.DType.string,
-                            definition="Nickname(s) of the subject"))
-
-parent.append(odml.Property(name="Occupation",
-                            value=None,
-                            dtype=odml.DType.string,
-                            definition="Occupation of the subject"))
-
-parent.append(odml.Property(name="Gender",
-                            value="female",
-                            dtype=odml.DType.string,
-                            definition="Sex of the subject"))
-
-parent.append(odml.Property(name="HomePlanet",
-                            value="Earth",
-                            dtype=odml.DType.string,
-                            definition="Home planet of the subject"))
-
-# SET NEW PARENT NODE
-parent = doc['TheCrew']['Ford Prefect']
-
-# APPEND SUBSECTIONS
-
-# APPEND PROPERTIES WITH VALUES
-parent.append(odml.Property(name="Species",
-                            value="Betelgeusian",
-                            dtype=odml.DType.string,
-                            definition="Species to which subject belongs to"))
-
-parent.append(odml.Property(name="Nickname",
-                            value="Ix",
-                            dtype=odml.DType.string,
-                            definition="Nickname(s) of the subject"))
-
-parent.append(odml.Property(name="Occupation",
-                            value="Researcher/Reporter",
-                            dtype=odml.DType.string,
-                            definition="Occupation of the subject"))
-
-parent.append(odml.Property(name="Gender",
-                            value="male",
-                            dtype=odml.DType.string,
-                            definition="Sex of the subject"))
-
-parent.append(odml.Property(name="HomePlanet",
-                            value="A planet in the vicinity of Betelgeuse",
-                            dtype=odml.DType.string,
-                            definition="Home planet of the subject"))
-
-# SET NEW PARENT NODE
-parent = doc['TheStarship']
-
-# APPEND SUBSECTIONS
-parent.append(odml.Section(name='Cybernetics',
-                           type="starship/cybernetics",
-                           definition="Information on cybernetics present on "
-                                      "the ship"))
-
-# APPEND PROPERTIES WITH VALUES
-parent.append(odml.Property(name="Name",
-                            value="Heart of Gold",
-                            dtype=odml.DType.string,
-                            definition="Name of person/device"))
-
-parent.append(odml.Property(name="OwnerStatus",
-                            value="stolen",
-                            dtype=odml.DType.string,
-                            definition="Owner status of device"))
-
-parent.append(odml.Property(name="DriveType",
-                            value="Infinite Propability Drive",
-                            dtype=odml.DType.string,
-                            definition="Type of drive"))
-
-parent.append(odml.Property(name="Technology",
-                            value="secret",
-                            dtype=odml.DType.string,
-                            definition="Technology used to built device"))
-
-parent.append(odml.Property(name="Length",
-                            value=150.00,
-                            dtype=odml.DType.float,
-                            unit='m',
-                            definition="Length of device"))
-
-parent.append(odml.Property(name="Shape",
-                            value="various",
-                            dtype=odml.DType.string,
-                            definition="Shape of device"))
-
-parent.append(odml.Property(name="FactoryPlanet",
-                            value="Damogran",
-                            dtype=odml.DType.string,
-                            definition="Planet where device was constructed"))
-
-
-# SET NEW PARENT NODE
-parent = doc['TheStarship']['Cybernetics']
-
-# APPEND SUBSECTIONS
-parent.append(odml.Section(name='Marvin',
-                           type="starship/cybernetics",
-                           definition="Information on Marvin"))
-
-parent.append(odml.Section(name='Eddie',
-                           type="starship/cybernetics",
-                           definition="Information on Eddie"))
-
-# APPEND PROPERTIES WITH VALUES
-parent.append(odml.Property(name="NoOfCybernetics",
-                            value=2,
-                            dtype=odml.DType.int,
-                            definition="Number of cybernetic robots on the ship"))
-
-parent.append(odml.Property(name="NamesOfCybernetics",
-                            value=["Marvin",
-                                   "Eddie"],
-                            dtype=odml.DType.string,
-                            definition="Names of cybernetic robots on the ship"))
-
-# SET NEW PARENT NODE
-parent = doc['TheStarship']['Cybernetics']['Marvin']
-
-# APPEND SUBSECTIONS
-
-# APPEND PROPERTIES WIHT VALUES
-parent.append(odml.Property(name="Type",
-                            value="Genuine People Personality",
-                            dtype=odml.DType.string,
-                            definition="Type of robot"))
-
-parent.append(odml.Property(name="Manufacturer",
-                            value="Sirius Cybernetics Corporation",
-                            dtype=odml.DType.string,
-                            definition="Manufacturer of robots"))
-
-# SET NEW PARENT NODE
-parent = doc['TheStarship']['Cybernetics']['Eddie']
-
-# APPEND SUBSECTIONS
-
-# APPEND PROPERTIES WIHT VALUES
-parent.append(odml.Property(name="Type",
-                            value="Genuine People Personality",
-                            dtype=odml.DType.string,
-                            definition="Type of robot"))
-
-parent.append(odml.Property(name="Manufacturer",
-                            value="Sirius Cybernetics Corporation",
-                            dtype=odml.DType.string,
-                            definition="Manufacturer of robots"))
-
-odml.save(doc, save_to)
-

+ 0 - 516
code/python-odml/doc/example_rdfs/example_data/2010-04-16-ab_cutoff_300_contrast_20%.ttl

@@ -1,516 +0,0 @@
-@prefix odml: <https://g-node.org/projects/odml-rdf#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix xml: <http://www.w3.org/XML/1998/namespace> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-odml:Hub odml:hasDocument odml:cd24b60f-1d5e-4040-9881-5e5a597baef7 .
-
-<https://g-node.org/projects/odml-rdf#04fed34b-abee-45f0-a8a9-b31c13967d02> a rdf:Bag ;
-    rdf:li " Munich",
-        "Ludwig-Maximilian University" .
-
-<https://g-node.org/projects/odml-rdf#075b5a09-a779-4b8b-bb4f-f67091a61d78> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "File" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#36fe8bf7-136e-48ce-927a-6e194248afca> .
-
-<https://g-node.org/projects/odml-rdf#09da05a7-2929-4eeb-8d9e-33f77d3d1aa3> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Software" ;
-    odml:hasValue odml:ab7572bb-854c-467e-a908-352f112ef109 .
-
-<https://g-node.org/projects/odml-rdf#0b090621-2f8d-43c5-892a-5159486d2d94> a rdf:Bag ;
-    rdf:li "Good" .
-
-<https://g-node.org/projects/odml-rdf#11a3c40e-f020-4b07-9b79-eeeb6bd7f4f5> a rdf:Bag ;
-    rdf:li "16:35:51" .
-
-<https://g-node.org/projects/odml-rdf#11e58106-dacc-47b4-b085-6fe17cdb5743> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Immobilization" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#3b60cf7f-47a6-48a5-b804-7d70bb7be167> .
-
-<https://g-node.org/projects/odml-rdf#13781424-3697-48f2-9fd2-08b51cbeb8ce> a rdf:Bag ;
-    rdf:li "136.8" .
-
-<https://g-node.org/projects/odml-rdf#17c5151a-4027-4999-b6ff-2dccca3d049c> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Mode" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#7208de4a-63dc-4de4-a655-513c61a86aaf> .
-
-<https://g-node.org/projects/odml-rdf#18cde1ad-1fe6-4105-8dea-b9b70715d573> a rdf:Bag ;
-    rdf:li "P-unit" .
-
-<https://g-node.org/projects/odml-rdf#19e58b9a-cb2b-4633-b102-2a2a96427a8a> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "LocalAnaesthesia" ;
-    odml:hasValue odml:e33108e2-72cc-4833-a1e6-e5439df682f0 .
-
-<https://g-node.org/projects/odml-rdf#1bcc15a8-6852-4cbd-8d48-187ff9e61a47> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Firing Rate1" ;
-    odml:hasUnit "Hz" ;
-    odml:hasValue odml:e9417a2c-20ac-4f0d-99ab-5de3c36ef73d .
-
-<https://g-node.org/projects/odml-rdf#1bdd38c8-be73-4cfd-9723-06beec7bbac5> a rdf:Bag ;
-    rdf:li "0.0" .
-
-<https://g-node.org/projects/odml-rdf#1d6db4ce-87f3-4e9c-b221-e76ba05b2759> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Date" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#8468c935-7ed1-42f4-a0d5-60864ea9226d> .
-
-<https://g-node.org/projects/odml-rdf#1d83e301-44c2-4014-9353-bcf658aac79c> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "UpperCutoffFrequency" ;
-    odml:hasUnit "Hz" ;
-    odml:hasValue odml:adb90936-7e05-4a7b-bff2-ebe60fa1d6ba .
-
-<https://g-node.org/projects/odml-rdf#1e191e89-fe64-4b47-aa33-fcfcd3fce4c9> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Lab" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#23146cd2-5851-46ac-81c5-8827cc305642> .
-
-<https://g-node.org/projects/odml-rdf#1f7ca003-f96e-4ed6-9bcc-5f3b5dd8913e> a rdf:Bag ;
-    rdf:li "120.0" .
-
-<https://g-node.org/projects/odml-rdf#215a068a-c45c-48d3-b74b-1e8d7b684041> a rdf:Bag ;
-    rdf:li "in vivo" .
-
-<https://g-node.org/projects/odml-rdf#2179255b-f213-439f-a0ea-25f01efa98a7> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Address" ;
-    odml:hasValue odml:ee931e48-ee0b-474d-a59a-fa89b0b69443 .
-
-<https://g-node.org/projects/odml-rdf#23146cd2-5851-46ac-81c5-8827cc305642> a rdf:Bag ;
-    rdf:li "Jan Benda" .
-
-<https://g-node.org/projects/odml-rdf#271f2645-ad61-4ece-8ca7-3b26f241f185> a rdf:Bag ;
-    rdf:li 1e+01 .
-
-<https://g-node.org/projects/odml-rdf#2a9e6f04-8d2f-4aca-b129-e77e88b023a1> a odml:Section ;
-    odml:hasName "Cell" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#52631c9e-ebf1-42e9-9ef6-000c4b3e2dfb>,
-        <https://g-node.org/projects/odml-rdf#63582830-51b4-43ef-aed6-d59b4181158c>,
-        <https://g-node.org/projects/odml-rdf#6d2713c3-261e-4d6b-8ed0-2d90bedf5a1e>,
-        <https://g-node.org/projects/odml-rdf#8e67f9ba-6819-4440-aecc-91b36de49056>,
-        odml:d6ca1018-ac58-4b63-a6a5-8c5ca28c7c99 ;
-    odml:hasType "Cell" .
-
-<https://g-node.org/projects/odml-rdf#2cb8e72c-7af0-4677-a712-126f20d33feb> a rdf:Bag ;
-    rdf:li "Henriette Walz" .
-
-<https://g-node.org/projects/odml-rdf#2cc180c9-c02a-4179-8ab2-bffea408df72> a odml:Section ;
-    odml:hasName "Subject" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#48b1550e-ebca-477c-a4c5-f43e7f9a6465>,
-        <https://g-node.org/projects/odml-rdf#6906e861-6a78-4673-8d53-a5a7ce0ea8e3>,
-        <https://g-node.org/projects/odml-rdf#710c51c4-8b7f-4290-9320-a013c5007d7c>,
-        <https://g-node.org/projects/odml-rdf#7e2ba5e3-9a53-4843-8cf3-c8e50500acc9>,
-        <https://g-node.org/projects/odml-rdf#94654728-fd46-4d0d-b028-af11c1871f6e> ;
-    odml:hasType "Subject" .
-
-<https://g-node.org/projects/odml-rdf#2e68370e-5638-45be-9a83-a8475a42e87e> a rdf:Bag ;
-    rdf:li "13.0" .
-
-<https://g-node.org/projects/odml-rdf#338de0a1-fde8-4914-b8fd-6da3fc729160> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Time" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#11a3c40e-f020-4b07-9b79-eeeb6bd7f4f5> .
-
-<https://g-node.org/projects/odml-rdf#35050ea8-f4f5-452f-a468-f0fe73cb2caa> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Folder" ;
-    odml:hasValue odml:a13e3cf0-1d76-420f-aa48-8da7278355c5 .
-
-<https://g-node.org/projects/odml-rdf#36fe8bf7-136e-48ce-927a-6e194248afca> a rdf:Bag ;
-    rdf:li "/home/efish/stimuli/whitenoise/gwn300Hz10s0.3.dat" .
-
-<https://g-node.org/projects/odml-rdf#3b60cf7f-47a6-48a5-b804-7d70bb7be167> a rdf:Bag ;
-    rdf:li "Pancuronium bromide" .
-
-<https://g-node.org/projects/odml-rdf#3fb77ff1-07da-457b-9b9a-db3c93a9099e> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "P-Value1" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#8206694d-98bc-46f3-ab7a-308de6ee05b6> .
-
-<https://g-node.org/projects/odml-rdf#41fff657-5521-4ef8-87a6-95b5ed05af71> a odml:Section ;
-    odml:hasName "Setup" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#1e191e89-fe64-4b47-aa33-fcfcd3fce4c9>,
-        <https://g-node.org/projects/odml-rdf#2179255b-f213-439f-a0ea-25f01efa98a7>,
-        <https://g-node.org/projects/odml-rdf#4c5bc4e6-5eb9-40d9-b3cd-a43fe3e7c754>,
-        <https://g-node.org/projects/odml-rdf#5cda3b1d-810b-4abc-b4ce-6dc56c83324e>,
-        <https://g-node.org/projects/odml-rdf#5f38827d-a00b-4041-ad5f-002568f5cd56>,
-        <https://g-node.org/projects/odml-rdf#856cf579-0a7b-42fc-95c6-7ae6eec79677>,
-        odml:a76a3bab-695f-4e68-a88c-27eae1942576,
-        odml:eb0f32a8-8d54-402a-9023-1230229216b4 ;
-    odml:hasType "Setup" .
-
-<https://g-node.org/projects/odml-rdf#42b1b6e2-143e-4da4-b200-3be6bd13562b> a rdf:Bag ;
-    rdf:li "Apteronotus albifrons" .
-
-<https://g-node.org/projects/odml-rdf#44052a1a-efb4-494f-a9d5-dec000ececbd> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "LocalAnaesthetic" ;
-    odml:hasValue odml:f1f790f6-e72f-42a8-95a8-06dc28acfc36 .
-
-<https://g-node.org/projects/odml-rdf#4620a3bf-3316-4a00-9fa0-206aaf520d4a> a odml:Section ;
-    odml:hasName "Stimulus" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#075b5a09-a779-4b8b-bb4f-f67091a61d78>,
-        <https://g-node.org/projects/odml-rdf#1d83e301-44c2-4014-9353-bcf658aac79c>,
-        <https://g-node.org/projects/odml-rdf#58780348-17fe-41e5-9654-4100d662d985>,
-        <https://g-node.org/projects/odml-rdf#6dc24779-4cd0-452c-8607-bb0a954a42dc>,
-        <https://g-node.org/projects/odml-rdf#808b277a-bcf9-447c-88c3-f031a11cfe0a>,
-        <https://g-node.org/projects/odml-rdf#902f9acf-f13c-4b29-ae3b-a9463e480752>,
-        odml:afbc3b09-1026-4fe3-844d-88733a725590,
-        odml:c4eb4dd6-3325-472b-84b4-616a9fca98c6,
-        odml:ca686128-b4a8-433f-8e47-011ef7cf30db,
-        odml:dd337c00-e453-4952-a3c6-eb4a5e7f8eb2 ;
-    odml:hasType "stimulus/white_noise" .
-
-<https://g-node.org/projects/odml-rdf#48b1550e-ebca-477c-a4c5-f43e7f9a6465> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Gender" ;
-    odml:hasValue odml:acb39fae-4a71-4d87-b06f-ab06991cb70c .
-
-<https://g-node.org/projects/odml-rdf#48e041ce-ae12-4ea7-acc7-34d24b679638> a rdf:Bag ;
-    rdf:li "1003.4" .
-
-<https://g-node.org/projects/odml-rdf#4abb9983-66d0-4fba-8eb8-9d534cb5c5be> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Type" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#215a068a-c45c-48d3-b74b-1e8d7b684041> .
-
-<https://g-node.org/projects/odml-rdf#4c5bc4e6-5eb9-40d9-b3cd-a43fe3e7c754> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Department" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#623ae7e5-e9c8-4f0b-97c0-3bb643a77be5> .
-
-<https://g-node.org/projects/odml-rdf#52631c9e-ebf1-42e9-9ef6-000c4b3e2dfb> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "CV" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#806a8457-997f-4ab7-a868-ff8a55166931> .
-
-<https://g-node.org/projects/odml-rdf#58780348-17fe-41e5-9654-4100d662d985> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Additional noise upper cutoff" ;
-    odml:hasUnit "Hz" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#1bdd38c8-be73-4cfd-9723-06beec7bbac5> .
-
-<https://g-node.org/projects/odml-rdf#5cda3b1d-810b-4abc-b4ce-6dc56c83324e> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Location" ;
-    odml:hasValue odml:c8e610ef-0f50-4630-8c32-f6a7d49e5f13 .
-
-<https://g-node.org/projects/odml-rdf#5d32c390-3735-4fbb-bb60-e8edb2056693> a rdf:Bag ;
-    rdf:li "20.0" .
-
-<https://g-node.org/projects/odml-rdf#5d9c35e1-884c-4741-b18e-662355f345ff> a rdf:Bag ;
-    rdf:li "Jan Benda" .
-
-<https://g-node.org/projects/odml-rdf#5f38827d-a00b-4041-ad5f-002568f5cd56> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Identifier" ;
-    odml:hasValue odml:aad9b7c9-7f6d-4a98-9ec6-bedc62edb9e0 .
-
-<https://g-node.org/projects/odml-rdf#623ae7e5-e9c8-4f0b-97c0-3bb643a77be5> a rdf:Bag ;
-    rdf:li " LMU-Munich",
-        "Department Biology II" .
-
-<https://g-node.org/projects/odml-rdf#63582830-51b4-43ef-aed6-d59b4181158c> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Baseline rate" ;
-    odml:hasUnit "Hz" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#13781424-3697-48f2-9fd2-08b51cbeb8ce> .
-
-<https://g-node.org/projects/odml-rdf#686b62e7-331d-426d-8446-554792fc0875> a rdf:Bag ;
-    rdf:li "Jan Benda" .
-
-<https://g-node.org/projects/odml-rdf#6906e861-6a78-4673-8d53-a5a7ce0ea8e3> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Transdermal amplitude" ;
-    odml:hasUnit "mV" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#9d39f328-fda0-4d20-82ea-8fd77e8ede73> .
-
-<https://g-node.org/projects/odml-rdf#6d2713c3-261e-4d6b-8ed0-2d90bedf5a1e> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "CellType" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#18cde1ad-1fe6-4105-8dea-b9b70715d573> .
-
-<https://g-node.org/projects/odml-rdf#6dc24779-4cd0-452c-8607-bb0a954a42dc> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Additional noise lower cutoff" ;
-    odml:hasUnit "Hz" ;
-    odml:hasValue odml:d59a760f-12a9-4738-87ba-c1691d86cbc3 .
-
-<https://g-node.org/projects/odml-rdf#710c51c4-8b7f-4290-9320-a013c5007d7c> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Size" ;
-    odml:hasUnit "cm" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#2e68370e-5638-45be-9a83-a8475a42e87e> .
-
-<https://g-node.org/projects/odml-rdf#7208de4a-63dc-4de4-a655-513c61a86aaf> a rdf:Bag ;
-    rdf:li "Acquisition" .
-
-<https://g-node.org/projects/odml-rdf#746714cd-e798-47f1-9615-fe9422e79545> a rdf:Bag ;
-    rdf:li "none" .
-
-<https://g-node.org/projects/odml-rdf#76899275-b442-4852-9866-5c12ac129f7e> a odml:Section ;
-    odml:hasName "Preparation" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#11e58106-dacc-47b4-b085-6fe17cdb5743>,
-        <https://g-node.org/projects/odml-rdf#19e58b9a-cb2b-4633-b102-2a2a96427a8a>,
-        <https://g-node.org/projects/odml-rdf#44052a1a-efb4-494f-a9d5-dec000ececbd>,
-        <https://g-node.org/projects/odml-rdf#4abb9983-66d0-4fba-8eb8-9d534cb5c5be>,
-        odml:e01a58c5-51c9-4944-94da-6ffbb587ca3c,
-        odml:ee0db711-3f22-4de5-b699-f1acfc1e3a8c,
-        odml:f76074c7-c60d-4b7c-9b62-00d9d55e8d7e ;
-    odml:hasType "Preparation" .
-
-<https://g-node.org/projects/odml-rdf#77833472-01b2-40bf-8002-27f785a2d22d> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Recording quality" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#0b090621-2f8d-43c5-892a-5159486d2d94> .
-
-<https://g-node.org/projects/odml-rdf#78166c57-3f0a-4b0e-af25-6fbc88d64ea3> a rdf:Bag ;
-    rdf:li "0.0" .
-
-<https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd> a odml:Section ;
-    odml:hasName "Recording" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#09da05a7-2929-4eeb-8d9e-33f77d3d1aa3>,
-        <https://g-node.org/projects/odml-rdf#17c5151a-4027-4999-b6ff-2dccca3d049c>,
-        <https://g-node.org/projects/odml-rdf#1d6db4ce-87f3-4e9c-b221-e76ba05b2759>,
-        <https://g-node.org/projects/odml-rdf#338de0a1-fde8-4914-b8fd-6da3fc729160>,
-        <https://g-node.org/projects/odml-rdf#35050ea8-f4f5-452f-a468-f0fe73cb2caa>,
-        <https://g-node.org/projects/odml-rdf#77833472-01b2-40bf-8002-27f785a2d22d>,
-        <https://g-node.org/projects/odml-rdf#9aeede78-678c-4db8-acb5-fbd6d408b762>,
-        odml:c1747b35-e6b2-4b7f-80b9-cbead0243ce0,
-        odml:ca2f5e6b-3dd8-43b1-9741-94f00a42d8b8,
-        odml:d7b64566-73ea-43fc-9f5c-d6adb335e078,
-        odml:e9e8a0ab-7bff-43e4-9fa6-a3018c2002b4,
-        odml:eecba499-0e45-472e-8772-27b4aebabfcc ;
-    odml:hasType "Recording" .
-
-<https://g-node.org/projects/odml-rdf#7e2ba5e3-9a53-4843-8cf3-c8e50500acc9> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Species" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#42b1b6e2-143e-4da4-b200-3be6bd13562b> .
-
-<https://g-node.org/projects/odml-rdf#806a8457-997f-4ab7-a868-ff8a55166931> a rdf:Bag ;
-    rdf:li "0.202" .
-
-<https://g-node.org/projects/odml-rdf#808b277a-bcf9-447c-88c3-f031a11cfe0a> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Additional noise" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#746714cd-e798-47f1-9615-fe9422e79545> .
-
-<https://g-node.org/projects/odml-rdf#8206694d-98bc-46f3-ab7a-308de6ee05b6> a rdf:Bag ;
-    rdf:li "0.14" .
-
-<https://g-node.org/projects/odml-rdf#83526de2-d272-44d7-a5c5-c0d930d9911a> a rdf:Bag ;
-    rdf:li "true" .
-
-<https://g-node.org/projects/odml-rdf#8468c935-7ed1-42f4-a0d5-60864ea9226d> a rdf:Bag ;
-    rdf:li "2010-04-16" .
-
-<https://g-node.org/projects/odml-rdf#856cf579-0a7b-42fc-95c6-7ae6eec79677> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "University" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#04fed34b-abee-45f0-a8a9-b31c13967d02> .
-
-<https://g-node.org/projects/odml-rdf#8e67f9ba-6819-4440-aecc-91b36de49056> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Depth" ;
-    odml:hasUnit "um" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#78166c57-3f0a-4b0e-af25-6fbc88d64ea3> .
-
-<https://g-node.org/projects/odml-rdf#902f9acf-f13c-4b29-ae3b-a9463e480752> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Contrast" ;
-    odml:hasUnit "%" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#5d32c390-3735-4fbb-bb60-e8edb2056693> .
-
-<https://g-node.org/projects/odml-rdf#94654728-fd46-4d0d-b028-af11c1871f6e> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "EOD Frequency" ;
-    odml:hasUnit "Hz" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#48e041ce-ae12-4ea7-acc7-34d24b679638> .
-
-<https://g-node.org/projects/odml-rdf#98fd9c6c-3eb9-4b27-a70d-fb8d83e0bce0> a rdf:Bag ;
-    rdf:li "0.9.6 (04/12/10)" .
-
-<https://g-node.org/projects/odml-rdf#9aeede78-678c-4db8-acb5-fbd6d408b762> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Recording duration" ;
-    odml:hasUnit "m" ;
-    odml:hasValue odml:b6665829-517c-4e1f-98bb-3440520c99ee .
-
-<https://g-node.org/projects/odml-rdf#9d39f328-fda0-4d20-82ea-8fd77e8ede73> a rdf:Bag ;
-    rdf:li "1.82" .
-
-odml:a0427b00-0c00-446d-9a8e-4cbfc4bf3189 a rdf:Bag ;
-    rdf:li "metadata.xml" .
-
-odml:a13e3cf0-1d76-420f-aa48-8da7278355c5 a rdf:Bag ;
-    rdf:li "/home/efish/relacs/plugins/efish/2010-04-16-ab" .
-
-odml:a1625c83-8dff-464e-af87-d17c1004dc7b a rdf:Bag ;
-    rdf:li "2010-04-16-ab" .
-
-odml:a76a3bab-695f-4e68-a88c-27eae1942576 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Creator" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#686b62e7-331d-426d-8446-554792fc0875> .
-
-odml:aad9b7c9-7f6d-4a98-9ec6-bedc62edb9e0 a rdf:Bag ;
-    rdf:li "eFish-Setup" .
-
-odml:ab7572bb-854c-467e-a908-352f112ef109 a rdf:Bag ;
-    rdf:li "RELACS" .
-
-odml:acb39fae-4a71-4d87-b06f-ab06991cb70c a rdf:Bag ;
-    rdf:li "unknown" .
-
-odml:adb90936-7e05-4a7b-bff2-ebe60fa1d6ba a rdf:Bag ;
-    rdf:li 3e+02 .
-
-odml:afbc3b09-1026-4fe3-844d-88733a725590 a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "Duration" ;
-    odml:hasUnit "s" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#271f2645-ad61-4ece-8ca7-3b26f241f185> .
-
-odml:b6665829-517c-4e1f-98bb-3440520c99ee a rdf:Bag ;
-    rdf:li "13.9" .
-
-odml:ba6da178-db8b-4dcb-b6d1-182bd12cf89c a odml:CellProperties ;
-    odml:hasName "Cell properties" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#1bcc15a8-6852-4cbd-8d48-187ff9e61a47>,
-        <https://g-node.org/projects/odml-rdf#3fb77ff1-07da-457b-9b9a-db3c93a9099e>,
-        odml:bebd5743-79d0-4a57-8b96-ad48435103e1 ;
-    odml:hasType "Cell properties" .
-
-odml:bdde80d8-a944-485c-9fd2-2c3f96f871fa a rdf:Bag ;
-    rdf:li "1007.0" .
-
-odml:bebd5743-79d0-4a57-8b96-ad48435103e1 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "EOD Frequency" ;
-    odml:hasUnit "Hz" ;
-    odml:hasValue odml:bdde80d8-a944-485c-9fd2-2c3f96f871fa .
-
-odml:c1747b35-e6b2-4b7f-80b9-cbead0243ce0 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Comment" ;
-    odml:hasValue odml:e6bd7a4f-2205-4197-b334-61c9d4babf6c .
-
-odml:c4eb4dd6-3325-472b-84b4-616a9fca98c6 a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "StandardDeviation" ;
-    odml:hasValue odml:d44d9c3f-53e2-4676-9ab1-4341ecddc3f6 .
-
-odml:c7c6cae0-64bb-4f0d-b852-37a8dc8d8983 a rdf:Bag ;
-    rdf:li "0.0" .
-
-odml:c8e610ef-0f50-4630-8c32-f6a7d49e5f13 a rdf:Bag ;
-    rdf:li "D01-043" .
-
-odml:c9156c75-4cf9-43b8-b1d5-57780e3651a0 a rdf:Bag ;
-    rdf:li "MS 222" .
-
-odml:ca2f5e6b-3dd8-43b1-9741-94f00a42d8b8 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Software version" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#98fd9c6c-3eb9-4b27-a70d-fb8d83e0bce0> .
-
-odml:ca686128-b4a8-433f-8e47-011ef7cf30db a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "SampleRate" ;
-    odml:hasUnit "s" ;
-    odml:hasValue odml:d32e9dbf-c485-4d8d-90d6-a34ba02c9422 .
-
-odml:cd24b60f-1d5e-4040-9881-5e5a597baef7 a odml:Document ;
-    odml:hasAuthor "grewe" ;
-    odml:hasSection <https://g-node.org/projects/odml-rdf#2a9e6f04-8d2f-4aca-b129-e77e88b023a1>,
-        <https://g-node.org/projects/odml-rdf#2cc180c9-c02a-4179-8ab2-bffea408df72>,
-        <https://g-node.org/projects/odml-rdf#41fff657-5521-4ef8-87a6-95b5ed05af71>,
-        <https://g-node.org/projects/odml-rdf#4620a3bf-3316-4a00-9fa0-206aaf520d4a>,
-        <https://g-node.org/projects/odml-rdf#76899275-b442-4852-9866-5c12ac129f7e>,
-        <https://g-node.org/projects/odml-rdf#782bd29d-e4b0-4c14-a417-1772a4851ffd>,
-        odml:ba6da178-db8b-4dcb-b6d1-182bd12cf89c .
-
-odml:d32e9dbf-c485-4d8d-90d6-a34ba02c9422 a rdf:Bag ;
-    rdf:li 1e-03 .
-
-odml:d44d9c3f-53e2-4676-9ab1-4341ecddc3f6 a rdf:Bag ;
-    rdf:li 3e-01 .
-
-odml:d59a760f-12a9-4738-87ba-c1691d86cbc3 a rdf:Bag ;
-    rdf:li "0.0" .
-
-odml:d6ca1018-ac58-4b63-a6a5-8c5ca28c7c99 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Structure" ;
-    odml:hasValue odml:fa67ea93-1640-4a2c-bc67-2915bb2955c9 .
-
-odml:d7b64566-73ea-43fc-9f5c-d6adb335e078 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Experimenter" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#2cb8e72c-7af0-4677-a712-126f20d33feb> .
-
-odml:dd337c00-e453-4952-a3c6-eb4a5e7f8eb2 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Additional noise contrast" ;
-    odml:hasUnit "%" ;
-    odml:hasValue odml:c7c6cae0-64bb-4f0d-b852-37a8dc8d8983 .
-
-odml:e01a58c5-51c9-4944-94da-6ffbb587ca3c a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Anaesthetic" ;
-    odml:hasValue odml:c9156c75-4cf9-43b8-b1d5-57780e3651a0 .
-
-odml:e33108e2-72cc-4833-a1e6-e5439df682f0 a rdf:Bag ;
-    rdf:li "true" .
-
-odml:e6bd7a4f-2205-4197-b334-61c9d4babf6c a rdf:Bag ;
-    rdf:li "weak response" .
-
-odml:e9417a2c-20ac-4f0d-99ab-5de3c36ef73d a rdf:Bag ;
-    rdf:li "136.0" .
-
-odml:e9e8a0ab-7bff-43e4-9fa6-a3018c2002b4 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Name" ;
-    odml:hasValue odml:a1625c83-8dff-464e-af87-d17c1004dc7b .
-
-odml:eb0f32a8-8d54-402a-9023-1230229216b4 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Maintainer" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#5d9c35e1-884c-4741-b18e-662355f345ff> .
-
-odml:ee0db711-3f22-4de5-b699-f1acfc1e3a8c a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "AnaestheticDose" ;
-    odml:hasUnit "mg" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#1f7ca003-f96e-4ed6-9bcc-5f3b5dd8913e> .
-
-odml:ee931e48-ee0b-474d-a59a-fa89b0b69443 a rdf:Bag ;
-    rdf:li " 82152 Planegg-Martinsried",
-        " Germany",
-        "Grosshaderner Str. 2" .
-
-odml:eecba499-0e45-472e-8772-27b4aebabfcc a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "File" ;
-    odml:hasValue odml:a0427b00-0c00-446d-9a8e-4cbfc4bf3189 .
-
-odml:f1f790f6-e72f-42a8-95a8-06dc28acfc36 a rdf:Bag ;
-    rdf:li "Lidocaine" .
-
-odml:f76074c7-c60d-4b7c-9b62-00d9d55e8d7e a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Anaesthesia" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#83526de2-d272-44d7-a5c5-c0d930d9911a> .
-
-odml:fa67ea93-1640-4a2c-bc67-2915bb2955c9 a rdf:Bag ;
-    rdf:li "Nerve" .
-

+ 0 - 647
code/python-odml/doc/example_rdfs/example_data/drosophila_2.ttl

@@ -1,647 +0,0 @@
-@prefix odml: <https://g-node.org/projects/odml-rdf#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@prefix xml: <http://www.w3.org/XML/1998/namespace> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-
-odml:Hub odml:hasDocument <https://g-node.org/projects/odml-rdf#24066355-1ee8-4eb5-a715-96bbb6231cd5> ;
-    odml:hasTerminology <https://g-node.org/projects/odml-rdf#7517fc3b-a12c-47b3-bfc5-96cc98fefa8a> .
-
-<https://g-node.org/projects/odml-rdf#0010ab6b-8df8-43f0-bdbb-83b6ca48ea95> a rdf:Bag ;
-    rdf:li "ERG" .
-
-<https://g-node.org/projects/odml-rdf#027d9009-0daf-4f70-8534-9ab62cc84783> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "status" ;
-    odml:hasValue odml:b7737a33-0208-4ed6-a1f4-229bd38e407a .
-
-<https://g-node.org/projects/odml-rdf#03933b64-b534-41fe-b49f-1baf678d765f> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "University" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#7352f386-9597-490d-a715-0b944da6674a> .
-
-<https://g-node.org/projects/odml-rdf#0566d591-3cf9-44ad-89a0-8fb44ae5df3f> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Maintainer" ;
-    odml:hasValue odml:b4a4e4a1-9d62-41f3-820b-30ef75976ee7 .
-
-<https://g-node.org/projects/odml-rdf#092ae43b-6420-4380-bd09-fd8b312b3f05> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Institute" ;
-    odml:hasValue odml:f8952205-78e3-4200-ab8b-9b4d1869cc94 .
-
-<https://g-node.org/projects/odml-rdf#09949686-17cf-4510-a0d5-6baa92b0b813> a rdf:Bag ;
-    rdf:li "2" .
-
-<https://g-node.org/projects/odml-rdf#0b097cef-e1c9-4b66-a965-33393c8eb99c> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "PWM" ;
-    odml:hasUnit "bit" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#18e6bb65-2069-413f-a9d0-a48edee6c02d> .
-
-<https://g-node.org/projects/odml-rdf#0ca52594-6cd5-4075-bb29-9074a6e678c2> a rdf:Bag ;
-    rdf:li "Female" .
-
-<https://g-node.org/projects/odml-rdf#0def9f18-deb0-4005-a3e0-5c8d9fef0dd4> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "Current" ;
-    odml:hasUnit "bit" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#665ef777-fe77-41ca-842a-91b198602a70> .
-
-<https://g-node.org/projects/odml-rdf#0e39c050-5fee-4968-95c7-c18a06868bfe> a rdf:Bag ;
-    rdf:li " metadata.xml",
-        " recording-events.dat",
-        " restart-events.dat",
-        " stimuli.dat",
-        " stimulus-descriptions.dat",
-        " stimulus-events.dat",
-        " stimulus-metadata.xml",
-        " trace-2.raw",
-        " trigger-1-events.dat",
-        " trigger-2-events.dat",
-        "trace-1.raw" .
-
-<https://g-node.org/projects/odml-rdf#0ed215a2-5d20-48eb-b744-bf3b731459fc> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "Recording duration" ;
-    odml:hasUnit "min" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#81954286-ef07-4b34-9522-59ef72bad2bd> .
-
-<https://g-node.org/projects/odml-rdf#11474284-8628-42e2-80f8-4d538d1a7837> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "max sampling rate" ;
-    odml:hasUnit "kHz" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#7a5c4065-e9ca-46eb-a854-5de5232f03dc> .
-
-<https://g-node.org/projects/odml-rdf#12a2d7ea-e5aa-48a7-a71c-fb080822f308> a rdf:Bag ;
-    rdf:li "Comedi Analog Output" .
-
-<https://g-node.org/projects/odml-rdf#133a90a1-f25e-44d8-bfb3-85aa5a48f840> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "Repeats" ;
-    odml:hasUnit "times" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#49bbebba-0d97-47c8-bafb-38f53e74b798> .
-
-<https://g-node.org/projects/odml-rdf#18e6bb65-2069-413f-a9d0-a48edee6c02d> a rdf:Bag ;
-    rdf:li 4e+03 .
-
-<https://g-node.org/projects/odml-rdf#1a292ddc-46a4-435b-bd69-baa0da5f1d1a> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "ident" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#3fe3e151-f2a8-46b2-ab6f-686fc6e32bd7> .
-
-<https://g-node.org/projects/odml-rdf#1b80dd46-2015-4390-99ec-51e1a3951cbc> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "status" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#80eb2226-c30e-4ff5-a22f-77c72285fd18> .
-
-<https://g-node.org/projects/odml-rdf#1b865c7a-545f-49d4-9e28-c64f1e95cfa6> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "OFFDuration" ;
-    odml:hasUnit "ms" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#6cd583fb-d65a-4460-bd40-9eced22f20b4> .
-
-<https://g-node.org/projects/odml-rdf#1de1c115-c6f0-4171-847d-a4870e38f55d> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "file" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#85d13f2b-526d-4495-95ad-d80add3d60ac> .
-
-<https://g-node.org/projects/odml-rdf#1f388685-63ab-411a-964f-a2ecac4f795d> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Species" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#251130b3-c67f-4b21-bb1c-103f4c85bd71> .
-
-<https://g-node.org/projects/odml-rdf#1fd95053-f7c4-46a1-a85c-f3d5cf5f1801> a rdf:Bag ;
-    rdf:li 5e+02 .
-
-<https://g-node.org/projects/odml-rdf#211e63cb-dba1-4071-993e-3d61ec94e489> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Comment" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#470602cb-1bf9-42d5-9480-2188cbbc6675> .
-
-<https://g-node.org/projects/odml-rdf#24066355-1ee8-4eb5-a715-96bbb6231cd5> a odml:Document ;
-    odml:hasSection odml:a011e796-7734-49cc-a45f-d23e29ff42d0,
-        odml:bbd44815-5016-49e0-9f4b-5b83778d00de,
-        odml:dac9a5dd-f585-4dbe-83f9-05abbc31163d,
-        odml:eafb65db-af11-42f6-93fd-1b4e43732281,
-        odml:f652d9fd-168e-4733-8220-4d7c6f2ee87e ;
-    odml:hasTerminology <https://g-node.org/projects/odml-rdf#7517fc3b-a12c-47b3-bfc5-96cc98fefa8a> .
-
-<https://g-node.org/projects/odml-rdf#251130b3-c67f-4b21-bb1c-103f4c85bd71> a rdf:Bag ;
-    rdf:li "Drosophila melanogaster" .
-
-<https://g-node.org/projects/odml-rdf#2552899e-c1ef-48d9-a250-3263579aa99a> a odml:Property ;
-    odml:hasDtype "integer" ;
-    odml:hasName "bits" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#6314e147-48e3-4f1e-8cc8-4b9b5eb18623> .
-
-<https://g-node.org/projects/odml-rdf#2a3eca28-1478-49d6-8235-6deee4c49818> a rdf:Bag ;
-    rdf:li "Christian Garbers" .
-
-<https://g-node.org/projects/odml-rdf#2c33c31e-1710-4d07-99d0-f9724bb2a6a3> a odml:Section ;
-    odml:hasName "hardware-Miscellaneous-2012-05-25-ad" ;
-    odml:hasType "Miscellaneous" .
-
-<https://g-node.org/projects/odml-rdf#2c589269-a2a6-4348-b917-529dc9d143fb> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "Age" ;
-    odml:hasUnit "days" ;
-    odml:hasValue odml:a11c652d-0c91-45b3-98e5-cc12b561e7dd .
-
-<https://g-node.org/projects/odml-rdf#2cc13c8d-b665-4121-bf31-a986f5cb8bcf> a rdf:Bag ;
-    rdf:li 4e+03 .
-
-<https://g-node.org/projects/odml-rdf#2d6f5b17-74b5-4a66-9a37-7bfbd28b3600> a odml:Property ;
-    odml:hasDtype "integer" ;
-    odml:hasName "run" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#9897200d-2ce5-48e6-a998-095d7fc87b87> .
-
-<https://g-node.org/projects/odml-rdf#3a65144d-7e2f-4c18-9d55-29ad3a817c86> a rdf:Bag ;
-    rdf:li 4e+03 .
-
-<https://g-node.org/projects/odml-rdf#3ba8ef6b-2b37-408c-98ad-9523cabc30f7> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Name" ;
-    odml:hasValue odml:df60c748-b07b-4a22-a9ab-bf7bd5a7d3bc .
-
-<https://g-node.org/projects/odml-rdf#3c19b298-18bb-4893-92f0-0eaa8e4afecb> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "ident" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#66fa4771-1028-4d2f-958e-abed0ae020e7> .
-
-<https://g-node.org/projects/odml-rdf#3f213388-ccc7-417b-9879-9c8a2ca1bcca> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "Temperature" ;
-    odml:hasUnit "C" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#4d766401-4644-4d62-b67b-422671c9a8b0> .
-
-<https://g-node.org/projects/odml-rdf#3fe3e151-f2a8-46b2-ab6f-686fc6e32bd7> a rdf:Bag ;
-    rdf:li "ai-1" .
-
-<https://g-node.org/projects/odml-rdf#40ca91e7-c6dc-4d0e-97aa-47eac358d96f> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "File" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#0e39c050-5fee-4968-95c7-c18a06868bfe> .
-
-<https://g-node.org/projects/odml-rdf#41299678-838a-4ff8-81bb-78203f45b8a8> a odml:Section ;
-    odml:hasName "hardware-DataAcquisition-2012-05-25-ad" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#11474284-8628-42e2-80f8-4d538d1a7837>,
-        <https://g-node.org/projects/odml-rdf#1a292ddc-46a4-435b-bd69-baa0da5f1d1a>,
-        <https://g-node.org/projects/odml-rdf#1b80dd46-2015-4390-99ec-51e1a3951cbc>,
-        <https://g-node.org/projects/odml-rdf#2552899e-c1ef-48d9-a250-3263579aa99a>,
-        <https://g-node.org/projects/odml-rdf#67fb1f68-b5a6-4445-afb6-b47f2ff6f3ff>,
-        odml:b67604bf-d651-46c4-998d-2fcb95fd3305,
-        odml:d74b8ced-dfc9-462f-84d6-d7e27722bf18,
-        odml:e7f44cd0-dde3-4c6f-b026-4903fdb5962b,
-        odml:ea1c11e5-816b-43cd-b9c6-0aef57c3b38f ;
-    odml:hasType "DataAcquisition" .
-
-<https://g-node.org/projects/odml-rdf#470602cb-1bf9-42d5-9480-2188cbbc6675> a rdf:Bag ;
-    rdf:li "Light Guide led blue luxeon" .
-
-<https://g-node.org/projects/odml-rdf#49bbebba-0d97-47c8-bafb-38f53e74b798> a rdf:Bag ;
-    rdf:li 1e+01 .
-
-<https://g-node.org/projects/odml-rdf#4a27fd82-2f95-4aeb-bcca-3b3258a61173> a rdf:Bag ;
-    rdf:li "RELACS" .
-
-<https://g-node.org/projects/odml-rdf#4ca1a1cf-0cad-4e52-b26c-0403d2a7019d> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Name" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#5a9d0d41-18b7-4cd8-869d-37301544b18f> .
-
-<https://g-node.org/projects/odml-rdf#4d766401-4644-4d62-b67b-422671c9a8b0> a rdf:Bag ;
-    rdf:li 2.4e+01 .
-
-<https://g-node.org/projects/odml-rdf#4e29e4cb-9078-4ffb-b11c-f88b9329382c> a rdf:Bag ;
-    rdf:li "ni_pcimio" .
-
-<https://g-node.org/projects/odml-rdf#4ff87ce2-54f0-4e74-a86b-7bbd2102b952> a odml:Property ;
-    odml:hasDtype "time" ;
-    odml:hasName "Time" ;
-    odml:hasValue odml:b4ee5100-96f6-4aac-94d4-ce6f1716fe01 .
-
-<https://g-node.org/projects/odml-rdf#50711959-3a71-472b-b904-98af73b2b0fe> a rdf:Bag ;
-    rdf:li "ComediAnalogInput" .
-
-<https://g-node.org/projects/odml-rdf#5094931b-4ecc-4808-9893-635a9bbddf59> a rdf:Bag ;
-    rdf:li "2011-11-30"^^xsd:date .
-
-<https://g-node.org/projects/odml-rdf#544e0d0e-f4e9-4c30-a44e-db5d9c11b1f1> a odml:Section ;
-    odml:hasName "hardware-DataAcquisition-2012-05-25-ad-2" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#027d9009-0daf-4f70-8534-9ab62cc84783>,
-        <https://g-node.org/projects/odml-rdf#1de1c115-c6f0-4171-847d-a4870e38f55d>,
-        <https://g-node.org/projects/odml-rdf#3c19b298-18bb-4893-92f0-0eaa8e4afecb>,
-        <https://g-node.org/projects/odml-rdf#55106ce5-a4d5-4eb2-b22b-917992ed02d5>,
-        <https://g-node.org/projects/odml-rdf#5e71f9f8-1fa4-457b-8028-4c3065a5af39>,
-        <https://g-node.org/projects/odml-rdf#5fe06e93-4907-4ea5-8ccf-ed46d08f68a6>,
-        odml:b07a6eba-b193-47bc-bc10-7ff999440f78,
-        odml:b2445941-01a5-45bf-b4d8-5ecf1281bc9c,
-        odml:d6d98028-8be6-4796-86b5-6a6bddf1eda2 ;
-    odml:hasType "DataAcquisition" .
-
-<https://g-node.org/projects/odml-rdf#55106ce5-a4d5-4eb2-b22b-917992ed02d5> a odml:Property ;
-    odml:hasDtype "integer" ;
-    odml:hasName "bits" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#9462afbe-3a9e-43e8-a38f-59c72ebeae33> .
-
-<https://g-node.org/projects/odml-rdf#55872e99-a430-4157-bad6-08e4d4862c68> a rdf:Bag ;
-    rdf:li 2.5e+01 .
-
-<https://g-node.org/projects/odml-rdf#584ecbc8-af86-45ef-923e-e9b824f60ab4> a rdf:Bag ;
-    rdf:li 2.5e+01 .
-
-<https://g-node.org/projects/odml-rdf#589236ee-3c19-4ab5-827d-596c5b72efb1> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "OFFDuration1" ;
-    odml:hasUnit "ms" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#1fd95053-f7c4-46a1-a85c-f3d5cf5f1801> .
-
-<https://g-node.org/projects/odml-rdf#5a9d0d41-18b7-4cd8-869d-37301544b18f> a rdf:Bag ;
-    rdf:li "2012-05-25-ad" .
-
-<https://g-node.org/projects/odml-rdf#5e71f9f8-1fa4-457b-8028-4c3065a5af39> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "vendor" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#6c5a5796-9c6b-4789-8514-883420d6f30e> .
-
-<https://g-node.org/projects/odml-rdf#5e9840dd-2dff-45ba-a3f1-a36dad28e97a> a odml:Property ;
-    odml:hasDtype "date" ;
-    odml:hasName "date" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#5094931b-4ecc-4808-9893-635a9bbddf59> .
-
-<https://g-node.org/projects/odml-rdf#5fe06e93-4907-4ea5-8ccf-ed46d08f68a6> a odml:Property ;
-    odml:hasDtype "integer" ;
-    odml:hasName "channels" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#09949686-17cf-4510-a0d5-6baa92b0b813> .
-
-<https://g-node.org/projects/odml-rdf#6314e147-48e3-4f1e-8cc8-4b9b5eb18623> a rdf:Bag ;
-    rdf:li "16" .
-
-<https://g-node.org/projects/odml-rdf#665ef777-fe77-41ca-842a-91b198602a70> a rdf:Bag ;
-    rdf:li 4e+03 .
-
-<https://g-node.org/projects/odml-rdf#66fa4771-1028-4d2f-958e-abed0ae020e7> a rdf:Bag ;
-    rdf:li "ao-1" .
-
-<https://g-node.org/projects/odml-rdf#67fb1f68-b5a6-4445-afb6-b47f2ff6f3ff> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "vendor" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#4e29e4cb-9078-4ffb-b11c-f88b9329382c> .
-
-<https://g-node.org/projects/odml-rdf#6c5a5796-9c6b-4789-8514-883420d6f30e> a rdf:Bag ;
-    rdf:li "ni_pcimio" .
-
-<https://g-node.org/projects/odml-rdf#6cd583fb-d65a-4460-bd40-9eced22f20b4> a rdf:Bag ;
-    rdf:li 5e+02 .
-
-<https://g-node.org/projects/odml-rdf#6e1c7f7c-99c9-45fd-ac1e-8c359edfd71a> a rdf:Bag ;
-    rdf:li "16" .
-
-<https://g-node.org/projects/odml-rdf#7163942e-423c-4fdb-b28a-9bd64479e1e0> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Software" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#4a27fd82-2f95-4aeb-bcca-3b3258a61173> .
-
-<https://g-node.org/projects/odml-rdf#7352f386-9597-490d-a715-0b944da6674a> a rdf:Bag ;
-    rdf:li " Munich",
-        "Ludwig-Maximilian University" .
-
-<https://g-node.org/projects/odml-rdf#74257e9c-04f3-49b3-9c2e-356cef8450b8> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "Current1" ;
-    odml:hasUnit "bit" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#2cc13c8d-b665-4121-bf31-a986f5cb8bcf> .
-
-<https://g-node.org/projects/odml-rdf#756395cf-7874-45d3-97ca-9c009c3bef6a> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "repro" ;
-    odml:hasValue odml:ff5fb5e5-5104-41c8-ab45-9d8787e7fbdc .
-
-<https://g-node.org/projects/odml-rdf#7a5c4065-e9ca-46eb-a854-5de5232f03dc> a rdf:Bag ;
-    rdf:li 2.5e+02 .
-
-<https://g-node.org/projects/odml-rdf#7c4b6e45-54c8-43d7-aed6-1b07515c50bd> a rdf:Bag ;
-    rdf:li "Good" .
-
-<https://g-node.org/projects/odml-rdf#80eb2226-c30e-4ff5-a22f-77c72285fd18> a rdf:Bag ;
-    rdf:li "open" .
-
-<https://g-node.org/projects/odml-rdf#81954286-ef07-4b34-9522-59ef72bad2bd> a rdf:Bag ;
-    rdf:li 3.3e-01 .
-
-<https://g-node.org/projects/odml-rdf#85b3d3ac-e1cb-4921-96cd-c167c1d17b87> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "version" ;
-    odml:hasValue odml:b0e9d8e2-74ef-41c1-a4c0-ae394da3b11a .
-
-<https://g-node.org/projects/odml-rdf#85d13f2b-526d-4495-95ad-d80add3d60ac> a rdf:Bag ;
-    rdf:li "/dev/comedi1" .
-
-<https://g-node.org/projects/odml-rdf#884517bb-266d-402e-a4e7-1375f02bc1dc> a rdf:Bag ;
-    rdf:li "Acquisition" .
-
-<https://g-node.org/projects/odml-rdf#88ce32a1-38e5-4a19-a044-27a45b4b3869> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "project" .
-
-<https://g-node.org/projects/odml-rdf#8c01989e-8c31-4950-bc6f-f83255405dc6> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "OnDuration" ;
-    odml:hasUnit "ms" ;
-    odml:hasValue odml:b9efabdb-5bef-42d4-8b16-4954bbd91cf1 .
-
-<https://g-node.org/projects/odml-rdf#8cda5b50-b7b3-4469-acd0-b2b31b0f2beb> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "PWM1" ;
-    odml:hasUnit "bit" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#3a65144d-7e2f-4c18-9d55-29ad3a817c86> .
-
-<https://g-node.org/projects/odml-rdf#9462afbe-3a9e-43e8-a38f-59c72ebeae33> a rdf:Bag ;
-    rdf:li "16" .
-
-<https://g-node.org/projects/odml-rdf#94e6c5b1-e4c8-4093-b7c5-ccbe6f638163> a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "LED1" ;
-    odml:hasUnit "LEDNr." ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#55872e99-a430-4157-bad6-08e4d4862c68> .
-
-<https://g-node.org/projects/odml-rdf#9707cfc4-4c6e-4807-acb6-e6c8a316b271> a rdf:Bag ;
-    rdf:li "0.9.7 (01/24/12)" .
-
-<https://g-node.org/projects/odml-rdf#9897200d-2ce5-48e6-a998-095d7fc87b87> a rdf:Bag ;
-    rdf:li "0" .
-
-<https://g-node.org/projects/odml-rdf#98c35db4-64ca-4c11-a154-75eb2dab25a4> a rdf:Bag ;
-    rdf:li "ninaep334/+ ort us2515/+" .
-
-<https://g-node.org/projects/odml-rdf#9dec4b68-4918-48ef-a0e7-dfed2b8c4819> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Folder" ;
-    odml:hasValue odml:be63a242-6db7-483d-bf6a-64077cdc6cac .
-
-<https://g-node.org/projects/odml-rdf#9fd97c3d-9074-4633-9054-68e0cac27d44> a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Address" ;
-    odml:hasValue odml:e8cbf0df-c765-4750-a3b6-444ac36a88cf .
-
-odml:a011e796-7734-49cc-a45f-d23e29ff42d0 a odml:Hardware ;
-    odml:hasName "hardware-2012-05-25-ad" ;
-    odml:hasSection <https://g-node.org/projects/odml-rdf#2c33c31e-1710-4d07-99d0-f9724bb2a6a3>,
-        <https://g-node.org/projects/odml-rdf#41299678-838a-4ff8-81bb-78203f45b8a8>,
-        <https://g-node.org/projects/odml-rdf#544e0d0e-f4e9-4c30-a44e-db5d9c11b1f1> ;
-    odml:hasType "hardware" .
-
-odml:a11c652d-0c91-45b3-98e5-cc12b561e7dd a rdf:Bag ;
-    rdf:li 1e+00 .
-
-odml:a1344fb2-4e77-47c6-9a4a-2f7bd4714e9a a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Lab" ;
-    odml:hasValue odml:cf5c6add-3d12-4fd8-b229-87831249509b .
-
-odml:a53f77d6-e850-453a-b387-0386799b7490 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Mode" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#884517bb-266d-402e-a4e7-1375f02bc1dc> .
-
-odml:a5b2b6c2-35fe-4959-80f1-bc45ff102b53 a rdf:Bag ;
-    rdf:li "Christian" .
-
-odml:acfde6b6-77a4-4c63-b86f-eb43e5d82301 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "author" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#2a3eca28-1478-49d6-8235-6deee4c49818> .
-
-odml:ae74e725-fe1a-4a60-b735-ffa32743d721 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Room" ;
-    odml:hasValue odml:dad4f10b-45ef-4009-a15b-078dd30f3463 .
-
-odml:b07a6eba-b193-47bc-bc10-7ff999440f78 a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "max sampling rate" ;
-    odml:hasUnit "kHz" ;
-    odml:hasValue odml:b3a83ed7-e54a-4e5b-89a2-8eb5f752e064 .
-
-odml:b0864440-6235-4b8a-ba35-cbef3a987e79 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Genotype" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#98c35db4-64ca-4c11-a154-75eb2dab25a4> .
-
-odml:b0e9d8e2-74ef-41c1-a4c0-ae394da3b11a a rdf:Bag ;
-    rdf:li "0.1" .
-
-odml:b2445941-01a5-45bf-b4d8-5ecf1281bc9c a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "class" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#12a2d7ea-e5aa-48a7-a71c-fb080822f308> .
-
-odml:b3a83ed7-e54a-4e5b-89a2-8eb5f752e064 a rdf:Bag ;
-    rdf:li 8.33333e+02 .
-
-odml:b4a4e4a1-9d62-41f3-820b-30ef75976ee7 a rdf:Bag ;
-    rdf:li "Christian Garbers" .
-
-odml:b4ee5100-96f6-4aac-94d4-ce6f1716fe01 a rdf:Bag ;
-    rdf:li "14:56:33"^^xsd:time .
-
-odml:b5200234-2272-4da8-b9ca-39fab8278bc6 a rdf:Bag ;
-    rdf:li "pci-6221" .
-
-odml:b67604bf-d651-46c4-998d-2fcb95fd3305 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "name" ;
-    odml:hasValue odml:e43966f5-b473-4aca-b12b-d3b6586817ef .
-
-odml:b7737a33-0208-4ed6-a1f4-229bd38e407a a rdf:Bag ;
-    rdf:li "open" .
-
-odml:b8a206f1-b181-4a1c-982c-74c74b4bb758 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "experiment" .
-
-odml:b9efabdb-5bef-42d4-8b16-4954bbd91cf1 a rdf:Bag ;
-    rdf:li 5e+02 .
-
-odml:bbd44815-5016-49e0-9f4b-5b83778d00de a odml:Section ;
-    odml:hasName "Recording-2012-05-25-ad" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#0ed215a2-5d20-48eb-b744-bf3b731459fc>,
-        <https://g-node.org/projects/odml-rdf#211e63cb-dba1-4071-993e-3d61ec94e489>,
-        <https://g-node.org/projects/odml-rdf#3f213388-ccc7-417b-9879-9c8a2ca1bcca>,
-        <https://g-node.org/projects/odml-rdf#40ca91e7-c6dc-4d0e-97aa-47eac358d96f>,
-        <https://g-node.org/projects/odml-rdf#4ca1a1cf-0cad-4e52-b26c-0403d2a7019d>,
-        <https://g-node.org/projects/odml-rdf#4ff87ce2-54f0-4e74-a86b-7bbd2102b952>,
-        <https://g-node.org/projects/odml-rdf#7163942e-423c-4fdb-b28a-9bd64479e1e0>,
-        <https://g-node.org/projects/odml-rdf#9dec4b68-4918-48ef-a0e7-dfed2b8c4819>,
-        odml:a53f77d6-e850-453a-b387-0386799b7490,
-        odml:bfb16db5-559a-4cf8-9f9f-94e551fa1af2,
-        odml:d2b3f9fe-45ca-441e-bb45-c6464d5e8651,
-        odml:f2f20cd6-75f2-4d1b-8e67-5bdd62cdf402,
-        odml:fadffec7-6b23-454e-bfd1-9d5884802abb ;
-    odml:hasType "Recording" .
-
-odml:be63a242-6db7-483d-bf6a-64077cdc6cac a rdf:Bag ;
-    rdf:li "/home/erg/relacs/plugins/erg/2012-05-25-ad" .
-
-odml:bfb16db5-559a-4cf8-9f9f-94e551fa1af2 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Recording quality" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#7c4b6e45-54c8-43d7-aed6-1b07515c50bd> .
-
-odml:c2dfd387-a4d4-47a5-a277-8dc41b2d90f0 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Creator" ;
-    odml:hasValue odml:ec4f0d03-0d1c-4487-8d8a-b94090862c70 .
-
-odml:cf5c6add-3d12-4fd8-b229-87831249509b a rdf:Bag ;
-    rdf:li "Jan Benda" .
-
-odml:d223e4ac-aebe-42ab-ace7-9a0a8ea7171e a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "filename.dat" ;
-    odml:hasValue odml:d7640889-04b6-440b-9a08-0a8d8e3f39cf .
-
-odml:d253198d-5d94-4551-81f0-71ff15498cfb a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "OnDuration1" ;
-    odml:hasUnit "ms" ;
-    odml:hasValue odml:f78aff8e-09ca-460f-afd9-69f6f2a004f2 .
-
-odml:d2b3f9fe-45ca-441e-bb45-c6464d5e8651 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Experimentalist" ;
-    odml:hasValue odml:a5b2b6c2-35fe-4959-80f1-bc45ff102b53 .
-
-odml:d6d98028-8be6-4796-86b5-6a6bddf1eda2 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "name" ;
-    odml:hasValue odml:b5200234-2272-4da8-b9ca-39fab8278bc6 .
-
-odml:d74b8ced-dfc9-462f-84d6-d7e27722bf18 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "class" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#50711959-3a71-472b-b904-98af73b2b0fe> .
-
-odml:d7640889-04b6-440b-9a08-0a8d8e3f39cf a rdf:Bag ;
-    rdf:li "brigth_green.dat" .
-
-odml:dac9a5dd-f585-4dbe-83f9-05abbc31163d a odml:Section ;
-    odml:hasName "Setup-2012-05-25-ad" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#03933b64-b534-41fe-b49f-1baf678d765f>,
-        <https://g-node.org/projects/odml-rdf#0566d591-3cf9-44ad-89a0-8fb44ae5df3f>,
-        <https://g-node.org/projects/odml-rdf#092ae43b-6420-4380-bd09-fd8b312b3f05>,
-        <https://g-node.org/projects/odml-rdf#3ba8ef6b-2b37-408c-98ad-9523cabc30f7>,
-        <https://g-node.org/projects/odml-rdf#9fd97c3d-9074-4633-9054-68e0cac27d44>,
-        odml:a1344fb2-4e77-47c6-9a4a-2f7bd4714e9a,
-        odml:ae74e725-fe1a-4a60-b735-ffa32743d721,
-        odml:c2dfd387-a4d4-47a5-a277-8dc41b2d90f0 ;
-    odml:hasType "Setup" .
-
-odml:dad4f10b-45ef-4009-a15b-078dd30f3463 a rdf:Bag ;
-    rdf:li "D01.043" .
-
-odml:deefc022-0a73-4cfd-8bda-725386dbb22e a odml:Section ;
-    odml:hasName "dataset-settings-2012-05-25-ad-simpleErg-0" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#0b097cef-e1c9-4b66-a965-33393c8eb99c>,
-        <https://g-node.org/projects/odml-rdf#0def9f18-deb0-4005-a3e0-5c8d9fef0dd4>,
-        <https://g-node.org/projects/odml-rdf#133a90a1-f25e-44d8-bfb3-85aa5a48f840>,
-        <https://g-node.org/projects/odml-rdf#1b865c7a-545f-49d4-9e28-c64f1e95cfa6>,
-        <https://g-node.org/projects/odml-rdf#589236ee-3c19-4ab5-827d-596c5b72efb1>,
-        <https://g-node.org/projects/odml-rdf#74257e9c-04f3-49b3-9c2e-356cef8450b8>,
-        <https://g-node.org/projects/odml-rdf#8c01989e-8c31-4950-bc6f-f83255405dc6>,
-        <https://g-node.org/projects/odml-rdf#8cda5b50-b7b3-4469-acd0-b2b31b0f2beb>,
-        <https://g-node.org/projects/odml-rdf#94e6c5b1-e4c8-4093-b7c5-ccbe6f638163>,
-        odml:d223e4ac-aebe-42ab-ace7-9a0a8ea7171e,
-        odml:d253198d-5d94-4551-81f0-71ff15498cfb,
-        odml:e51f67b7-ad9c-4a99-84fa-798de6f22460 ;
-    odml:hasType "settings" .
-
-odml:df60c748-b07b-4a22-a9ab-bf7bd5a7d3bc a rdf:Bag ;
-    rdf:li "Setup1" .
-
-odml:e15fb117-9a78-451d-950b-fee37913fa31 a rdf:Bag ;
-    rdf:li "/dev/comedi1" .
-
-odml:e43966f5-b473-4aca-b12b-d3b6586817ef a rdf:Bag ;
-    rdf:li "pci-6221" .
-
-odml:e51f67b7-ad9c-4a99-84fa-798de6f22460 a odml:Property ;
-    odml:hasDtype "float" ;
-    odml:hasName "LED" ;
-    odml:hasUnit "LEDNr." ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#584ecbc8-af86-45ef-923e-e9b824f60ab4> .
-
-odml:e7f44cd0-dde3-4c6f-b026-4903fdb5962b a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "file" ;
-    odml:hasValue odml:e15fb117-9a78-451d-950b-fee37913fa31 .
-
-odml:e8cbf0df-c765-4750-a3b6-444ac36a88cf a rdf:Bag ;
-    rdf:li " 82152 Planegg-Martinsried",
-        " Germany",
-        "Grosshaderner Str. 2" .
-
-odml:e98efca2-dae9-43fa-9628-66ec93c089c3 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Preparation" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#0010ab6b-8df8-43f0-bdbb-83b6ca48ea95> .
-
-odml:ea1c11e5-816b-43cd-b9c6-0aef57c3b38f a odml:Property ;
-    odml:hasDtype "integer" ;
-    odml:hasName "channels" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#6e1c7f7c-99c9-45fd-ac1e-8c359edfd71a> .
-
-odml:eafb65db-af11-42f6-93fd-1b4e43732281 a odml:Dataset ;
-    odml:hasName "dataset-2012-05-25-ad-simpleErg-0" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#2d6f5b17-74b5-4a66-9a37-7bfbd28b3600>,
-        <https://g-node.org/projects/odml-rdf#5e9840dd-2dff-45ba-a3f1-a36dad28e97a>,
-        <https://g-node.org/projects/odml-rdf#756395cf-7874-45d3-97ca-9c009c3bef6a>,
-        <https://g-node.org/projects/odml-rdf#85b3d3ac-e1cb-4921-96cd-c167c1d17b87>,
-        <https://g-node.org/projects/odml-rdf#88ce32a1-38e5-4a19-a044-27a45b4b3869>,
-        odml:acfde6b6-77a4-4c63-b86f-eb43e5d82301,
-        odml:b8a206f1-b181-4a1c-982c-74c74b4bb758 ;
-    odml:hasSection odml:deefc022-0a73-4cfd-8bda-725386dbb22e ;
-    odml:hasType "dataset" .
-
-odml:ec4f0d03-0d1c-4487-8d8a-b94090862c70 a rdf:Bag ;
-    rdf:li "Jan Benda" .
-
-odml:ec864c56-0d3c-4de8-88fc-65e45be6fa71 a rdf:Bag ;
-    rdf:li "2012-05-25"^^xsd:date .
-
-odml:f0e517d0-c0e3-4ec9-b9b2-7fc0e7d0d634 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Sex" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#0ca52594-6cd5-4075-bb29-9074a6e678c2> .
-
-odml:f2f20cd6-75f2-4d1b-8e67-5bdd62cdf402 a odml:Property ;
-    odml:hasDtype "string" ;
-    odml:hasName "Software version" ;
-    odml:hasValue <https://g-node.org/projects/odml-rdf#9707cfc4-4c6e-4807-acb6-e6c8a316b271> .
-
-odml:f652d9fd-168e-4733-8220-4d7c6f2ee87e a odml:Section ;
-    odml:hasName "Subject-2012-05-25-ad" ;
-    odml:hasProperty <https://g-node.org/projects/odml-rdf#1f388685-63ab-411a-964f-a2ecac4f795d>,
-        <https://g-node.org/projects/odml-rdf#2c589269-a2a6-4348-b917-529dc9d143fb>,
-        odml:b0864440-6235-4b8a-ba35-cbef3a987e79,
-        odml:e98efca2-dae9-43fa-9628-66ec93c089c3,
-        odml:f0e517d0-c0e3-4ec9-b9b2-7fc0e7d0d634 ;
-    odml:hasType "Subject" .
-
-odml:f78aff8e-09ca-460f-afd9-69f6f2a004f2 a rdf:Bag ;
-    rdf:li 5e+02 .
-
-odml:f8952205-78e3-4200-ab8b-9b4d1869cc94 a rdf:Bag ;
-    rdf:li "Department Biology II" .
-
-odml:fadffec7-6b23-454e-bfd1-9d5884802abb a odml:Property ;
-    odml:hasDtype "date" ;
-    odml:hasName "Date" ;
-    odml:hasValue odml:ec864c56-0d3c-4de8-88fc-65e45be6fa71 .
-
-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> .
-

File diff suppressed because it is too large
+ 0 - 1356
code/python-odml/doc/example_rdfs/example_data/drosophila_4.ttl


File diff suppressed because it is too large
+ 0 - 1355
code/python-odml/doc/example_rdfs/example_data/drosophila_8.ttl


+ 0 - 25
code/python-odml/doc/example_rdfs/generated_rdf.xml

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<rdf:RDF
-   xmlns:ns1="http://g-node/odml#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
->
-  <rdf:Description rdf:nodeID="p1">
-    <ns1:dtype>person</ns1:dtype>
-    <ns1:hasValue>[Arthur Philip Dent,Zaphod Beeblebrox,Tricia Marie McMillan,Ford Prefect]</ns1:hasValue>
-    <ns1:description>List of crew members names</ns1:description>
-    <ns1:name>NameCrewMembers</ns1:name>
-  </rdf:Description>
-  <rdf:Description rdf:nodeID="s1">
-    <ns1:name>TheCrew</ns1:name>
-    <ns1:property rdf:nodeID="p1"/>
-    <ns1:type>crew</ns1:type>
-    <ns1:description>Information on the crew</ns1:description>
-  </rdf:Description>
-  <rdf:Description rdf:nodeID="d1">
-    <ns1:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">1979-10-12</ns1:date>
-    <ns1:docversion rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">42</ns1:docversion>
-    <ns1:author>D. N. Adams</ns1:author>
-    <ns1:version rdf:datatype="http://www.w3.org/2001/XMLSchema#double">1.1</ns1:version>
-    <ns1:hasSection rdf:nodeID="s1"/>
-  </rdf:Description>
-</rdf:RDF>

+ 0 - 33
code/python-odml/doc/example_rdfs/rdf_generator.py

@@ -1,33 +0,0 @@
-from rdflib import Graph, BNode, Literal, Namespace
-from rdflib.namespace import XSD
-
-odml = Namespace("http://g-node/odml#")
-
-g = Graph()
-
-doc = BNode("d1")
-s1 = BNode("s1")
-p12 = BNode("p1")
-
-g.add((doc, odml.version, Literal(1.1)))
-g.add((doc, odml.docversion, Literal(42)))
-g.add((doc, odml.author, Literal('D. N. Adams')))
-g.add((doc, odml.date, Literal('1979-10-12', datatype=XSD.date)))
-g.add((doc, odml.hasSection, s1))
-
-g.add((s1, odml.property, p12))
-g.add((s1, odml.type, Literal('crew')))
-g.add((s1, odml.description, Literal('Information on the crew')))
-g.add((s1, odml.name, Literal('TheCrew')))
-
-g.add((p12, odml.hasValue, Literal('[Arthur Philip Dent,Zaphod Beeblebrox,Tricia Marie McMillan,Ford Prefect]')))
-g.add((p12, odml.description, Literal('List of crew members names')))
-g.add((p12, odml.dtype, Literal('person')))
-g.add((p12, odml.name, Literal('NameCrewMembers')))
-
-res = g.serialize(format='application/rdf+xml').decode("utf-8")
-print(res)
-
-f = open("generated_ex1.xml", "w")
-f.write(res)
-f.close()

+ 0 - 86
code/python-odml/doc/example_rdfs/sparql_example_queries.py

@@ -1,86 +0,0 @@
-from rdflib import Graph, Namespace, RDF
-from rdflib.plugins.sparql import prepareQuery
-
-resource = "./python-odml/doc/example_rdfs/example_data/2010-04-16-ab_cutoff_300_contrast_20%.ttl"
-
-g = Graph()
-g.parse(resource, format='turtle')
-# select d.* from dataset d, stimulus s where s.contrast = '20%'
-q1 = prepareQuery("""SELECT *
-            WHERE {
-               ?d rdf:type odml:Document .
-               ?d odml:hasSection ?s .
-               ?s rdf:type odml:Section .
-               ?s odml:hasName "Stimulus" .
-               ?s odml:hasProperty ?p .
-               ?p odml:hasName "Contrast" .
-               ?p odml:hasValue ?v .
-               ?p odml:hasUnit "%" .
-               ?v rdf:type rdf:Bag .
-               ?v rdf:li "20.0" .
-            }""", initNs={"odml": Namespace("https://g-node.org/projects/odml-rdf#"),
-                          "rdf": RDF})
-
-g = Graph()
-g.parse(resource, format='turtle')
-# select d.* from dataset d, stimulus s, cell c where s.contrast = '20%' and c.celltype='P-unit'
-q2 = prepareQuery("""SELECT *
-                WHERE {
-                   ?d rdf:type odml:Document .
-                   ?d odml:hasSection ?s .
-                   ?s rdf:type odml:Section .
-                   ?s odml:hasName "Stimulus" .
-                   ?s odml:hasProperty ?p .
-
-                   ?p odml:hasName "Contrast" .
-                   ?p odml:hasValue ?v .
-                   ?p odml:hasUnit "%" .    
-                   ?v rdf:type rdf:Bag .
-                   ?v rdf:li "20.0" .
-
-
-                   ?d odml:hasSection ?s1 .
-                   ?s1 odml:hasName "Cell" .
-                   ?s1 odml:hasProperty ?p1 .   
-
-                   ?p1 odml:hasName "CellType" .
-                   ?p1 odml:hasValue ?v1 .   
-                   ?v1 rdf:li "P-unit" .                      
-                }""", initNs={"odml": Namespace("https://g-node.org/projects/odml-rdf#"),
-                              "rdf": RDF})
-
-# select d.* from dataset d, CellProperties s, EOD Frequency c where c.unit = 'Hz'
-g = Graph()
-g.parse(resource, format='turtle')
-q3 = prepareQuery("""SELECT *
-                WHERE {
-                   ?d rdf:type odml:Document .
-                   ?d odml:hasSection ?s .
-                   ?s rdf:type odml:CellProperties .
-                   ?s odml:hasProperty ?p .
-
-                   ?p odml:hasName "EOD Frequency" .
-                   ?p odml:hasValue ?v .
-                   ?p odml:hasUnit "Hz" .    
-                   ?v rdf:type rdf:Bag .
-                   ?v rdf:li ?value .                      
-                }""", initNs={"odml": Namespace("https://g-node.org/projects/odml-rdf#"),
-                              "rdf": RDF})
-
-print("q1")
-for row in g.query(q1):
-    print("Doc: {0}, Sec: {1}, \n"
-          "Prop: {2}, Bag: {3}".format(row.d, row.s, row.p, row.v))
-
-print("q2")
-for row in g.query(q2):
-    print("Doc: {0}, Sec: {1}, \n"
-          "Prop: {2}, Bag: {3}".format(row.d, row.s, row.p, row.v))
-    print("Doc: {0}, Sec: {1}, \n"
-          "Prop: {2}, Bag: {3}".format(row.d, row.s1, row.p1, row.v1))
-
-print("q3")
-for row in g.query(q3):
-    print("Doc: {0}, Sec: {1}, \n"
-          "Prop: {2}, Bag: {3} \n"
-          "Value: {4}".format(row.d, row.s, row.p, row.v, row.value))

+ 0 - 23
code/python-odml/doc/index.rst

@@ -1,23 +0,0 @@
-.. python-odml documentation master file, created by
-   sphinx-quickstart on Wed Mar  2 14:54:09 2011.
-   You can adapt this file completely to your liking, but it should at least
-   contain the root `toctree` directive.
-
-Welcome to python-odml's documentation!
-=======================================
-
-Contents:
-
-.. toctree::
-   :maxdepth: 2
-   
-   tutorial
-   reference
-
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-

+ 0 - 519
code/python-odml/doc/odml_ontology/root-ontology.ttl

@@ -1,519 +0,0 @@
-@prefix : <https://g-node.org/projects/odml-rdf#> .
-@prefix owl: <http://www.w3.org/2002/07/owl#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix xml: <http://www.w3.org/XML/1998/namespace> .
-@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
-@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
-@base <https://g-node.org/projects/odml-rdf> .
-
-<https://g-node.org/projects/odml-rdf> rdf:type owl:Ontology .
-
-#################################################################
-#    Datatypes
-#################################################################
-
-###  http://www.w3.org/2001/XMLSchema#date
-xsd:date rdf:type rdfs:Datatype ;
-         rdfs:label "xsd:date" .
-
-
-#################################################################
-#    Object Properties
-#################################################################
-
-###  https://g-node.org/projects/odml-rdf#hasDocument
-:hasDocument rdf:type owl:ObjectProperty ;
-             rdfs:domain :Hub ;
-             rdfs:range :Document ;
-             rdfs:label "hasDocument"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasProperty
-:hasProperty rdf:type owl:ObjectProperty ;
-             rdfs:domain :Section ;
-             rdfs:range :Property ;
-             rdfs:label "hasProperty"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasSection
-:hasSection rdf:type owl:ObjectProperty ;
-            rdfs:domain :Document ,
-                        :Section ;
-            rdfs:range :Section ;
-            rdfs:label "hasSection"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasTerminology
-:hasTerminology rdf:type owl:ObjectProperty ;
-                rdfs:domain :Document ,
-                            :Hub ,
-                            :Section ,
-                            :Terminology ;
-                rdfs:range :Terminology ;
-                rdfs:label "hasTerminology"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasValue
-:hasValue rdf:type owl:ObjectProperty ;
-          rdfs:domain :Property ;
-          rdfs:range rdf:Seq ;
-          rdfs:label "hasValue"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#isDocumentOf
-:isDocumentOf rdf:type owl:ObjectProperty ;
-              rdfs:domain :Document ;
-              rdfs:range :Hub ;
-              rdfs:label "isDocumentOf"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#isPropertyOf
-:isPropertyOf rdf:type owl:ObjectProperty ;
-              rdfs:domain :Property ;
-              rdfs:range :Section ;
-              rdfs:label "isPropertyOf"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#isSectionOf
-:isSectionOf rdf:type owl:ObjectProperty ;
-             rdfs:domain :Section ;
-             rdfs:range :Document ,
-                        :Section ;
-             rdfs:label "isSectionOf"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#isTerminologyOf
-:isTerminologyOf rdf:type owl:ObjectProperty ;
-                 rdfs:domain :Terminology ;
-                 rdfs:range :Document ,
-                            :Hub ,
-                            :Section ,
-                            :Terminology ;
-                 rdfs:label "isTerminologyOf"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#isValueOf
-:isValueOf rdf:type owl:ObjectProperty ;
-           rdfs:domain rdf:Seq ;
-           rdfs:range :Property ;
-           rdfs:label "isValueOf"^^xsd:string .
-
-
-#################################################################
-#    Data properties
-#################################################################
-
-###  https://g-node.org/projects/odml-rdf#hasAuthor
-:hasAuthor rdf:type owl:DatatypeProperty ;
-           rdfs:domain :Document ;
-           rdfs:range xsd:string ;
-           rdfs:label "hasAuthor"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasDate
-:hasDate rdf:type owl:DatatypeProperty ;
-         rdfs:domain :Document ;
-         rdfs:range xsd:date ;
-         rdfs:label "hasDate"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasDefinition
-:hasDefinition rdf:type owl:DatatypeProperty ;
-               rdfs:domain :Property ,
-                           :Section ;
-               rdfs:range xsd:string ;
-               rdfs:label "hasDefinition"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasDocVersion
-:hasDocVersion rdf:type owl:DatatypeProperty ;
-               rdfs:domain :Document ;
-               rdfs:range xsd:float ;
-               rdfs:label "hasDocVersion"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasDtype
-:hasDtype rdf:type owl:DatatypeProperty ;
-          rdfs:domain :Property ;
-          rdfs:range xsd:string ;
-          rdfs:label "hasDtype"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasExternalTerminology
-:hasExternalTerminology rdf:type owl:DatatypeProperty ;
-                        rdfs:domain :Terminology ;
-                        rdfs:range rdfs:Literal ;
-                        rdfs:label "hasExternalTerminology"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasId
-:hasId rdf:type owl:DatatypeProperty ,
-                owl:FunctionalProperty ;
-       rdfs:domain :Document ,
-                   :Property ,
-                   :Section ;
-       rdfs:range rdfs:Literal ;
-       rdfs:label "hasId"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasName
-:hasName rdf:type owl:DatatypeProperty ;
-         rdfs:domain :Property ,
-                     :Section ;
-         rdfs:range xsd:string ;
-         rdfs:label "hasName"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasReference
-:hasReference rdf:type owl:DatatypeProperty ;
-              rdfs:domain :Property ,
-                          :Section ;
-              rdfs:range rdfs:Literal ;
-              rdfs:label "hasReference"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasType
-:hasType rdf:type owl:DatatypeProperty ;
-         rdfs:domain :Section ;
-         rdfs:range xsd:string ;
-         rdfs:label "hasType"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasUncertainty
-:hasUncertainty rdf:type owl:DatatypeProperty ;
-                rdfs:domain :Property ;
-                rdfs:range xsd:float ;
-                rdfs:label "hasUncertainty"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasUnit
-:hasUnit rdf:type owl:DatatypeProperty ;
-         rdfs:domain :Property ;
-         rdfs:range xsd:string ;
-         rdfs:label "hasUnit"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#hasValueOrigin
-:hasValueOrigin rdf:type owl:DatatypeProperty ;
-                rdfs:domain :Property ;
-                rdfs:range xsd:string ;
-                rdfs:label "hasValueOrigin" .
-
-
-###  https://g-node.org/projects/odml-rdf#hasVersion
-:hasVersion rdf:type owl:DatatypeProperty ;
-            rdfs:domain :Document ;
-            rdfs:range xsd:float ;
-            rdfs:label "hasVersion"^^xsd:string .
-
-
-#################################################################
-#    Classes
-#################################################################
-
-###  http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq
-rdf:Seq rdf:type owl:Class ;
-        rdfs:subClassOf [ rdf:type owl:Restriction ;
-                          owl:onProperty :isValueOf ;
-                          owl:someValuesFrom :Property
-                        ] ;
-        rdfs:comment "The class of ordered containers." ;
-        rdfs:isDefinedBy rdf: ;
-        rdfs:label "Seq" .
-
-
-###  https://g-node.org/projects/odml-rdf#Cell
-:Cell 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> .
-
-
-###  https://g-node.org/projects/odml-rdf#CellProperties
-:CellProperties rdf:type owl:Class ;
-                rdfs:subClassOf :Section ;
-                rdfs:comment "Description"^^xsd:string ;
-                rdfs:label "CellProperties" .
-
-
-###  https://g-node.org/projects/odml-rdf#DataAcquisition
-:DataAcquisition 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> .
-
-
-###  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> .
-
-
-###  https://g-node.org/projects/odml-rdf#Document
-:Document rdf:type owl:Class ;
-          rdfs:subClassOf owl:Thing ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasSection ;
-                            owl:someValuesFrom :Section
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasTerminology ;
-                            owl:someValuesFrom :Terminology
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :isDocumentOf ;
-                            owl:someValuesFrom :Hub
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasAuthor ;
-                            owl:someValuesFrom rdfs:Literal
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasDate ;
-                            owl:someValuesFrom xsd:date
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasDocVersion ;
-                            owl:someValuesFrom xsd:float
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasId ;
-                            owl:someValuesFrom rdfs:Literal
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasVersion ;
-                            owl:someValuesFrom xsd:float
-                          ] ;
-          rdfs:comment "Doc description"^^xsd:string ;
-          rdfs:label "Document" ;
-          rdfs:seeAlso "Link to the doc description of site"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#Electrode
-:Electrode 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> .
-
-
-###  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> .
-
-
-###  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> .
-
-
-###  https://g-node.org/projects/odml-rdf#Hub
-:Hub rdf:type owl:Class ;
-     rdfs:subClassOf owl:Thing ,
-                     [ rdf:type owl:Restriction ;
-                       owl:onProperty :hasDocument ;
-                       owl:someValuesFrom :Document
-                     ] ,
-                     [ rdf:type owl:Restriction ;
-                       owl:onProperty :hasTerminology ;
-                       owl:someValuesFrom :Terminology
-                     ] ;
-     rdfs:comment "Description of the hub class"^^xsd:string ;
-     rdfs:label "Hub" ;
-     rdfs:seeAlso "Link to the Hub remote description"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#Preparation
-:Preparation 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> .
-
-
-###  https://g-node.org/projects/odml-rdf#Property
-:Property rdf:type owl:Class ;
-          rdfs:subClassOf owl:Thing ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasValue ;
-                            owl:someValuesFrom rdf:Seq
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :isPropertyOf ;
-                            owl:someValuesFrom :Section
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasDefinition ;
-                            owl:someValuesFrom rdfs:Literal
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasDtype ;
-                            owl:someValuesFrom rdfs:Literal
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasId ;
-                            owl:someValuesFrom rdfs:Literal
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasName ;
-                            owl:someValuesFrom rdfs:Literal
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasReference ;
-                            owl:someValuesFrom rdfs:Literal
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasUncertainty ;
-                            owl:someValuesFrom xsd:float
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasUnit ;
-                            owl:someValuesFrom rdfs:Literal
-                          ] ,
-                          [ rdf:type owl:Restriction ;
-                            owl:onProperty :hasValueOrigin ;
-                            owl:someValuesFrom rdfs:Literal
-                          ] ;
-          rdfs:comment "Description of a Property entity"^^xsd:string ;
-          rdfs:label "Property" ;
-          rdfs:seeAlso "Link to the description on the site"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#Recording
-:Recording 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> .
-
-
-###  https://g-node.org/projects/odml-rdf#Section
-:Section rdf:type owl:Class ;
-         rdfs:subClassOf owl:Thing ,
-                         [ rdf:type owl:Restriction ;
-                           owl:onProperty :hasProperty ;
-                           owl:someValuesFrom :Property
-                         ] ,
-                         [ rdf:type owl:Restriction ;
-                           owl:onProperty :hasSection ;
-                           owl:someValuesFrom :Section
-                         ] ,
-                         [ rdf:type owl:Restriction ;
-                           owl:onProperty :hasTerminology ;
-                           owl:someValuesFrom :Terminology
-                         ] ,
-                         [ rdf:type owl:Restriction ;
-                           owl:onProperty :isSectionOf ;
-                           owl:someValuesFrom :Document
-                         ] ,
-                         [ rdf:type owl:Restriction ;
-                           owl:onProperty :isSectionOf ;
-                           owl:someValuesFrom :Section
-                         ] ,
-                         [ rdf:type owl:Restriction ;
-                           owl:onProperty :hasDefinition ;
-                           owl:someValuesFrom rdfs:Literal
-                         ] ,
-                         [ rdf:type owl:Restriction ;
-                           owl:onProperty :hasId ;
-                           owl:someValuesFrom rdfs:Literal
-                         ] ,
-                         [ rdf:type owl:Restriction ;
-                           owl:onProperty :hasName ;
-                           owl:someValuesFrom rdfs:Literal
-                         ] ,
-                         [ rdf:type owl:Restriction ;
-                           owl:onProperty :hasReference ;
-                           owl:someValuesFrom rdfs:Literal
-                         ] ,
-                         [ rdf:type owl:Restriction ;
-                           owl:onProperty :hasType ;
-                           owl:someValuesFrom rdfs:Literal
-                         ] ;
-         rdfs:comment "Comment about section"^^xsd:string ;
-         rdfs:label "Section" ;
-         rdfs:seeAlso "Link to the doc description of site"^^xsd:string .
-
-
-###  https://g-node.org/projects/odml-rdf#Settings
-:Settings rdf:type owl:Class ;
-          rdfs:subClassOf :Section ;
-          rdfs:comment "Description"^^xsd:string ;
-          rdfs:label "Settings" .
-
-
-###  https://g-node.org/projects/odml-rdf#Setup
-:Setup 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> .
-
-
-###  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> .
-
-
-###  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> .
-
-
-###  https://g-node.org/projects/odml-rdf#Terminology
-:Terminology rdf:type owl:Class ;
-             rdfs:subClassOf owl:Thing ,
-                             [ rdf:type owl:Restriction ;
-                               owl:onProperty :hasSection ;
-                               owl:someValuesFrom :Section
-                             ] ,
-                             [ rdf:type owl:Restriction ;
-                               owl:onProperty :hasTerminology ;
-                               owl:someValuesFrom :Terminology
-                             ] ,
-                             [ rdf:type owl:Restriction ;
-                               owl:onProperty :isTerminologyOf ;
-                               owl:someValuesFrom :Document
-                             ] ,
-                             [ rdf:type owl:Restriction ;
-                               owl:onProperty :isTerminologyOf ;
-                               owl:someValuesFrom :Hub
-                             ] ,
-                             [ rdf:type owl:Restriction ;
-                               owl:onProperty :isTerminologyOf ;
-                               owl:someValuesFrom :Section
-                             ] ,
-                             [ rdf:type owl:Restriction ;
-                               owl:onProperty :isTerminologyOf ;
-                               owl:someValuesFrom :Terminology
-                             ] ,
-                             [ rdf:type owl:Restriction ;
-                               owl:onProperty :hasExternalTerminology ;
-                               owl:someValuesFrom rdfs:Literal
-                             ] ,
-                             [ rdf:type owl:Restriction ;
-                               owl:onProperty :hasId ;
-                               owl:someValuesFrom rdfs:Literal
-                             ] ;
-             rdfs:comment "Description of a Terminology"^^xsd:string ;
-             rdfs:label "Terminology" ;
-             rdfs:seeAlso "Link to the remote description"^^xsd:string .
-
-
-###  Generated by the OWL API (version 4.3.1) https://github.com/owlcs/owlapi

+ 0 - 9
code/python-odml/doc/reference.rst

@@ -1,9 +0,0 @@
-===============
-Class-Reference
-===============
-
-.. toctree::
-   :maxdepth: 2
-
-   base-classes
-   tools

+ 0 - 54
code/python-odml/doc/section_subclasses.yaml

@@ -1,54 +0,0 @@
-analysis: Analysis
-analysis/psth: PSTH
-analysis/power_spectrum: PowerSpectrum
-cell: Cell
-dataset: Dataset
-blackrock: Blackrock
-electrode: Electrode
-event: Event
-event_list: EventList
-experiment: Experiment
-experiment/behavior: Behavior
-experiment/electrophysiology: Electrophysiology
-experiment/imaging: Imaging
-experiment/pschophysics: Psychophysics
-hardware_properties: HardwareProperties
-hardware_settings: HardwareSettings
-hardware: Hardware
-hardware/amplifier: Amplifier
-hardware/attenuator: Attenuator
-hardware/camera_objective: CameraObjective
-hardware/daq: DataAcquisition
-hardware/eyetracker: Eyetracker
-hardware/filter: Filter
-hardware/filter_set: Filterset
-hardware/iaq: ImageAcquisition
-hardware/light_source: Lightsource
-hardware/microscope: Microscope
-hardware/microscope_objective: MicroscopeObjective
-hardware/scanner: Scanner
-hardware/stimulus_isolator: StimulusIsolator
-model/lif: Leaky integrate and fire
-model/pif: perfect integrate and fire
-model/multi_compartment: Multi compartment model
-model/single_compartment: One compartment model
-person: Person
-preparation: Preparation
-project: Project
-protocol: protocol
-recording: Recording
-setup: Setup
-stimulus: Stimulus
-stimulus/dc: DC
-stimulus/gabor: Gabor
-stimulus/grating: Grating
-stimulus/pulse: Pulse
-stimulus/movie: Movie
-stimulus/ramp: Ramp
-stimulus/random_dot: RandomDot
-stimulus/sawtooth: Sawtooth
-stimulus/sine_wave: Sinewave
-stimulus/square_wave: Squarewave
-stimulus/white_noise: Whitenoise
-subject: Subject
-carmen_mini: CarmenMini

+ 0 - 57
code/python-odml/doc/tools.rst

@@ -1,57 +0,0 @@
-.. _datatypes:
-
-Data Types
-==========
-
-.. automodule:: odml.dtypes
-   :members:
-   :inherited-members:
-   :undoc-members:
-
-.. _tools:
-
-Tools
-=====
-Several tools are provided with the :py:mod:`odml.tools` package.
-
-ODMLParser
-----------
-.. automodule:: odml.tools.odmlparser
-   :members:
-   :inherited-members:
-   :undoc-members:
-
-XMLParser
----------
-.. automodule:: odml.tools.xmlparser
-   :members:
-   :inherited-members:
-   :undoc-members:
-
-DictParser
-----------
-.. automodule:: odml.tools.dict_parser
-   :members:
-   :inherited-members:
-   :undoc-members:
-
-FormatConverter
-----------------
-.. automodule:: odml.tools.format_converter
-   :members:
-   :inherited-members:
-   :undoc-members:
-
-VersionConverter
-----------------
-.. automodule:: odml.tools.version_converter
-   :members:
-   :inherited-members:
-   :undoc-members:
-
-RDFConverter
-----------------
-.. automodule:: odml.tools.rdf_converter
-   :members:
-   :inherited-members:
-   :undoc-members:

+ 0 - 963
code/python-odml/doc/tutorial.rst

@@ -1,963 +0,0 @@
-
-=============
-odML Tutorial
-=============
-
-:Author:
-    Lyuba Zehl;
-    based on work by Hagen Fritsch
-:Release:
-    1.4
-:License:
-    Creative Commons Attribution-ShareAlike 4.0 International
-    `License <http://creativecommons.org/licenses/by-sa/4.0/>`_
-
--------------------------------------------------------------------------------
-
-odML (open metadata Markup Language)
-====================================
-
-odML (open metadata Markup Language) is a framework, proposed by `Grewe et al.
-(2011) <http://journal.frontiersin.org/article/10.3389/fninf.2011.00016/full>`_,
-to organize and store experimental metadata in a human- and machine-readable,
-XML based format (odml). In this tutorial we will illustrate the conceptual
-design of the odML framework and show hands-on how you can generate your own
-odML metadata file collection. A well organized metadata management of your
-experiment is a key component to guarantee the reproducibility of your research
-and facilitate the provenance tracking of your analysis projects.
-
-What are metadata and why are they needed?
-    Metadata are data about data. They describe the conditions under which the
-    actual raw-data of an experimental study were acquired. The organization of
-    such metadata and their accessibility may sound like a trivial task, and
-    most laboratories developed their home-made solutions to keep track of
-    their metadata. Most of these solutions, however, break down if data and
-    metadata need to be shared within a collaboration, because implicit
-    knowledge of what is important and how it is organized is often
-    underestimated.
-
-    While maintaining the relation to the actual raw-data, odML can help to
-    collect all metadata which are usually distributed over several files and
-    formats, and to store them unitedly which facilitates sharing data and
-    metadata.
-
-Key features of odML
-    - open, XML based language, to collect, store and share metadata
-    - Machine- and human-readable
-    - Python-odML library
-    - Interactive odML-Editor
-
--------------------------------------------------------------------------------
-
-Structure of this tutorial
-==========================
-
-The scientific background of the possible user community of odML varies
-enormously (e.g. physics, informatics, mathematics, biology, medicine,
-psychology). Some users will be trained programmers, others probably have never
-learned a programming language.
-
-To cover the different demands of all users, we provide a slow introduction to
-the odML framework that even allows programming beginners to learn the basic
-concepts. We will demonstrate how to generate an odML file and present more
-advanced possibilities of the Python-odML library (e.g., how to search for
-certain metadata or how to integrate existing terminologies).
-
-At the end of this tutorial we will provide a few guidelines that will help you
-to create an odML file structure that is optimised for your individual
-experimental project and complements the special needs of your laboratory.
-
-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>`_.
-
--------------------------------------------------------------------------------
-
-Download and Installation
-=========================
-
-The odML framework is an open source project of the German Neuroinformatics
-Node (`G-Node <http://www.g-node.org/>`_, `odML project website
-<http://www.g-node.org/projects/odml>`_) of the International Neuroinformatics
-Coordination Facility (`INCF <http://www.g-node.org/>`_). The source code for
-the Python-odML library is available on `GitHub <https://github.com/>`_ under
-the project name `python-odml <https://github.com/G-Node/python-odml>`_.
-
-Dependencies
-------------
-
-The Python-odML library (version 1.4) runs under Python 2.7 or 3.5.
-
-Additionally, the Python-odML library depends on Enum, lxml, pyyaml and rdflib.
-
-When the odML-Python library is installed via pip or the setup.py, these
-packages will be automatically downloaded and installed. Alternatively, they
-can be installed from the OS package manager.
-
-On Ubuntu, the dependency packages are available as ``python-enum`` and
-``python-lxml``.
-
-Note that on Ubuntu 14.04, the latter package additionally requires the
-installation of ``libxml2-dev``, ``libxslt1-dev``, and ``lib32z1-dev``.
-
-
-Installation...
----------------
-
-... via pip:
-************
-
-The simplest way to install the Python-odML library is from `PyPI
-<https://pypi.python.org/>`_ using `pip <https://pip.pypa.io/en/stable/>`_::
-
-    $ pip install odml
-
-The appropriate Python dependencies will be automatically
-downloaded and installed.
-
-If you are not familiar with PyPI and pip, please have a look at the available
-online documentation.
-
-Installation
-------------
-
-To download the Python-odML library please either use git and clone the
-repository from GitHub::
-
-    $ cd /home/usr/toolbox/
-    $ git clone https://github.com/G-Node/python-odml.git
-
-... or if you don't want to use git, download the ZIP file also provided on
-GitHub to your computer (e.g. as above on your home directory under a "toolbox"
-folder).
-
-To install the Python-odML library, enter the corresponding directory and run::
-
-    $ cd /home/usr/toolbox/python-odml/
-    $ python setup.py install
-
-
-Bugs & Questions
-----------------
-
-Should you find a behaviour that is likely a bug, please file a bug report at
-`the github bug tracker <https://github.com/G-Node/python-odml/issues>`_.
-
-If you have questions regarding the use of the library or the editor, ask
-the question on `Stack Overflow <http://stackoverflow.com/>`_, be sure to tag
-it with `odml` and we'll do our best to quickly solve the problem.
-
--------------------------------------------------------------------------------
-
-Basic knowledge on odML
-=======================
-
-Before we start, it is important to know the basic structure of an odML
-file. Within an odML file metadata are grouped and stored in a
-hierarchical tree structure which consists of three basic odML
-objects.
-
-Document:
-    - description: *root of the tree*
-    - parent: *no parent*
-    - children: *Section*
-
-Section:
-    - description: *branches of the tree*
-    - parent: *Document or Section*
-    - children: *Section and/or Property*
-
-Property:
-    - description: *leafs of the tree (contains metadata values)*
-    - parent: *Section*
-    - children: *none*
-
-
-Each of these odML objects has a certain set of attributes where the
-user can describe the object and its contents. Which attribute belongs
-to which object and what the attributes are used for, is better explained
-in an example odML file (e.g., "THGTTG.odml").
-
-
-A first look
-============
-
-If you want to get familiar with the concept behind the odML framework and how
-to handle odML files in Python, you can have a first look at the example odML
-file provided in the Python-odML library. For this you first need to run the
-python code ("thgttg.py") to generate the example odML file ("THGTTG.odml").
-When using the following commands, make sure you adapt the paths to the
-python-odml module to your owns!::
-
-    $ cd /home/usr/.../python-odml
-    $ ls doc/example_odMLs
-    thgttg.py
-    $ python doc/example_odMLs/example_odMLs.py "/home/usr/.../python-odml"
-    $ ls doc/example_odMLs
-    THGTTG.odml  thgttg.py
-
-Now open a Python shell within the Python-odML library directory, e.g. with
-IPython::
-
-    $ ipython
-
-In the IPython shell, first import the odml package::
-
-    >>> import odml
-
-Second, load the example odML file with the following command lines::
-
-    >>> to_load = './doc/example_odMLs/THGTTG.odml'
-    >>> odmlEX = odml.load(to_load)
-
-If you open a Python shell outside of the Python-odML library directory, please
-adapt your Python-Path and the path to the "THGTTG.odml" file accordingly.
-
-How you can access the different odML objects and their attributes once you
-loaded an odML file and how you can make use of the attributes is described in
-more detail in the following chapters for each odML object type (Document,
-Section, Property).
-
-How you can create the different odML objects on your own and how to connect
-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
-be found later on in this tutorial.
-
-But now, let us first have a look at the example odML file (THGTTG.odml)!
-
-
-The Document
-------------
-
-If you loaded the example odML file, let's have a first look at the Document::
-
-    >>> print odmlEX
-    Document 42 {author = D. N. Adams, 2 sections}
-
-As you can see, the printout gives you a short summary of the Document of the
-loaded example odML file.
-
-The print out gives you already the follwing information about the odML file:
-
-- ``Document`` tells you that you are looking at an odML Document
-- ``42`` is the user defined version of this odML file
-- ``{...}`` provides ``author`` and number of attached sections
-- ``author`` states the author of the odML file, "D. N. Adams" in the example case
-- ``2 sections`` tells you that this odML Document has 2 Section directly
-  appended
-
-Note that the Document printout tells you nothing about the depth of the
-complete tree structure, because it is not displaying the children of its
-directly attached Sections. It also does not display all Document attributes.
-In total, a Document has the following 4 attributes:
-
-author
-    - Returns the author (returned as string) of this odML file.
-
-date
-    - Returns ta user defined date. Could for example be used to state
-      the date of first creation or the date of last changes.
-
-document
-    - Returns the current Document object.
-
-parent
-    - Returns the parent object (which is ``None`` for a Document).
-
-repository
-    - Returns the URL (returned as string) to a user defined repository of
-      terminologies used in this Document. Could be the URL to the G-Node
-      terminologies or to a user defined template.
-
-version
-    - Returns the user defined version (returned as string) of this odML file.
-
-id
-    - id is a UUID (universally unique identifiers) that uniquely identifies
-      the current document. If not otherwise specified, this id is automatically
-      created and assigned.
-
-Let's check out all attributes with the following commands::
-
-    >>> print(odmlEX.author)
-    D. N. Adams
-    >>> print(odmlEX.date)
-    1979-10-12
-    >>> print(odmlEX.document)
-    Document 42 {author = D. N. Adams, 2 sections}
-    >>> print(odmlEX.parent)
-    None
-    >>> print(odmlEX.repository)
-    http://portal.g-node.org/odml/terminologies/v1.1/terminologies.xml
-    >>> print(odmlEX.version)
-    42
-
-As expected for a Document, the attributes author and version match the
-information given in the Document printout, the document attribute just returns
-the Document, and the parent attribute is ``None``.
-
-As you learned in the beginning, Sections can be attached to a Document. They
-represent the next hierarchy level of an odML file. Let's have a look which
-Sections were attached to the Document of our example odML file using the
-following command::
-
-    >>> print(odmlEX.sections)
-    [Section[4|2] {name = TheCrew, type = crew, id = ...},
-     Section[1|7] {name = TheStarship, type = starship, id = ...}]
-
-As expected from the Document printout our example contains two Sections. The
-printout and attributes of a Section are explained in the next chapter.
-
-
-The Sections
-------------
-
-There are several ways to access Sections. You can either call them by name or
-by index using either explicitly the function that returns the list of
-Sections (see last part of `The Document`_ chapter) or using again a short cut
-notation. Let's test all the different ways to access a Section, by having a
-look at the first Section in the sections list attached to the Document in our
-example odML file::
-
-    >>> print(odmlEX.sections['TheCrew'])
-    Section[4|2] {name = TheCrew, type = crew, id = ...}
-    >>> print(odmlEX.sections[0])
-    Section[4|2] {name = TheCrew, type = crew, id = ...}
-    >>> print(odmlEX['TheCrew'])
-    Section[4|2] {name = TheCrew, type = crew, id = ...}
-    >>> print(odmlEX[0])
-    Section[4|2] {name = TheCrew, type = crew, id = ...}
-
-In the following we will call Sections explicitly by their name using the
-short cut notation.
-
-The printout of a Section is similar to the Document printout and gives you
-already the following information:
-
-- ``Section`` tells you that you are looking at an odML Section
-- ``[4|2]`` states that this Section has four Sections and two Properties directly attached to it
-- ``{...}`` provides ``name``, ``type`` and ``id`` of the Section
-- ``name`` is the name of this Section, 'TheCrew' in the example case
-- ``type`` provides the type of the Section, 'crew' in the example case
-- ``id`` provides the uuid of the Section, the actual value has been omitted in the example to improve readability.
-
-
-Note that the Section printout tells you nothing about the depth of a possible
-sub-Section tree below the directly attached ones. It also only list the type
-of the Section as one of the Section attributes. In total, a Section can be
-defined by the following 5 attributes:
-
-name
-    - Returns the name of this Section. Should indicate what kind of
-      information can be found in this Section.
-
-definition
-    - Returns the definition of the content within this Section. Should
-      describe what kind of information can be found in this Section.
-
-document
-    - Returns the Document to which this Section belongs to. Note that this
-      attribute is set automatically for a Section and all its children when
-      it is attached to a Document.
-
-parent
-    - Returns the parent to which this Section was directly attached to. Can be
-      either a Document or another Section.
-
-type
-    - Returns the classification type which allows to connect related Sections
-      due to a superior semantic context.
-
-reference
-    - Returns a reference that can be used to state the origin or source file
-      of the metadata stored in the Properties that are grouped by this
-      Section.
-
-repository
-    - Returns the URL (returned as string) to a user defined repository of
-      terminologies used in this Document. Could be the URL to the G-Node
-      terminologies or to a user defined template.
-
-id
-    - id is a UUID (universally unique identifiers) that uniquely identifies
-      the current section. If not otherwise specified, this id is automatically
-      created and assigned.
-
-Let's have a look at the attributes for the Section 'TheCrew'::
-
-    >>> print(odmlEX['TheCrew'].name)
-    TheCrew
-    >>> print(odmlEX['TheCrew'].definition)
-    Information on the crew
-    >>> print(odmlEX['TheCrew'].document)
-    Document 42 {author = D. N. Adams, 2 sections}
-    >>> print(odmlEX['TheCrew'].parent)
-    Document 42 {author = D. N. Adams, 2 sections}
-    >>> print(odmlEX['TheCrew'].type)
-    crew
-    >>> print(odmlEX['TheCrew'].reference)
-    None
-    >>> print(odmlEX['TheCrew'].repository)
-    None
-    >>> print(odmlEX['TheCrew'].id)
-    None
-
-As expected for this Section, the name and type attribute match the information
-given in the Section printout, and the document and parent attribute return the
-same object, namely our example Document.
-
-To see which Sections are directly attached to the Section 'TheCrew' again use
-the following command::
-
-    >>> print(odmlEX['TheCrew'].sections)
-    [Section[0|5] {name = Arthur Philip Dent, type = crew/person, id = ...},
-     Section[0|5] {name = Zaphod Beeblebrox, type = crew/person, id = ...},
-     Section[0|5] {name = Tricia Marie McMillan, type = crew/person, id = ...},
-     Section[0|5] {name = Ford Prefect, type = crew/person, id = ...}]
-
-Or, for accessing these sub-Sections::
-
-    >>> print(odmlEX['TheCrew'].sections['Ford Prefect'])
-    Section[0|5] {name = Ford Prefect, type = crew/person, id = ...}
-    >>> print(odmlEX['TheCrew'].sections[3])
-    Section[0|5] {name = Ford Prefect, type = crew/person, id = ...}
-    >>> print(odmlEX['TheCrew']['Ford Prefect'])
-    Section[0|5] {name = Ford Prefect, type = crew/person, id = ...}
-    >>> print(odmlEX['TheCrew'][3])
-    Section[0|5] {name = Ford Prefect, type = crew/person, id = ...}
-
-As you learned, besides sub-Sections, a Section can also have Properties
-attached. Let's see which Properties are attached to the Section 'TheCrew'::
-
-    >>> print(odmlEX['TheCrew'].properties)
-    [Property: {name = NameCrewMembers},
-     Property: {name = NoCrewMembers}]
-
-The printout and attributes of a Property are explained in the next chapter.
-
-
-The Properties
---------------
-
-Properties need to be called explicitly via the properties function of a
-Section. You can then either call a Property by name or by index::
-
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'])
-    Property: {name = NoCrewMembers}
-    >>> print(odmlEX['TheCrew'].properties[1])
-    Property: {name = NoCrewMembers}
-
-In the following we will only call Properties explicitly by their name.
-
-The Property printout is reduced and only gives you information about the
-following:
-
-- ``Property`` tells you that you are looking at an odML Property
-- ``{...}`` provides the ``name`` of the Property
-- ``NoCrewMembers`` is the name of this Property
-
-Note that the Property printout tells you nothing about the number of Values,
-and very little about the Property attributes. In total, a Property can be
-defined by the following 9 attributes:
-
-name
-    - Returns the name of the Property. Should indicate what kind of metadata
-      are stored in this Property.
-
-definition
-    - Returns the definition of this Property. Should describe what kind of
-      metadata are stored in this Property.
-
-document
-    - Returns the Document to which the parent Section of this Property belongs
-      to. Note that this attribute is set automatically for a Section and all
-      its children when it is attached to a Document.
-
-parent
-    - Returns the parent Section to which this Property was attached to.
-
-values
-    - Returns the metadata of this Property. Can be either a single metadata or
-      multiple, but homogeneous metadata (all with same dtype and unit). For
-      this reason, the output is always provided as a list.
-
-dtype
-    - Returns the odml data type of the stored metadata.
-
-unit
-    - Returns the unit of the stored metadata.
-
-uncertainty
-    - recommended
-    - Can be used to specify the uncertainty of the given metadata value.
-
-reference
-    - Returns a reference that can be used to state an external definition
-      of the metadata value.
-
-dependency
-    - optional
-    - A name of another Property within the same section, which this property
-      depends on.
-
-dependency_value
-    - optional
-    - Value of the other Property specified in the 'dependency' attribute on
-      which this Property depends on.
-
-value_origin
-    - A reference to state the origin of the metadata value e.g. a file name.
-
-Let's check which attributes were defined for the Property 'NoCrewMembers'::
-
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'].name)
-    NoCrewMembers
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'].definition)
-    Number of crew members
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'].document)
-    Document 42 {author = D. N. Adams, 2 sections}
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'].values)
-    [4]
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'].dtype)
-    int
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'].unit)
-    None
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'].uncertainty)
-    1
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'].reference)
-    The Hitchhiker's guide to the Galaxy (novel)
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'].dependency)
-    None
-    >>> print(odmlEX['TheCrew'].properties['NoCrewMembers'].dependency_value)
-    None
-
-As mentioned the values attribute of a Property can only contain multiple
-metadata when they have the same ``dtype`` and ``unit``, as it is the case for
-the Property 'NameCrewMembers'::
-
-    >>> print(odmlEX['TheCrew'].properties['NameCrewMembers'].values)
-    ['Arthur Philip Dent',
-     'Zaphod Beeblebrox',
-     'Tricia Marie McMillan',
-     'Ford Prefect']
-    >>> print(odmlEX['TheCrew'].properties['NameCrewMembers'].dtype)
-    person
-    >>> print(odmlEX['TheCrew'].properties['NameCrewMembers'].unit)
-    None
-
-NOTE: 'property.values' will always return a copy! Any direct changes to the
-returned list will have no affect on the actual property values. If you want to
-make changes to a property value, either use the 'append', 'extend' and 'remove'
-methods or assign a new value list to the property.
-
-
--------------------------------------------------------------------------------
-
-Generating an odML-file
-=======================
-
-After getting familiar with the different odML objects and their attributes, 
-you will now learn how to generate your own odML file by reproducing some parts 
-of the example THGTTG.odml.
-
-We will show you first how to create the different odML objects with their 
-attributes. Please note that some attributes are obligatory, some are 
-recommended and others are optional when creating the corresponding odML 
-objects. A few are automatically generated in the process of creating an odML 
-file. Furthermore, all attributes of an odml object can be edited at any time.
-
-If you opened a new IPython shell, please import first again the odml package::
-
-    >>> import odml
-
-
-Create a document
------------------
-
-Let's start by creating the Document. Note that none of the Document attributes
-are obligatory::
- 
-    >>> MYodML = odml.Document()
-
-You can check if your new Document contains actually what you created by using
-some of the commands you learned before::
-
-    >>> MYodML
-    >>> Document None {author = None, 0 sections}
-
-As you can see, we created an "empty" Document where the version and the author
-attributes are not defined and no section is yet attached. You will learn how to create
-and add a Section to a Document in the next chapter. Let's focus here on defining
-the Document attributes::
-
-    >>> MYodML.author = 'D. N. Adams'
-    >>> MYodML.version = 42
-
-For the date attribute you require a datetime object as entry. For this reason, 
-you need to first import the Python package datetime::
-
-    >>> import datetime as dt
-
-Now, let's define the date attribute of the Document::
-
-    >>> MYodML.date = dt.date(1979, 10, 12)
-
-Next, let us also add a repository attribute. Exemplary, we can import the 
-Python package os to extract the absolute path to our previously used example
-odML file and add this as repository::
-
-    >>> import os
-    >>> url2odmlEX = 'file:///' + os.path.abspath(to_load)
-    >>> MYodML.repository = url2odmlEX
-
-The document and parent attribute are automatically set and should not be 
-fiddled with.
-
-Check if your new Document contains actually all attributes now::
-
-    >>> print(MYodML.author)
-    D. N. Adams
-    >>> print(MYodML.date)
-    1979-10-12
-    >>> print(MYodML.document)
-    Document 42 {author = D. N. Adams, 0 sections}
-    >>> print(MYodML.parent)
-    None
-    >>> print(MYodML.repository)
-    file:///home/usr/.../python-odml/doc/example_odMLs/THGTTG.odml
-    >>> print(MYodML.version)
-    42
-
-Note that you can also define all attributes when first creating a Document::
-
-    >>> MYodML = odml.Document(author='D. N. Adams',
-                               version=42,
-                               date=dt.date(1979, 10, 12),
-                               repository=url2odmlEX)
-
-Our new created Document is, though, still "empty", because it does not contain 
-yet Sections. Let's change this!
-
-
-Create a section
-----------------
-
-We now create a Section by reproducing the Section "TheCrew" of the example 
-odml file from the beginning::
-
-    >>> sec1 = odml.Section(name="TheCrew",
-                           definition="Information on the crew",
-                           type="crew")
-
-Note that only the attribute name is obligatory. The attributes definition and 
-type are recommended, but could be either not defined at all or defined later 
-on.
-
-Let us now attach this Section to our previously generated Document. With this,
-the attribute document and parent of our new Section are automatically 
-updated::
-
-    >>> MYodML.append(sec1)
-
-    >>> print(MYodML)
-    Document 42 {author = D. N. Adams, 1 sections}
-    >>> print(MYodML.sections)
-    [Section[0|0] {name = TheCrew, type = crew, id = ...}]
-
-    >>> print(sec1.document)
-    Document 42 {author = D. N. Adams, 1 sections}
-    >>> print(sec1.parent)
-    Document 42 {author = D. N. Adams, 1 sections}
-
-It is also possible to connect a Section directly to a parent object.
-Let's try this with the next Section we create::
-
-    >>> sec2 = odml.Section(name="Arthur Philip Dent",
-                            definition="Information on Arthur Dent",
-                            type="crew/person",
-                            parent=sec1)
-
-    >>> print(sec2)
-    Section[0|0] {name = Arthur Philip Dent, type = crew/person, id = ...}
-
-    >>> print(sec2.document)
-    Document 42 {author = D. N. Adams, 1 sections}
-    >>> print(sec2.parent)
-    [Section[1|0] {name = TheCrew, type = crew, id = ...}
-
-Note that all of our created Sections do not contain any Properties yet. Let's 
-see if we can change this...
-
-
-Create a Property:
-------------------
-
-Let's create our first Property::
-
-    >>> prop1 = odml.Property(name="Gender",
-                              definition="Sex of the subject",
-                              values="male")
-
-Note that again, only the name attribute is obligatory for creating a Property.
-The remaining attributes can be defined later on, or are automatically 
-generated in the process.
-
-If a value is defined, but the dtype is not, as it is the case for our example
-above, the dtype is deduced automatically::
-
-    >>> print(prop1.dtype)
-    string
-
-Generally, you can use the following odML data types to describe the format of 
-the stored metadata:
-
-+-----------------------------------+---------------------------------------+
-| dtype                             | required data examples                |
-+===================================+=======================================+
-| odml.DType.int or 'int'           | 42                                    |
-+-----------------------------------+---------------------------------------+
-| odml.DType.float or 'float'       | 42.0                                  |
-+-----------------------------------+---------------------------------------+
-| odml.DType.boolean or 'boolean'   | True or False                         |
-+-----------------------------------+---------------------------------------+
-| odml.DType.string or 'string'     | 'Earth'                               |
-+-----------------------------------+---------------------------------------+
-| odml.DType.date or 'date'         | dt.date(1979, 10, 12)                 |
-+-----------------------------------+---------------------------------------+
-| odml.DType.datetime or 'datetime' | dt.datetime(1979, 10, 12, 11, 11, 11) |
-+-----------------------------------+---------------------------------------+
-| odml.DType.time or 'time'         | dt.time(11, 11, 11)                   |
-+-----------------------------------+---------------------------------------+
-| odml.DType.person or 'person'     | 'Zaphod Beeblebrox'                   |
-+-----------------------------------+---------------------------------------+
-| odml.DType.text or 'text'         | 'any text containing \n linebreaks'   |
-+-----------------------------------+---------------------------------------+
-| odml.DType.url or 'url'           | "https://en.wikipedia.org/wiki/Earth" |
-+-----------------------------------+---------------------------------------+
-| odml.DType.tuple                  | "(39.12; 67.19)"                      |
-+-----------------------------------+---------------------------------------+
-
-The available types are implemented in the 'odml.dtypes' Module. Note that the
-last four data types, if not defined, cannot be deduced, but are instead
-always interpreted as string.
-
-If we append now our new Property to the previously created sub-Section 
-'Arthur Philip Dent', the Property will also inherit the document attribute and
-automatically update its parent attribute::
-
-    >>> MYodML['TheCrew']['Arthur Philip Dent'].append(prop1)
-
-    >>> print(prop1.document)
-    Document 42 {author = D. N. Adams, 1 sections}
-    >>> print(prop1.parent)
-    Section[0|1] {name = Arthur Philip Dent, type = crew/person, id = ...}
-
-Next, let us create a Property with multiple metadata entries::
-
-    >>> prop2 = odml.Property(name="NameCrewMembers",
-                              definition="List of crew members names",
-                              values=["Arthur Philip Dent",
-                                      "Zaphod Beeblebrox",
-                                      "Tricia Marie McMillan",
-                                      "Ford Prefect"],
-                              dtype=odml.DType.person)
-
-As you learned before, in such a case, the metadata entries must be 
-homogeneous! That means they have to be of the same dtype, unit, and 
-uncertainty (here ``odml.DType.person``, None, and None, respectively).
-
-To further build up our odML file, let us attach now this new Property to the
-previously created Section 'TheCrew'::
-
-    >>> MYodML['TheCrew'].append(prop2)
-
-Note that it is also possible to add a metadata entry later on::
-
-    >>> prop2.append("Blind Passenger")
-    >>> print(MYodML['TheCrew'].properties['NameCrewMembers'].values)
-    ['Arthur Philip Dent',
-     'Zaphod Beeblebrox',
-     'Tricia Marie McMillan',
-     'Ford Prefect',
-     'Blind Passenger']
-
-
-The tuple datatype you might have noticed in the dtype table above has to be
-specially handled. It is intended to enforce a specific number of datapoints
-for each value entry. This is useful in case of 2D or 3D data, where all
-datapoints always have to be present for each entry.
-The dtype itself has to contain the number corresponding to the required value
-data points. For the value data points themselves, they have to be enclosed
-by brackets and separated by a semicolon.
-
-    >>> pixel_prop = odml.Property(name="pixel map")
-    >>> pixel_prop.dtype = "2-tuple"
-    >>> pixel_prop.values = ["(1; 2)", "(3; 4)"]
-
-    >>> voxel_prop = odml.Property(name="voxel map")
-    >>> voxel_prop.dtype = "3-tuple"
-    >>> voxel_prop.values = "(1; 2; 3)"
-
-Please note, that inconsistent tuple values will raise an error:
-
-    >>> tprop = odml.Property(name="tuple fail")
-    >>> tprop.dtype = "3-tuple"
-    >>> tprop.values = ["(1; 2)"]
-
-
-Printing XML-representation of an odML file:
---------------------------------------------
-
-Although the XML-representation of an odML file is a bit hard to read, it is 
-sometimes helpful to check, especially during a generation process, how the 
-hierarchical structure of the odML file looks like.
-
-Let's have a look at the XML-representation of our small odML file we just 
-generated::
-
-    >>> print(odml.tools.xmlparser.XMLWriter(MYodML))
-    <odML version="1.1">
-      <date>1979-10-12</date>
-      <section>
-        <definition>Information on the crew</definition>
-        <property>
-          <definition>List of crew members names</definition>
-          <name>NameCrewMembers</name>
-          <type>person</type>
-          <value>[Arthur Philip Dent,Zaphod Beeblebrox,Tricia Marie McMillan,Ford Prefect,Blind Passenger&#13;]</value>
-        </property>
-        <name>TheCrew</name>
-        <section>
-          <definition>Information on Arthur Dent</definition>
-          <property>
-            <definition>Sex of the subject</definition>
-            <name>Gender</name>
-            <type>string</type>
-            <value>[male&#13;]</value>
-          </property>
-          <name>Arthur Philip Dent</name>
-          <type>crew/person</type>
-        </section>
-        <type>crew</type>
-      </section>
-      <version>42</version>
-      <repository>file:///home/zehl/Projects/toolbox/python-odml/doc/example_odMLs/THGTTG.odml</repository>
-      <author>D. N. Adams</author>
-    </odML>
-
-
-Saving an odML file:
---------------------
-
-You can save your odML file using the following command::
-
-    >>> save_to = '/home/usr/toolbox/python-odml/doc/example_odMLs/myodml.odml'
-    >>> odml.save(MYodML, save_to)
-
-
-Loading an odML file:
----------------------
-
-You already learned how to load the example odML file. Here just as a reminder
-you can try to reload your own saved odML file::
-
-    >>> my_reloaded_odml = odml.load(save_to)
-
-
--------------------------------------------------------------------------------
-
-
-Advanced odML-Features
-======================
-
-
-Advanced knowledge on Values
-----------------------------
-
-Data type conversions
-*********************
-
-After creating a Property with metadata the data type can be changed and the 
-format of the corresponding entry will converted to the new data type, if the 
-new format is valid for the given metadata::
-
-    >>> test_dtype_conv = odml.Property('p', values=1.0)
-    >>> print(test_dtype_conv.values)
-    [1.0]
-    >>> print(test_dtype_conv.dtype)
-    float
-    >>> test_dtype_conv.dtype = odml.DType.int
-    >>> print(test_dtype_conv.values)
-    [1]
-    >>> print(test_dtype_conv.dtype)
-    int
-
-If the conversion is invalid a ValueError is raised.
-       
-Also note, that during such a process metadata loss may occur if a float is
-converted to an integer and then back to a float::
-
-    >>> test_dtype_conv = odml.Property('p', values=42.42)
-    >>> print(test_dtype_conv.values)
-    [42.42]
-    >>> test_dtype_conv.dtype = odml.DType.int
-    >>> test_dtype_conv.dtype = odml.DType.float
-    >>> print(test_dtype_conv.values)
-    [42.0]
-
-
-Advanced knowledge on Properties
---------------------------------
-
-Advanced knowledge on Sections
-------------------------------
-
-Links & Includes
-****************
-(DEPRECATED; new version coming soon)
-
-Sections can be linked to other Sections, so that they include their defined
-attributes. A link can be within the document (``link`` property) or to an
-external one (``include`` property).
-
-After parsing a document, these links are not yet resolved, but can be using
-the :py:meth:`odml.doc.BaseDocument.finalize` method::
-
-    >>> d = xmlparser.load("sample.odml")
-    >>> d.finalize()
-
-Note: Only the parser does not automatically resolve link properties, as the referenced
-sections may not yet be available.
-However, when manually setting the ``link`` (or ``include``) attribute, it will
-be immediately resolved. To avoid this behaviour, set the ``_link`` (or ``_include``)
-attribute instead.
-The object remembers to which one it is linked in its ``_merged`` attribute.
-The link can be unresolved manually using :py:meth:`odml.section.BaseSection.unmerge`
-and merged again using :py:meth:`odml.section.BaseSection.merge`.
-
-Unresolving means to remove sections and properties that do not differ from their
-linked equivalents. This should be done globally before saving using the
-:py:meth:`odml.doc.BaseDocument.clean` method::
-
-    >>> d.clean()
-    >>> xmlparser.XMLWriter(d).write_file('sample.odml')
-
-Changing a ``link`` (or ``include``) attribute will first unmerge the section and
-then set merge with the new object.
-
-Terminologies
-*************
-(deprecated; new version coming soon)
-odML supports terminologies that are data structure templates for typical use cases.
-Sections can have a ``repository`` attribute. As repositories can be inherited,
-the current applicable one can be obtained using the
-:py:meth:`odml.section.BaseSection.get_repository` method.
-
-To see whether an object has a terminology equivalent, use the
-:py:meth:`odml.property.BaseProperty.get_terminology_equivalent`
-method, which returns the corresponding object of the terminology.

+ 0 - 4
code/python-odml/docs/_config.yml

@@ -1,4 +0,0 @@
-theme: jekyll-theme-leap-day
-title: Open metadata markup language - odML -
-description: data model for storing arbitrary metadata
-show_downloads: "false"

+ 0 - 544
code/python-odml/docs/_sass/jekyll-theme-leap-day.scss

@@ -1,544 +0,0 @@
-/*
-Leap Day for GitHub Pages
-by Matt Graham
-*/
-
-@import "normalize";
-@import "fonts";
-@import "rouge-base16-dark";
-
-body {
-  font:14px/22px 'Quattrocento Sans', "Helvetica Neue", Helvetica,
-Arial, sans-serif;
-  color:#666;
-    font-weight:300;
-      margin: 0px;
-        padding:0px 0 20px 0px;
-	  background: url(../images/body-background.png) #eae6d1;
-	  }
-	  
-	  h1, h2, h3, h4, h5, h6 {
-	    color:#333;
-	      margin:0 0 10px;
-	      }
-	      
-	      p, ul, ol, table, pre, dl {
-	        margin:0 0 20px;
-		}
-		
-		h1, h2, h3 {
-		  line-height:1.1;
-		  }
-		  
-		  h1 {
-		    font-size:28px;
-		    }
-		    
-		    h2 {
-		      font-size: 24px;
-		        color:#393939;
-			}
-			
-			h3, h4, h5, h6 {
-			  color:#666666;
-			  }
-			  
-			  h3 {
-			    font-size: 18px;
-			      line-height: 24px;
-			      }
-			      
-			      a {
-			        color:#3399cc;
-				  font-weight:400;
-				    text-decoration:none;
-				    }
-				    
-				    a small {
-				      font-size:11px;
-				        color:#666;
-					  margin-top:-0.6em;
-					    display:block;
-					    }
-					    
-					    ul{
-					      list-style-image:url('../images/bullet.png');
-					      }
-					      
-					      strong {
-					        font-weight: bold;
-						  color: #333;
-						  }
-						  
-						  .wrapper {
-						    width:650px;
-						      margin:0 auto;
-						        position:relative;
-							}
-							
-							section img {
-							  max-width: 100%;
-							  }
-							  
-							  blockquote {
-							    border-left:1px
-solid #ffcc00;
-  margin:0;
-    padding:0 0 0 20px;
-      font-style:italic;
-      }
-      
-      code {
-        font-family: 'Lucida Sans', Monaco, Bitstream Vera Sans Mono,
-Lucida Console, Terminal;
-  font-size:13px;
-    color:#efefef;
-      text-shadow: 0px 1px 0px #000;
-        margin: 0 4px;
-	  padding: 2px 6px;
-	    background: #333;
-	      border-radius: 2px;
-	      }
-	      
-	      pre {
-	        padding:8px 15px;
-		  background: #333333;
-		    border-radius: 3px;
-		      border:1px solid #c7c7c7;
-		        overflow: auto;
-			  overflow-y: hidden;
-			  
-			    code {
-			        margin: 0px;
-				    padding: 0px;
-				      }
-				      }
-				      
-				      table {
-				        width:100%;
-					  border-collapse:collapse;
-					  }
-					  
-					  th {
-					    text-align:left;
-					      padding:5px 10px;
-					        border-bottom:1px solid #e5e5e5;
-						  color: #444;
-						  }
-						  
-						  td {
-						    text-align:left;
-						      padding:5px 10px;
-						        border-bottom:1px
-solid #e5e5e5;
-  border-right: 1px solid #ffcc00;
-  
-    &:first-child {
-        border-left: 1px solid #ffcc00;
-	  }
-	  }
-	  
-	  hr {
-	    border: 0;
-	      outline: none;
-	        height: 11px;
-		  background: transparent url('../images/hr.gif')
-center center repeat-x;
-  margin: 0 0 20px;
-  }
-  
-  dt {
-    color:#444;
-      font-weight:700;
-      }
-      
-      header {
-        padding: 25px 20px 40px 20px;
-	  margin: 0;
-	    position: fixed;
-	      top: 0;
-	        left:0;
-		  right:0;
-		    width: 100%;
-		      text-align: center;
-		        background: url(../images/background.png) #4276b6;
-			  box-shadow: 1px 0px 2px rgba(0,0,0,.75);
-			    z-index:99;
-			      -webkit-font-smoothing:antialiased;
-			        min-height: 76px;
-				
-				  h1 {
-				      font: 40px/48px 'Copse',
-"Helvetica Neue", Helvetica, Arial, sans-serif;
-    color: #f3f3f3;
-        text-shadow: 0px 2px 0px #235796;
-	    margin: 0px;
-	        white-space: nowrap;
-		    overflow: hidden;
-		        text-overflow: ellipsis;
-			    -o-text-overflow: ellipsis;
-			        -ms-text-overflow: ellipsis;
-				  }
-				  
-				    p {
-				        color: #d8d8d8;
-					    text-shadow:rgba(#000,
-0.2) 0 1px 0;
-    font-size: 18px;
-        margin: 0px;
-	  }
-	  }
-	  
-	  #banner {
-	    z-index: 100;
-	      left:0;
-	        right:50%;
-		  height: 50px;
-		    margin-right:-382px;
-		      position: fixed;
-		        top: 115px;
-			  background: #1876dfff;
-			    border: 1px solid #00000000;
-			      box-shadow: 0px 1px 3px rgba(0,0,0,.25);
-			        border-radius: 0px 2px 2px 0px;
-				  padding-right: 10px;
-				  
-				    .button {
-				        border: 1px solid #dba500;
-					    background:
-linear_gradient(rgb(255, 231, 136), rgb(255, 206, 56));
-    border-radius: 2px;
-        box-shadow: inset 0px 1px 0px rgba(255,255,255,.4), 0px 1px
-1px rgba(0,0,0,.1);
-    background-color: #FFE788;
-        margin-left: 5px;
-	    padding: 10px 12px;
-	        margin-top: 6px;
-		    line-height:14px;
-		        font-size:14px;
-			    color:#333;
-			        font-weight: bold;
-				    display:inline-block;
-				        text-align:center;
-					
-					    &:hover {
-					          background:
-linear_gradient(rgb(255, 231, 136), rgb(255, 231, 136));
-      background-color: #ffeca0;
-          }
-	    }
-	    
-	      .fork {
-	          position:fixed;
-		      left:50%;
-		          margin-left:-325px;
-			      padding: 10px 12px;
-			          margin-top: 6px;
-				      line-height:14px;
-				          font-size:14px;
-					      background-color: #FFE788;
-					        }
-						
-						  .downloads {
-						      float: right;
-						          margin:0
-45px 0 0;
-
-    span {
-          float:left;
-	        line-height:52px;
-		      font-size:90%;
-		            color:#9d7f0d;
-			          text-transform:uppercase;
-				        text-shadow:rgba(#fff, 0.2) 0
-1px 0;
-    }
-      }
-      
-        ul {
-	    list-style:none;
-	        height:40px;
-		    padding:0;
-		        float: left;
-			    margin-left:10px;
-			    
-			        li {
-				      display:inline;
-				      
-				            a.button {
-					            background-color: #FFE788;
-						          }
-							      }
-							        }
-								
-								  #logo {
-								      position:absolute;
-
- height: 36px;
-     width: 36px;
-         right:7px;
-	     top:7px;
-	         display: block;
-		     background: url(../images/g-node_logo2.png);
-		       }
-		       }
-		       
-		       section {
-		         width:590px;
-			   padding: 30px 30px 50px 30px;
-			     margin: 20px 0;
-			       margin-top: 190px;
-			         position:relative;
-				   background: #fbfbfb;
-				     border-radius: 3px;
-				       border: 1px solid #cbcbcb;
-				         box-shadow: 0px 1px 2px
-rgba(0,0,0,.09), inset 0px 0px 2px 2px rgba(255,255,255,.5), inset 0 0
-5px 5px rgba(255,255,255,.4);
-}
-
-small {
-  font-size:12px;
-  }
-  
-  nav {
-    width: 230px;
-      position: fixed;
-        top: 220px;
-	  left:50%;
-	    margin-left:-580px;
-	      text-align: right;
-	      
-	        ul {
-		    list-style: none;
-		        list-style-image:none;
-			    font-size: 14px;
-			        line-height:24px;
-				
-				    li {
-				          padding: 5px 0px;
-					        line-height: 16px;
-						      // padding-right:17px;
-						            // position:relative;
-							          // right:-12px;
-								  
-
-&.tag-h1 {
-        font-size: 1.2em;
-	
-	        a {
-		          font-weight: bold;
-			            color: #333;
-				            }
-					    
-					            + .tag-h2 {
-						    
-						            }
-							          }
-								  
-
-&.tag-h2 {
-
-        + .tag-h1 {
-	          margin-top:10px;
-		          }
-			        }
-				    }
-				    
-				        a {
-					      color: #666;
-					      
-					            &:hover { color:
-#999; }
-    }
-    
-        // .active {
-	    //   border-right:solid 4px #39C;
-	        //   padding-right:13px;
-		    // }
-		      }
-		      }
-		      
-		      footer {
-		        width:180px;
-			  position: fixed;
-			    left:50%;
-			      margin-left:-530px;
-			        bottom:20px;
-				  text-align: right;
-				    line-height: 16px;
-				    }
-				    
-				    @media print, screen and
-(max-width: 1060px) {
-
-  div.wrapper {
-      width:auto;
-          margin:0;
-	    }
-	    
-	      nav{
-	          display: none;
-		    }
-		    
-		      header, section, footer {
-		          float:none;
-			  
-			      h1 {
-			            white-space: nowrap;
-				          overflow: hidden;
-					        text-overflow: ellipsis;
-						      -o-text-overflow: ellipsis;
-						            -ms-text-overflow:
-ellipsis;
-    }
-      }
-      
-        #banner {
-	    width: 100%;
-	    
-	        .downloads {
-		        margin-right: 60px;
-			      }
-			      
-			          .fork {
-				      }
-				      
-				          #logo {
-					        margin-right: 15px;
-						    }
-						      }
-						      
-						        section {
-							    border:1px
-solid #e5e5e5;
-    border-width:1px 0;
-        padding:20px auto;
-	    margin: 190px auto 20px;
-	        max-width: 600px;
-		  }
-		  
-		    footer{
-		        text-align: center;
-			    margin: 20px auto;
-			        position: relative;
-				    left:auto;
-				        bottom:auto;
-					    width:auto;
-					        }
-						}
-						
-						@media print, screen
-and (max-width: 720px) {
-  body {
-      word-wrap:break-word;
-        }
-	
-	  header {
-	      padding:20px 20px;
-	          margin: 0;
-		  
-		      h1 {
-		            font-size: 32px;
-			          white-space: nowrap;
-				        overflow: hidden;
-					      text-overflow: ellipsis;
-					            -o-text-overflow: ellipsis;
-						          -ms-text-overflow:
-ellipsis;
-    }
-    
-        p { display: none;}
-	  }
-	  
-	    #banner {
-	        top: 80px;
-		
-		    .fork {
-		          float: left;
-			        display: inline-block;
-				      margin-left: 0px;
-				          position:fixed;
-					      left:20px;
-					      
-					            }
-						      }
-						      
-						        section {
-							    margin-top: 130px;
-							        margin-bottom:
-0px;
-    width: auto;
-      }
-      
-        header ul, header p.view {
-	    position:static;
-	      }
-	      }
-	      
-	      @media print, screen and (max-width: 480px) {
-	        body {
-		  }
-		  
-		    header{
-		        position: relative;
-			    padding: 5px 0px;
-			        min-height: 0px;
-				
-				    h1 {
-				          font-size: 24px;
-					        white-space: nowrap;
-						      overflow: hidden;
-						            text-overflow:
-ellipsis;
-      -o-text-overflow: ellipsis;
-            -ms-text-overflow: ellipsis;
-	        }
-		  }
-		    section {
-		        margin-top: 5px;
-			  }
-			  
-			    #banner { display: none;}
-			      header ul {
-			          display:none;
-				    }
-				    }
-				    
-				    @media print {
-				      body {
-				          padding:0.4in;
-					      font-size:12pt;
-					          color:#444;
-						    }
-						    }
-						    
-						    @media print,
-screen and (max-height: 680px) {
-
-  footer {
-      text-align: center;
-          margin: 20px auto;
-	      position: relative;
-	          left:auto;
-		      bottom:auto;
-		          width:auto;
-			    }
-			    }
-			    
-			    @media print, screen and (max-height:
-480px) {
-  nav {
-      display: none;
-        }
-	
-	  footer {
-	      text-align: center;
-	          margin: 20px auto;
-		      position: relative;
-		          left:auto;
-			      bottom:auto;
-			          width:auto;
-				    }
-				    }
-				    

BIN
code/python-odml/docs/assets/images/background.png


BIN
code/python-odml/docs/assets/images/g-node-logo.png


BIN
code/python-odml/docs/assets/images/g-node_logo2.png


+ 0 - 22
code/python-odml/docs/data_model.md

@@ -1,22 +0,0 @@
-# odml data model
-
-Data exchange requires that also annoations, metadata, are
-exchanged. In oder to allow interoperability we need both a common
-(meta) data model, the format in which the metadata are exchanged, and
-a common terminology.
-
-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
-elements are shown in the figure below.
-
-![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
-structure. The model does not constrain the content, which offers the
-flexibility essential for comprehensive annotation of neuroscience
-data.

BIN
code/python-odml/docs/images/erModel.png


BIN
code/python-odml/docs/images/odMLLogo.png


+ 0 - 106
code/python-odml/docs/index.md

@@ -1,106 +0,0 @@
-# odML
-
-<img src="./images/odMLLogo.png" alt="odml" style="width: 150px;"/>
-
-odML (open metadata Markup Language) is a file format for storing
-arbitrary metadata. The underlying [data model](./data_model.md)
-offers a way to store metadata in a structured human- and
-machine-readable way.  Well organized metadata management is a key
-component to guarantee reproducibility of experiments and to track
-provenance of performed analyses.
-
-
-*python-odml* is the python library for reading and writing odml metadata files. It is a registered research resource with
-the  [RRID:SCR_001376](https://scicrunch.org/browse/resources/SCR_001376)
-.
-
-## APIs
-
-- [*odml* python library](https://github.com/g-node/python-odml "python library for odml files"). Python library for reading and writing odml files.
-- [*java-odml-lib*](https://github.com/g-node/odml-java-lib "Java library for odml files") Java implementation of the data model.
-- [*matlab-odml*](https://github.com/g-node/matlab-odml "Matlab interface for odml files") Matlab interface for odml files.
-
-## Viewer/Editor
-
-- [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.
-
-* * *
-
-## Getting started
-
-### Installation
-
-*python-odml* is most conveniently installed via pip.
-
-```
-pip install odml
-```
-
-### Tutorial and examples
-
-- We have assembled a set of
- [tutorials](http://github.com/G-Node/python-odml/blob/master/doc/tutorial.rst "Python Tutorial").
-
-### Python convenience scripts
-
-The Python installation features two 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.
-
-Both scripts provide detailed usage descriptions by adding the help flag to the command.
-
-    odmlconversion -h
-    odmltordf -h
-
-## Support
-
-If you experience problems using *odml* feel free to join our IRC channel
-[#gnode at FreeNode](irc://irc.freenode.net/gnode) or write an email to <dev@g-node.org>. If you find a
-bug please report it using
-the [project issue tracker](https://github.com/G-Node/python-odml/issues "pyhton-odml issue tracker").
-
-
-## License
-
-This project is open source published under an MIT license-like see [license file](https://github.com/G-Node/python-odml/blob/master/LICENSE) for details.
-
-* * *
-
-## Citing
-
-If you use *odml*, it would be much appreciated if you would cite it in publications with its identifier RRID:SCR_001376 and/or the reference:
-
-*Grewe J., Wachtler T., and Benda J. (2011). A bottom-up approach to data annotation in neurophysiology. Front. Neuroinform. 5:16, [doi:10.3389/fninf.2011.00016](https://doi.org/10.3389/fninf.2011.00016)*
-
-
-### Referenced By
-
-- Dragly et al (2018) [doi:10.3389/fninf.2018.000169](https://doi.org/10.3389/fninf.2018.000169)
-- Brochier et al (2018) [doi:10.1038/sdata.2018.55](https://doi.org/10.1038/sdata.2018.55)
-- Moucek et al (2017) [doi:10.1038/sdata.2016.121](https://doi.org/10.1038/sdata.2016.121)
-- Papez et al (2017) [doi:10.3389/fninf.2017.00024](https://doi.org/10.3389/fninf.2017.00024)
-- Bigdely-Shamlo et al (2016) [doi:10.3389/fninf.2016.00007](https://doi.org/10.3389/fninf.2016.00007)
-- Rübel et al (2016) [doi:10.3389/fninf.2016.00048](https://doi.org/10.3389/fninf.2016.00048)
-- Wiener et al (2016) [doi:10.1016/j.neuron.2016.10.037](https://doi.org/10.1016/j.neuron.2016.10.037)
-- Zehl et al (2016) [doi:10.3389/fninf.2016.00026](https://doi.org/10.3389/fninf.2016.00026)
-- Jayapandian et al (2015) [doi:10.3389/fninf.2015.00004](https://doi.org/10.3389/fninf.2015.00004)
-- Jezek et al (2015) [doi:10.3389/fninf.2015.00003](https://doi.org/10.3389/fninf.2015.00003)
-- Kocaturk et al (2015) [doi:10.3389/fnbot.2015.00008](https://doi.org/10.3389/fnbot.2015.00008)
-- Maccione et al (2015) [doi:10.1016/j.brainresbull.2015.07.008](https://doi.org/10.1016/j.brainresbull.2015.07.008)
-- Vanek et al (2015) [doi:10.1109/Informatics.2015.7377849](https://doi.org/10.1109/Informatics.2015.7377849)
-- Garcia et al (2014) [doi:10.3389/fninf.2014.00010](https://doi.org/10.3389/fninf.2014.00010)
-- Moucek et al (2014) [doi:10.3389/fninf.2014.00020](https://doi.org/10.3389/fninf.2014.00020)
-- Sobolev et al (2014) [doi:10.3389/fninf.2014.00015](https://doi.org/10.3389/fninf.2014.00015)
-- Cockfield et al (2013) [doi:10.3389/fninf.2013.00020](https://doi.org/10.3389/fninf.2013.00020)
-- Papez et al (2013) [doi:10.1109/BIBM.2013.6732554](https://doi.org/10.1109/BIBM.2013.6732554)
-- Bakker et al (2012) [doi:10.3389/fninf.2012.00030](https://doi.org/10.3389/fninf.2012.00030)

+ 1 - 115
code/python-odml/odml/__init__.py

@@ -1,115 +1 @@
-_property = property
-
-from . import doc
-from . import property
-from . import section
-from .dtypes import DType
-from .fileio import load, save, display
-from .info import VERSION
-from .tools.parser_utils import SUPPORTED_PARSERS as PARSERS
-
-__version__ = VERSION
-
-
-class odml_implementation(object):
-    name = None
-    provides = []
-    Property = None
-    Section = None
-    Document = None
-
-
-class BasicImplementation(odml_implementation):
-    name = 'basic'
-    provides = ['basic']
-
-    @_property
-    def Section(self):
-        return section.BaseSection
-
-    @_property
-    def Property(self):
-        return property.BaseProperty
-
-    @_property
-    def Document(self):
-        return doc.BaseDocument
-
-# here the available implementations are stored
-impls = {}
-
-# the default implementation
-current_implementation = BasicImplementation()
-minimum_implementation = current_implementation
-
-
-def addImplementation(implementation, make_minimum=False,
-                      make_default=False, key=None):
-    """register a new available implementation"""
-    impls[implementation.name] = implementation
-    if make_minimum and key is not None:
-        setMinimumImplementation(key)
-    if make_default and key is not None:
-        setDefaultImplementation(key)
-
-
-def getImplementation(key=None):
-    """retrieve a implementation named *key*"""
-    if key is None:
-        return current_implementation
-    implementation = impls[key]
-    return implementation
-
-
-def setDefaultImplementation(key):
-    """
-    set a new default implementation
-
-    if it does not fulfill the minimum requirements, a TypeError is raised
-    """
-    global current_implementation
-    if minimum_implementation.name not in impls[key].provides:
-        raise TypeError(
-            "Cannot set default odml-implementation to '%s', "
-            "because %s-capabilities are required which are not "
-            "provided (provides: %s)" %
-            (key, minimum_implementation.name, ', '.join(impls[key].provides)))
-    current_implementation = impls[key]
-
-
-def setMinimumImplementation(key):
-    """
-    Set a new minimum requirement for a default implementation.
-    This can only be increased, i.e. 'downgrades' are not possible.
-    If the current_implementation does not provide the requested capability,
-    make the minimum implementation the default.
-    """
-    global minimum_implementation
-    if key in minimum_implementation.provides:
-        return  # the minimum implementation is already capable of this feature
-    if minimum_implementation.name not in impls[key].provides:
-        raise TypeError(
-            "Cannot set new minimum odml-implementation to '%s', "
-            "because %s-capabilities are already required which are "
-            "not provided (provides: %s)" %
-            (key, minimum_implementation.name, ', '.join(impls[key].provides)))
-    if key not in current_implementation.provides:
-        setDefaultImplementation(key)
-    minimum_implementation = impls[key]
-
-
-addImplementation(current_implementation)
-
-
-def Property(*args, **kwargs):
-    return current_implementation.Property(*args, **kwargs)
-
-
-def Section(*args, **kwargs):
-    return current_implementation.Section(*args, **kwargs)
-
-
-def Document(*args, **kwargs):
-    return current_implementation.Document(*args, **kwargs)
-
-# __all__ = [Property, Section, Document]
+/annex/objects/MD5-s4387--cdbd0c5f50c5258322d04397c0f84e3c

+ 1 - 633
code/python-odml/odml/base.py

@@ -1,633 +1 @@
-# -*- coding: utf-8
-"""
-Collects common base functionality
-"""
-import collections
-import posixpath
-
-from . import terminology
-from .tools.doc_inherit import allow_inherit_docstring
-
-
-class BaseObject(object):
-    _format = None
-
-    def __hash__(self):
-        """
-        Allow all odML objects to be hash-able.
-        """
-        return id(self)
-
-    def __eq__(self, obj):
-        """
-        Do a deep comparison of this object and its odml properties.
-        The 'id' attribute of an object is excluded, since it is
-        unique within a document.
-        """
-        # cannot compare totally different stuff
-        if not isinstance(self, obj.__class__):
-            return False
-
-        for key in self._format:
-            if key == "id" or key == "oid":
-                continue
-            elif getattr(self, key) != getattr(obj, key):
-                return False
-
-        return True
-
-    def __ne__(self, obj):
-        """
-        Use the __eq__ function to determine if both objects are equal
-        """
-        return not self == obj
-
-    def format(self):
-        return self._format
-
-    @property
-    def document(self):
-        """ Returns the Document object in which this object is contained """
-        if self.parent is None:
-            return None
-        return self.parent.document
-
-    def get_terminology_equivalent(self):
-        """
-        Returns the equivalent object in an terminology (should there be one
-        defined) or None
-        """
-        return None
-
-    def clean(self):
-        """
-        Stub that doesn't do anything for this class
-        """
-        pass
-
-    def clone(self, children=True):
-        """
-        Clone this object recursively (if children is True) allowing to copy it
-        independently to another document. If children is False, this acts as
-        a template cloner, creating a copy of the object without any children
-        """
-        # TODO don't we need some recursion / deepcopy here?
-        import copy
-        obj = copy.copy(self)
-        return obj
-
-
-class SmartList(list):
-
-    def __init__(self, content_type):
-        """
-        Only values of the instance *content_type* can be added to the SmartList.
-        """
-        self._content_type = content_type
-        super(SmartList, self).__init__()
-
-    def __getitem__(self, key):
-        """
-        Provides element index also by searching for an element with a given name.
-        """
-        # Try normal list index first (for integers)
-        if isinstance(key, int):
-            return super(SmartList, self).__getitem__(key)
-
-        # Otherwise search the list
-        for obj in self:
-            if (hasattr(obj, "name") and obj.name == key) or key == obj:
-                return obj
-
-        # and fail eventually
-        raise KeyError(key)
-
-    def __setitem__(self, key, value):
-        """
-        Replaces item at list[*key*] with *value*.
-        :param key: index position
-        :param value: object that replaces item at *key* position.
-                      value has to be of the same content type as the list.
-                      In this context usually a Section or a Property.
-        """
-        if not isinstance(value, self._content_type):
-            raise ValueError("List only supports elements of type '%s'" %
-                             self._content_type)
-
-        # If required remove new object from its old parents child-list
-        if hasattr(value, "_parent") and (value._parent and value in value._parent):
-            value._parent.remove(value)
-
-        # If required move parent reference from replaced to new object
-        # and set parent reference on replaced object None.
-        if hasattr(self[key], "_parent"):
-            value._parent = self[key]._parent
-            self[key]._parent = None
-
-        super(SmartList, self).__setitem__(key, value)
-
-    def __contains__(self, key):
-        for obj in self:
-            if (hasattr(obj, "name") and obj.name == key) or key == obj:
-                return True
-
-    def __eq__(self, obj):
-        """
-        SmartList attributes of 'sections' and 'properties' are
-        handled specially: We want to make sure that the lists'
-        objects are properly compared without changing the order
-        of the individual lists.
-        """
-        # This special case was introduced only due to the fact
-        # that RDF files will be loaded with randomized list
-        # order. With any other file format the list order
-        # remains unchanged.
-        if sorted(self, key=lambda x: x.name) != sorted(obj, key=lambda x: x.name):
-            return False
-
-        return True
-
-    def __ne__(self, obj):
-        """
-        Use the __eq__ function to determine if both objects are equal
-        """
-        return not self == obj
-
-    def index(self, obj):
-        """
-        Find obj in list
-        """
-        for i, e in enumerate(self):
-            if e is obj:
-                return i
-        raise ValueError("remove: %s not in list" % repr(obj))
-
-    def remove(self, obj):
-        """
-        Remove an element from this list.
-        """
-        del self[self.index(obj)]
-
-    def append(self, *obj_tuple):
-        for obj in obj_tuple:
-            if obj.name in self:
-                raise KeyError(
-                    "Object with the same name already exists! " + str(obj))
-
-            if not isinstance(obj, self._content_type):
-                raise ValueError("List only supports elements of type '%s'" %
-                                 self._content_type)
-
-            super(SmartList, self).append(obj)
-
-    def sort(self, key=lambda x: x.name, reverse=False):
-        """
-        If not otherwise defined, sort by the *name* attribute
-        of the lists *_content_type* object.
-        """
-        super(SmartList, self).sort(key=key, reverse=reverse)
-
-
-@allow_inherit_docstring
-class Sectionable(BaseObject):
-    def __init__(self):
-        from odml.section import BaseSection
-        self._sections = SmartList(BaseSection)
-        self._repository = None
-
-    def __getitem__(self, key):
-        return self._sections[key]
-
-    def __len__(self):
-        return len(self._sections)
-
-    def __iter__(self):
-        return self._sections.__iter__()
-
-    @property
-    def document(self):
-        """
-        Returns the parent-most node (if its a document instance) or None
-        """
-        from odml.doc import BaseDocument
-        p = self
-        while p.parent:
-            p = p.parent
-        if isinstance(p, BaseDocument):
-            return p
-
-    @property
-    def sections(self):
-        """ The list of sections contained in this section/document """
-        return self._sections
-
-    def insert(self, position, section):
-        """
-        Insert a Section at the child-list position. A ValueError will be raised,
-        if a Section with the same name already exists in the child-list.
-
-        :param position: index at which the object should be inserted.
-        :param section: odML Section object.
-        """
-        from odml.section import BaseSection
-        if isinstance(section, BaseSection):
-            if section.name in self._sections:
-                raise ValueError("Section with name '%s' already exists." % section.name)
-
-            self._sections.insert(position, section)
-            section._parent = self
-        else:
-            raise ValueError("Can only insert objects of type Section.")
-
-    def append(self, section):
-        """
-        Method appends a single Section to the section child-lists of the current Object.
-
-        :param section: odML Section object.
-        """
-        from odml.section import BaseSection
-        if isinstance(section, BaseSection):
-            self._sections.append(section)
-            section._parent = self
-        elif isinstance(section, collections.Iterable) and not isinstance(section, str):
-            raise ValueError("Use extend to add a list of Sections.")
-        else:
-            raise ValueError("Can only append objects of type Section.")
-
-    def extend(self, sec_list):
-        """
-        Method adds Sections to the section child-list of the current object.
-
-        :param sec_list: Iterable containing odML Section entries.
-        """
-        from odml.section import BaseSection
-        if not isinstance(sec_list, collections.Iterable):
-            raise TypeError("'%s' object is not iterable" % type(sec_list).__name__)
-
-        # Make sure only Sections with unique names will be added.
-        for sec in sec_list:
-            if not isinstance(sec, BaseSection):
-                raise ValueError("Can only extend objects of type Section.")
-
-            elif isinstance(sec, BaseSection) and sec.name in self._sections:
-                raise KeyError("Section with name '%s' already exists." % sec.name)
-
-        for sec in sec_list:
-            self.append(sec)
-
-    def remove(self, section):
-        """ Removes the specified child-section """
-        self._sections.remove(section)
-        section._parent = None
-
-    def itersections(self, recursive=True, yield_self=False,
-                     filter_func=lambda x: True, max_depth=None):
-        """
-        Iterate each child section
-
-        Example: return all subsections which name contains "foo"
-        >>> filter_func = lambda x: getattr(x, 'name').find("foo") > -1
-        >>> sec_or_doc.itersections(filter_func=filter_func)
-
-        :param recursive: iterate all child sections recursively (deprecated)
-        :type recursive: bool
-
-        :param yield_self: includes itself in the iteration
-        :type yield_self: bool
-
-        :param filter_func: accepts a function that will be applied to each
-                            iterable. Yields iterable if function returns True
-        :type filter_func: function
-        """
-        stack = []
-        # Below: never yield self if self is a Document
-        if self == self.document and ((max_depth is None) or (max_depth > 0)):
-            for sec in self.sections:
-                stack.append((sec, 1))  # (<section>, <level in a tree>)
-        elif self != self.document:
-            stack.append((self, 0))  # (<section>, <level in a tree>)
-
-        while len(stack) > 0:
-            (sec, level) = stack.pop(0)
-            if filter_func(sec) and (yield_self if level == 0 else True):
-                yield sec
-
-            if max_depth is None or level < max_depth:
-                for sec in sec.sections:
-                    stack.append((sec, level + 1))
-
-    def iterproperties(self, max_depth=None, filter_func=lambda x: True):
-        """
-        Iterate each related property (recursively)
-
-        Example: return all children properties which name contains "foo"
-        >>> filter_func = lambda x: getattr(x, 'name').find("foo") > -1
-        >>> sec_or_doc.iterproperties(filter_func=filter_func)
-
-        :param max_depth: iterate all properties recursively if None, only to
-                          a certain level otherwise
-        :type max_depth: bool
-
-        :param filter_func: accepts a function that will be applied to each
-                            iterable. Yields iterable if function returns True
-        :type filter_func: function
-        """
-        for sec in [s for s in self.itersections(max_depth=max_depth,
-                                                 yield_self=True)]:
-            if hasattr(sec, "properties"):  # not to fail if odml.Document
-                for i in sec.properties:
-                    if filter_func(i):
-                        yield i
-
-    def itervalues(self, max_depth=None, filter_func=lambda x: True):
-        """
-        Iterate each related value (recursively)
-
-        # Example: return all children values which string converted version
-                   has "foo"
-        >>> filter_func = lambda x: str(x).find("foo") > -1
-        >>> sec_or_doc.itervalues(filter_func=filter_func)
-
-        :param max_depth: iterate all properties recursively if None, only to
-                          a certain level otherwise
-        :type max_depth: bool
-
-        :param filter_func: accepts a function that will be applied to each
-                            iterable. Yields iterable if function returns True
-        :type filter_func: function
-        """
-        for prop in [p for p in self.iterproperties(max_depth=max_depth)]:
-            if filter_func(prop.values):
-                yield prop.values
-
-    def contains(self, obj):
-        """
-        Checks if a subsection of name&type of *obj* is a child of this section
-        if so return this child
-        """
-        for i in self._sections:
-            if obj.name == i.name and obj.type == i.type:
-                return i
-
-    def _matches(self, obj, key=None, otype=None, include_subtype=False):
-        """
-        Find out
-        * if the *key* matches obj.name (if key is not None)
-        * or if *otype* matches obj.type (if type is not None)
-        * if type does not match exactly, test for subtype.
-        (e.g.stimulus/white_noise)
-        comparisons are case-insensitive, however both key and type
-        MUST be lower-case.
-        """
-        name_match = (key is None or (
-            key is not None and hasattr(obj, "name") and obj.name == key))
-
-        exact_type_match = (otype is None or (otype is not None and
-                                              hasattr(obj, "type") and
-                                              obj.type.lower() == otype))
-
-        if not include_subtype:
-            return name_match and exact_type_match
-
-        subtype_match = (otype is None or
-                         (otype is not None and hasattr(obj, "type") and
-                          otype in obj.type.lower().split('/')[:-1]))
-
-        return name_match and (exact_type_match or subtype_match)
-
-    def get_section_by_path(self, path):
-        """
-        Find a Section through a path like "../name1/name2"
-
-        :param path: path like "../name1/name2"
-        :type path: str
-        """
-        return self._get_section_by_path(path)
-
-    def get_property_by_path(self, path):
-        """
-        Find a Property through a path like "../name1/name2:property_name"
-
-        :param path: path like "../name1/name2:property_name"
-        :type path: str
-        """
-        laststep = path.split(":")  # assuming section names do not contain :
-        found = self._get_section_by_path(laststep[0])
-        return self._match_iterable(found.properties, ":".join(laststep[1:]))
-
-    def _match_iterable(self, iterable, key):
-        """
-        Searches for a key match within a given iterable.
-        Raises ValueError if not found.
-        """
-        for obj in iterable:
-            if self._matches(obj, key):
-                return obj
-        raise ValueError("Object named '%s' does not exist" % key)
-
-    def _get_section_by_path(self, path):
-        """
-        Returns a Section by a given path.
-        Raises ValueError if not found.
-        """
-        if path.startswith("/"):
-            if len(path) == 1:
-                raise ValueError("Not a valid path")
-            doc = self.document
-            if doc is not None:
-                return doc._get_section_by_path(path[1:])
-            raise ValueError(
-                "A section with no Document cannot resolve absolute path")
-
-        pathlist = path.split("/")
-        if len(pathlist) > 1:
-            if pathlist[0] == "..":
-                found = self.parent
-            elif pathlist[0] == ".":
-                found = self
-            else:
-                found = self._match_iterable(self.sections, pathlist[0])
-
-            if found:
-                return found._get_section_by_path("/".join(pathlist[1:]))
-            raise ValueError("Section named '%s' does not exist" % pathlist[0])
-        else:
-            return self._match_iterable(self.sections, pathlist[0])
-
-    def find(self, key=None, type=None, findAll=False, include_subtype=False):
-        """ Return the first subsection named *key* of type *type* """
-        ret = []
-        if type:
-            type = type.lower()
-
-        for s in self._sections:
-            if self._matches(s, key, type, include_subtype=include_subtype):
-                if findAll:
-                    ret.append(s)
-                else:
-                    return s
-        if ret:
-            return ret
-
-    def find_related(self, key=None, type=None, children=True, siblings=True,
-                     parents=True, recursive=True, findAll=False):
-        """
-        Finds a related section named *key* and/or *type*
-
-          * by searching its children’s children if *children* is True
-            if *recursive* is true all leave nodes will be searched
-          * by searching its siblings if *siblings* is True
-          * by searching the parent element if *parents* is True
-            if *recursive* is True all parent nodes until the root are searched
-          * if *findAll* is True, returns a list of all matching objects
-        """
-        ret = []
-        if type:
-            type = type.lower()
-
-        if children:
-            for section in self._sections:
-                if self._matches(section, key, type):
-                    if findAll:
-                        ret.append(section)
-                    else:
-                        return section
-
-                if recursive:
-                    obj = section.find_related(key, type, children,
-                                               siblings=False, parents=False,
-                                               recursive=recursive,
-                                               findAll=findAll)
-                    if obj is not None:
-                        if findAll:
-                            ret += obj
-                        else:
-                            return obj
-
-        if siblings and self.parent is not None:
-            obj = self.parent.find(key, type, findAll)
-            if obj is not None:
-                if findAll:
-                    ret += obj
-                else:
-                    return obj
-
-        if parents:
-            obj = self
-            while obj.parent is not None:
-                obj = obj.parent
-                if self._matches(obj, key, type):
-                    if findAll:
-                        ret.append(obj)
-                    else:
-                        return obj
-                if not recursive:
-                    break
-
-        if ret:
-            return ret
-        return None
-
-    def get_path(self):
-        """
-        Returns the absolute path of this section
-        """
-        node = self
-        path = []
-        while node.parent is not None:
-            path.insert(0, node.name)
-            node = node.parent
-        return "/" + "/".join(path)
-
-    @staticmethod
-    def _get_relative_path(a, b):
-        """
-        Returns a relative path for navigation from dir *a* to dir *b*
-
-        If the common parent of both is "/", return an absolute path
-        """
-        a += "/"
-        b += "/"
-        parent = posixpath.dirname(posixpath.commonprefix([a, b]))
-        if parent == "/":
-            return b[:-1]
-
-        a = posixpath.relpath(a, parent)
-        b = posixpath.relpath(b, parent)
-        if a == ".":
-            return b
-
-        return posixpath.normpath("../" * (a.count("/") + 1) + b)
-
-    def get_relative_path(self, section):
-        """
-        Returns a relative (file)path to point to section
-        like (e.g. ../other_section)
-
-        If the common parent of both sections is the document (i.e. /),
-        return an absolute path
-        """
-        a = self.get_path()
-        b = section.get_path()
-        return self._get_relative_path(a, b)
-
-    def clean(self):
-        """
-        Runs clean() on all immediate child-sections causing any resolved links
-        or includes to be unresolved.
-
-        This should be called for the document prior to saving.
-        """
-        for i in self:
-            i.clean()
-
-    def clone(self, children=True, keep_id=False):
-        """
-        Clone this object recursively allowing to copy it independently
-        to another document
-        """
-        from odml.section import BaseSection
-        obj = super(Sectionable, self).clone(children)
-        obj._parent = None
-        obj._sections = SmartList(BaseSection)
-        if children:
-            for s in self._sections:
-                obj.append(s.clone(keep_id=keep_id))
-
-        return obj
-
-    @property
-    def repository(self):
-        """ A URL to a terminology. """
-        return self._repository
-
-    @repository.setter
-    def repository(self, url):
-        if not url:
-            url = None
-        self._repository = url
-        if url:
-            terminology.deferred_load(url)
-
-    def get_repository(self):
-        """
-        Return the current applicable repository (may be inherited from a
-        parent) or None
-        """
-        return self._repository
-
-    def create_section(self, name, type="undefined", oid=None):
-        """
-        Creates a new subsection that is a child of this section.
-
-        :param name: The name of the section to create.
-        :param type: The type of the section.
-        :param oid: object id, UUID string as specified in RFC 4122. If no id
-                    is provided, an id will be generated and assigned.
-        :return: The new section.
-        """
-        from odml.section import BaseSection
-        sec = BaseSection(name=name, type=type, oid=oid)
-        sec.parent = self
-
-        return sec
+/annex/objects/MD5-s23748--35480a84d80fc9489ecf8d98d3858588

+ 1 - 143
code/python-odml/odml/doc.py

@@ -1,143 +1 @@
-# -*- coding: utf-8
-import uuid
-
-from . import base
-from . import dtypes
-from . import format
-from . import terminology
-from .tools.doc_inherit import inherit_docstring, allow_inherit_docstring
-
-
-@allow_inherit_docstring
-class BaseDocument(base.Sectionable):
-    """
-    A representation of an odML document in memory.
-    Its odml attributes are: *author*, *date*, *version* and *repository*.
-    A Document behaves very much like a section, except that it cannot hold
-    properties.
-    """
-
-    _format = format.Document
-
-    def __init__(self, author=None, date=None, version=None, repository=None, oid=None):
-        super(BaseDocument, self).__init__()
-        try:
-            if oid is not None:
-                self._id = str(uuid.UUID(oid))
-            else:
-                self._id = str(uuid.uuid4())
-        except ValueError as e:
-            print(e)
-            self._id = str(uuid.uuid4())
-        self._author = author
-        self._version = version
-        self._repository = repository
-
-        # Make sure date is properly parsed into a datetime object
-        self._date = None
-        self.date = date
-
-        # Enable setting of the file name from whence this document came.
-        # It is for knowing while processing and will not be serialized to a file.
-        self._origin_file_name = None
-
-    def __repr__(self):
-        return "Document %s {author = %s, %d sections}" % \
-               (self._version, self._author, len(self._sections))
-
-    @property
-    def oid(self):
-        """
-        The uuid for the document. Required for entity creation and comparison,
-        saving and loading.
-        """
-        return self.id
-
-    @property
-    def id(self):
-        """
-        The uuid for the document.
-        """
-        return self._id
-
-    def new_id(self, oid=None):
-        """
-        new_id sets the id of the current object to a RFC 4122 compliant UUID.
-        If an id was provided, it is assigned if it is RFC 4122 UUID format compliant.
-        If no id was provided, a new UUID is generated and assigned.
-        :param oid: UUID string as specified in RFC 4122.
-        """
-        if oid is not None:
-            self._id = str(uuid.UUID(oid))
-        else:
-            self._id = str(uuid.uuid4())
-
-    @property
-    def author(self):
-        """
-        The author of the document.
-        """
-        return self._author
-
-    @author.setter
-    def author(self, new_value):
-        if new_value == "":
-            new_value = None
-        self._author = new_value
-
-    @property
-    def version(self):
-        """
-        A personal version-specifier that can be used to track different
-        versions of the same document.
-        """
-        return self._version
-
-    @version.setter
-    def version(self, new_value):
-        if new_value == "":
-            new_value = None
-        self._version = new_value
-
-    @property
-    def date(self):
-        """
-        The date the document was created.
-        """
-        return self._date
-
-    @date.setter
-    def date(self, new_value):
-        if not new_value:
-            new_value = None
-        else:
-            new_value = dtypes.date_set(new_value)
-        self._date = new_value
-
-    @property
-    def parent(self):
-        """ The parent of a document is always None. """
-        return None
-
-    def finalize(self):
-        """
-        This needs to be called after the document is set up from parsing
-        it will perform additional operations, that need the complete document.
-        In particular, this method will resolve all *link* and *include*
-        attributes accordingly.
-        """
-        # We could not fill out links while parsing (referenced sections where
-        # not known), so try to set them now, where the document is complete
-
-        for sec in self.itersections(recursive=True):
-            if sec._link is not None:
-                sec.link = sec._link
-            if sec._include is not None:
-                sec.include = sec._include
-
-    @inherit_docstring
-    def get_terminology_equivalent(self):
-        if self.repository is None:
-            return None
-        term = terminology.load(self.repository)
-        return term
+/annex/objects/MD5-s5936--3cc26910383c87df99a03039dcb60da7

+ 1 - 253
code/python-odml/odml/dtypes.py

@@ -1,253 +1 @@
-import datetime as dt
-import re
-import sys
-
-from enum import Enum
-
-self = sys.modules[__name__].__dict__
-
-"""
-Provides functionality for validation of the data-types specified for odML
-"""
-
-try:
-    unicode = unicode
-except NameError:
-    unicode = str
-
-FORMAT_DATE = "%Y-%m-%d"
-FORMAT_DATETIME = "%Y-%m-%d %H:%M:%S"
-FORMAT_TIME = "%H:%M:%S"
-
-
-class DType(str, Enum):
-    string = 'string'
-    text = 'text'
-    int = 'int'
-    float = 'float'
-    url = 'url'
-    datetime = 'datetime'
-    date = 'date'
-    time = 'time'
-    boolean = 'boolean'
-    person = 'person'
-
-    def __str__(self):
-        return self.name
-
-
-def default_values(dtype):
-    dtype = dtype.lower()
-    default_dtype_value = {
-        'string': '',
-        'text': '',
-        'int': 0,
-        'float': 0.0,
-        'url': '',
-        'boolean': False
-    }
-
-    if dtype in default_dtype_value:
-        return default_dtype_value[dtype]
-
-    if dtype == 'datetime':
-        return dt.datetime.now().replace(microsecond=0)
-    if dtype == 'date':
-        return dt.datetime.now().date()
-    if dtype == 'time':
-        return dt.datetime.now().replace(microsecond=0).time()
-
-    return ''  # Maybe return None ?
-
-
-_dtype_map = {'str': 'string', 'bool': 'boolean'}
-
-
-def infer_dtype(value):
-    dtype = (type(value)).__name__
-    if dtype in _dtype_map:
-        dtype = _dtype_map[dtype]
-
-    if valid_type(dtype):
-        if dtype == 'string' and '\n' in value:
-            dtype = 'text'
-        return dtype
-
-    # If unable to infer a dtype of given value, return default as *string*
-    return 'string'
-
-
-def valid_type(dtype):
-    """
-    Checks if *dtype* is a valid odML value data type.
-    """
-    if dtype is None:
-        return True
-
-    if not isinstance(dtype, str) and not isinstance(dtype, unicode):
-        return False
-
-    dtype = dtype.lower()
-    if dtype in _dtype_map:
-        dtype = _dtype_map[dtype]
-
-    if hasattr(DType, dtype):
-        return True
-
-    # Check odML tuple dtype.
-    rexp = re.compile("^[1-9][0-9]*-tuple$")
-    if len(rexp.findall(dtype)) == 1:
-        return True
-
-    return False
-
-
-def get(string, dtype=None):
-    """
-    Convert *string* to the corresponding *dtype*
-    """
-    if not dtype:
-        return str_get(string)
-    # special case, as the count-number is included in the type-name
-    if dtype.endswith("-tuple"):
-        return tuple_get(string, int(dtype[:-6]))
-    return self.get(dtype + "_get", str_get)(string)
-
-
-def set(value, dtype=None):
-    """
-    Serialize a *value* of type *dtype* to a unicode string
-    """
-    if not dtype:
-        return str_set(value)
-    if dtype.endswith("-tuple"):
-        return tuple_set(value)
-    if sys.version_info > (3, 0):
-        if isinstance(value, str):
-            return str_set(value)
-    else:
-        if isinstance(value, (str, unicode)):
-            return str_set(value)
-    return self.get(dtype + "_set", str_set)(value)
-
-
-def int_get(string):
-    if string is None or string == "":
-        return default_values("int")
-
-    try:
-        return int(string)
-    except ValueError:
-        # convert to float first and then cast to int
-        return int(float(string))
-
-
-def float_get(string):
-    if string is None or string == "":
-        return default_values("float")
-
-    return float(string)
-
-
-def str_get(string):
-    # Do not stringify empty list or dict but make sure boolean False gets through.
-    if string in [None, "", [], {}]:
-        return default_values("string")
-
-    if sys.version_info < (3, 0):
-        return unicode(string)
-
-    return str(string)
-
-
-# Alias  str_set to str_get. Both perform same function.
-
-str_set = str_get
-string_get = str_get
-string_set = str_get
-
-
-def time_get(string):
-    if string is None or string == "":
-        return default_values("time")
-
-    if isinstance(string, dt.time):
-        return dt.datetime.strptime(string.strftime(FORMAT_TIME), FORMAT_TIME).time()
-
-    return dt.datetime.strptime(string, FORMAT_TIME).time()
-
-
-time_set = time_get
-
-
-def date_get(string):
-    if string is None or string == "":
-        return default_values("date")
-
-    if isinstance(string, dt.date):
-        return dt.datetime.strptime(string.isoformat(), FORMAT_DATE).date()
-
-    return dt.datetime.strptime(string, FORMAT_DATE).date()
-
-
-date_set = date_get
-
-
-def datetime_get(string):
-    if string is None or string == "":
-        return default_values("datetime")
-
-    if isinstance(string, dt.datetime):
-        return dt.datetime.strptime(string.strftime(FORMAT_DATETIME), FORMAT_DATETIME)
-
-    return dt.datetime.strptime(string, FORMAT_DATETIME)
-
-
-datetime_set = datetime_get
-
-
-def boolean_get(string):
-    if string in [None, "", [], {}]:
-        return default_values("boolean")
-
-    if isinstance(string, (unicode, str)):
-        string = string.lower()
-
-    truth = ["true", "1", True, "t"]  # be kind, spec only accepts True / False
-    if string in truth:
-        return True
-
-    false = ["false", "0", False, "f"]
-    if string in false:
-        return False
-
-    # disallow any values that cannot be interpreted as boolean.
-    raise ValueError
-
-# Alias boolean_set to boolean_get. Both perform same function.
-
-
-boolean_set = boolean_get
-bool_get = boolean_get
-bool_set = boolean_set
-
-
-def tuple_get(string, count=None):
-    """
-    Parse a tuple string like "(1024;768)" and return strings of the elements
-    """
-    if not string:
-        return None
-    string = string.strip()
-    assert string.startswith("(") and string.endswith(")")
-    string = string[1:-1]
-    res = [x.strip() for x in string.split(";")]
-    if count is not None:  # be strict
-        assert len(res) == count
-    return res
-
-
-def tuple_set(value):
-    if not value:
-        return None
-    return "(%s)" % ";".join(value)
+/annex/objects/MD5-s9563--d05c8bc6c111da69e5c6eb2740a9ed1a

+ 1 - 48
code/python-odml/odml/fileio.py

@@ -1,48 +1 @@
-import os
-from .tools.odmlparser import ODMLReader, ODMLWriter
-
-
-def load(filename, backend="xml", show_warnings=True):
-    """
-    Load an odML document from file.
-    :param filename: Path and filename from where the odML document
-                     is to be loaded and parsed.
-    :param backend: File format of the file containing the odML document.
-                    The default format is XML.
-    :param show_warnings: Toggle whether to print warnings to the command line.
-    :return: The parsed odML document.
-    """
-    if not os.path.exists(filename):
-        msg = "File \'%s\' was not found!" % \
-              (filename if len(filename) < 20 else "...%s" % filename[19:])
-        raise FileNotFoundError(msg)
-
-    reader = ODMLReader(backend, show_warnings)
-    return reader.from_file(filename)
-
-
-def save(obj, filename, backend="xml"):
-    """
-    Save an open odML document to file of a specified format.
-    :param obj: odML document do be saved.
-    :param filename: Filename and path where the odML document
-                     should be saved.
-    :param backend: Format in which the odML document is to be saved.
-                    The default format is XML.
-    """
-    writer = ODMLWriter(backend)
-    if "." not in filename.split(os.pathsep)[-1]:
-        filename = filename + ".%s" % backend
-    return writer.write_file(obj, filename)
-
-
-def display(obj, backend="xml"):
-    """
-    Print an open odML document to the command line, formatted in the
-    specified format.
-    :param obj: odML document to be displayed.
-    :param backend: Format in which the odML document is to be displayed.
-                    The default format is XML.
-    """
-    writer = ODMLWriter(backend)
-    print(writer.to_string(obj))
+/annex/objects/MD5-s1835--baf006f470aab66bb1d177cf8624adae

+ 1 - 191
code/python-odml/odml/format.py

@@ -1,191 +1 @@
-import sys
-
-from rdflib import Namespace
-
-import odml
-
-"""
-A module providing general format information
-and mappings of xml-attributes to their python class equivalents
-"""
-
-
-class Format(object):
-    _name = ""
-    _args = {}
-    _map = {}
-    _rev_map = None
-    _rdf_map = {}
-    _rdf_type = None
-    _ns = Namespace("https://g-node.org/projects/odml-rdf#")
-
-    @property
-    def name(self):
-        """Returns the name of the current odML format"""
-        return self._name
-
-    @property
-    def arguments(self):
-        """Returns all items in the current odML format argument dict"""
-        return self._args.items()
-
-    @property
-    def arguments_keys(self):
-        """Returns all keys of the current odML format argument dict"""
-        return self._args.keys()
-
-    def map(self, name):
-        """ Maps an odml name to a python name """
-        return self._map.get(name, name)
-
-    @property
-    def map_keys(self):
-        """Returns all keys of the current odML format map dict"""
-        return self._map.keys()
-
-    def rdf_map(self, name):
-        """ Maps a python name to a odml rdf namespace """
-        return self._rdf_map.get(name, name)
-
-    @property
-    def rdf_map_keys(self):
-        """Returns all keys of the current odML format RDF map dict"""
-        return self._rdf_map.keys()
-
-    @property
-    def rdf_map_items(self):
-        """Returns all items of the current odML format RDF map dict"""
-        return self._rdf_map.items()
-
-    @property
-    def rdf_type(self):
-        """ Return rdf type of an object """
-        return self._rdf_type
-
-    @staticmethod
-    def namespace():
-        """ Return current link to current odml namespace"""
-        return Format._ns
-
-    def revmap(self, name):
-        """ Maps a python name to an odml name """
-        if self._rev_map is None:
-            # create the reverse map only if requested
-            self._rev_map = {}
-            if sys.version_info < (3, 0):
-                for k, v in self._map.iteritems():
-                    self._rev_map[v] = k
-            else:
-                for k, v in self._map.items():
-                    self._rev_map[v] = k
-        return self._rev_map.get(name, name)
-
-    def __iter__(self):
-        """ Iterates each python property name """
-        for k in self._args:
-            yield self.map(k)
-
-    def create(self, *args, **kargs):
-        return getattr(odml, self.__class__.__name__)(*args, **kargs)
-
-
-class Property(Format):
-    _name = "property"
-    _ns = Format._ns
-    _rdf_type = _ns.Property
-    _args = {
-        'id': 0,
-        'name': 1,
-        'value': 0,
-        'unit': 0,
-        'definition': 0,
-        'dependency': 0,
-        'dependencyvalue': 0,
-        'uncertainty': 0,
-        'reference': 0,
-        'type': 0,
-        'value_origin': 0
-    }
-    _map = {
-        'dependencyvalue': 'dependency_value',
-        'type': 'dtype',
-        'id': 'oid',
-        'value': 'values'
-    }
-    _rdf_map = {
-        'id': _ns.hasId,
-        'name': _ns.hasName,
-        'definition': _ns.hasDefinition,
-        'dtype': _ns.hasDtype,
-        'unit': _ns.hasUnit,
-        'uncertainty': _ns.hasUncertainty,
-        'reference': _ns.hasReference,
-        'value': _ns.hasValue,
-        'value_origin': _ns.hasValueOrigin
-    }
-
-
-class Section(Format):
-    _name = "section"
-    _ns = Format._ns
-    _rdf_type = _ns.Section
-    _args = {
-        'id': 0,
-        'type': 1,
-        'name': 1,
-        'definition': 0,
-        'reference': 0,
-        'link': 0,
-        'repository': 0,
-        'section': 0,
-        'include': 0,
-        'property': 0
-    }
-    _map = {
-        'section': 'sections',
-        'property': 'properties',
-        'id': 'oid'
-    }
-    _rdf_map = {
-        'id': _ns.hasId,
-        'name': _ns.hasName,
-        'definition': _ns.hasDefinition,
-        'type': _ns.hasType,
-        'repository': _ns.hasTerminology,
-        'reference': _ns.hasReference,
-        'sections': _ns.hasSection,
-        'properties': _ns.hasProperty,
-    }
-
-
-class Document(Format):
-    _name = "odML"
-    _ns = Format._ns
-    _rdf_type = _ns.Document
-    _args = {
-        'id': 0,
-        'version': 0,
-        'author': 0,
-        'date': 0,
-        'section': 0,
-        'repository': 0,
-    }
-    _map = {
-        'section': 'sections',
-        'id': 'oid'
-    }
-    _rdf_map = {
-        'id': _ns.hasId,
-        'author': _ns.hasAuthor,
-        'date': _ns.hasDate,
-        'version': _ns.hasDocVersion,    # discuss about the changes to the data model
-        'repository': _ns.hasTerminology,
-        'sections': _ns.hasSection
-    }
-
-
-Document = Document()
-Section = Section()
-Property = Property()
-
-__all__ = [Document, Section, Property]
+/annex/objects/MD5-s5425--0dc295916c1aa0ef7273e3c275c25192

+ 1 - 16
code/python-odml/odml/info.json

@@ -1,16 +1 @@
-{
-  "VERSION": "1.4.2",
-  "FORMAT_VERSION": "1.1",
-  "AUTHOR": "Hagen Fritsch, Jan Grewe, Christian Kellner, Achilleas Koutsou, Michael Sonntag, Lyuba Zehl",
-  "COPYRIGHT": "(c) 2011-2018, German Neuroinformatics Node",
-  "CONTACT": "dev@g-node.org",
-  "HOMEPAGE": "https://github.com/G-Node/python-odml",
-  "CLASSIFIERS": [
-    "Programming Language :: Python :: 2",
-    "Programming Language :: Python :: 3",
-    "License :: OSI Approved :: BSD License",
-    "Development Status :: 5 - Production/Stable",
-    "Topic :: Scientific/Engineering",
-    "Intended Audience :: Science/Research"
-  ]
-}
+/annex/objects/MD5-s684--c41dcfeb8b13f9baff9830639fff5e0b

+ 1 - 15
code/python-odml/odml/info.py

@@ -1,15 +1 @@
-import os
-import json
-
-here = os.path.dirname(__file__)
-
-with open(os.path.join(here, "info.json")) as infofile:
-    infodict = json.load(infofile)
-
-VERSION = infodict["VERSION"]
-FORMAT_VERSION = infodict["FORMAT_VERSION"]
-AUTHOR = infodict["AUTHOR"]
-COPYRIGHT = infodict["COPYRIGHT"]
-CONTACT = infodict["CONTACT"]
-HOMEPAGE = infodict["HOMEPAGE"]
-CLASSIFIERS = infodict["CLASSIFIERS"]
+/annex/objects/MD5-s401--87927bd852f69209545a262ec439cdf6

+ 1 - 660
code/python-odml/odml/property.py

@@ -1,660 +1 @@
-# -*- coding: utf-8
-
-import uuid
-
-from . import base
-from . import dtypes
-from . import format as frmt
-from .tools.doc_inherit import inherit_docstring, allow_inherit_docstring
-
-
-@allow_inherit_docstring
-class BaseProperty(base.BaseObject):
-    """An odML Property"""
-    _format = frmt.Property
-
-    def __init__(self, name=None, values=None, parent=None, unit=None,
-                 uncertainty=None, reference=None, definition=None,
-                 dependency=None, dependency_value=None, dtype=None,
-                 value_origin=None, oid=None, value=None):
-        """
-        Create a new Property. If a value without an explicitly stated dtype
-        has been provided, the method will try to infer the value's dtype.
-        Example:
-        >>> p = Property("property1", "a string")
-        >>> p.dtype
-        >>> str
-        >>> p = Property("property1", 2)
-        >>> p.dtype
-        >>> int
-        >>> p = Property("prop", [2, 3, 4])
-        >>> p.dtype
-        >>> int
-        :param name: The name of the property.
-        :param values: Some data value, it can be a single value or
-                       a list of homogeneous values.
-        :param unit: The unit of the stored data.
-        :param uncertainty: The uncertainty (e.g. the standard deviation)
-                            associated with a measure value.
-        :param reference: A reference (e.g. an URL) to an external definition
-                          of the value.
-        :param definition: The definition of the property.
-        :param dependency: Another property this property depends on.
-        :param dependency_value: Dependency on a certain value.
-        :param dtype: The data type of the values stored in the property,
-                      if dtype is not given, the type is deduced from the values.
-                      Check odml.DType for supported data types.
-        :param value_origin: Reference where the value originated from e.g. a file name.
-        :param oid: object id, UUID string as specified in RFC 4122. If no id is provided,
-                   an id will be generated and assigned. An id has to be unique
-                   within an odML Document.
-        :param value: Legacy code to the 'values' attribute. If 'values' is provided,
-                      any data provided via 'value' will be ignored.
-        """
-        try:
-            if oid is not None:
-                self._id = str(uuid.UUID(oid))
-            else:
-                self._id = str(uuid.uuid4())
-        except ValueError as e:
-            print(e)
-            self._id = str(uuid.uuid4())
-
-        # Use id if no name was provided.
-        if not name:
-            name = self._id
-
-        self._parent = None
-        self._name = name
-        self._value_origin = value_origin
-        self._unit = unit
-        self._uncertainty = uncertainty
-        self._reference = reference
-        self._definition = definition
-        self._dependency = dependency
-        self._dependency_value = dependency_value
-
-        self._dtype = None
-        if dtypes.valid_type(dtype):
-            self._dtype = dtype
-        else:
-            print("Warning: Unknown dtype '%s'." % dtype)
-
-        self._values = []
-        self.values = values
-        if not values and (value or isinstance(value, bool)):
-            self.values = value
-
-        self.parent = parent
-
-    def __len__(self):
-        return len(self._values)
-
-    def __getitem__(self, key):
-        return self._values[key]
-
-    def __setitem__(self, key, item):
-        if int(key) < 0 or int(key) > self.__len__():
-            raise IndexError("odml.Property.__setitem__: key %i invalid for "
-                             "array of length %i" % (int(key), self.__len__()))
-        try:
-            val = dtypes.get(item, self.dtype)
-            self._values[int(key)] = val
-        except Exception:
-            raise ValueError("odml.Property.__setitem__:  passed value cannot be "
-                             "converted to data type \'%s\'!" % self._dtype)
-
-    def __repr__(self):
-        return "Property: {name = %s}" % self._name
-
-    @property
-    def oid(self):
-        """
-        The uuid for the property. Required for entity creation and comparison,
-        saving and loading.
-        """
-        return self.id
-
-    @property
-    def id(self):
-        """
-        The uuid for the property.
-        """
-        return self._id
-
-    def new_id(self, oid=None):
-        """
-        new_id sets the object id of the current object to an RFC 4122 compliant UUID.
-        If an id was provided, it is assigned if it is RFC 4122 UUID format compliant.
-        If no id was provided, a new UUID is generated and assigned.
-        :param oid: UUID string as specified in RFC 4122.
-        """
-        if oid is not None:
-            self._id = str(uuid.UUID(oid))
-        else:
-            self._id = str(uuid.uuid4())
-
-    @property
-    def name(self):
-        return self._name
-
-    @name.setter
-    def name(self, new_name):
-        if self.name == new_name:
-            return
-
-        curr_parent = self.parent
-        if hasattr(curr_parent, "properties") and new_name in curr_parent.properties:
-
-            raise KeyError("Object with the same name already exists!")
-
-        self._name = new_name
-
-    @property
-    def dtype(self):
-        """
-        The data type of the value. Check odml.DType for supported data types.
-        """
-        return self._dtype
-
-    @dtype.setter
-    def dtype(self, new_type):
-        """
-        If the data type of a property value is changed, it is tried
-        to convert existing values to the new type. If this doesn't work,
-        the change is refused. The dtype can always be changed, if
-        a Property does not contain values.
-        """
-        # check if this is a valid type
-        if not dtypes.valid_type(new_type):
-            raise AttributeError("'%s' is not a valid type." % new_type)
-        # we convert the value if possible
-        old_type = self._dtype
-        old_values = self._values
-        try:
-            self._dtype = new_type
-            self.values = old_values
-        except:
-            self._dtype = old_type  # If conversion failed, restore old dtype
-            raise ValueError("cannot convert from '%s' to '%s'" %
-                             (old_type, new_type))
-
-    @property
-    def parent(self):
-        """
-        The section containing this property.
-        """
-        return self._parent
-
-    @parent.setter
-    def parent(self, new_parent):
-        if new_parent is None and self._parent is None:
-            return
-        elif new_parent is None and self._parent is not None:
-            self._parent.remove(self)
-            self._parent = None
-        elif self._validate_parent(new_parent):
-            if self._parent is not None:
-                self._parent.remove(self)
-            self._parent = new_parent
-            self._parent.append(self)
-        else:
-            raise ValueError(
-                "odml.Property.parent: passed value is not of consistent type!"
-                "odml.Section expected")
-
-    @staticmethod
-    def _validate_parent(new_parent):
-        from odml.section import BaseSection
-        if isinstance(new_parent, BaseSection):
-            return True
-        return False
-
-    @property
-    def value(self):
-        """
-        Deprecated alias of 'values'. Will be removed with the next minor release.
-        """
-        print("The attribute 'value' is deprecated. Please use 'values' instead.")
-        return self.values
-
-    @value.setter
-    def value(self, new_value):
-        """
-        Deprecated alias of 'values'. Will be removed with the next minor release.
-
-        :param new_value: a single value or list of values.
-        """
-        print("The attribute 'value' is deprecated. Please use 'values' instead.")
-        self.values = new_value
-
-    def value_str(self, index=0):
-        """
-        Used to access typed data of the value at a specific
-        index position as a string.
-        """
-        return dtypes.set(self._values[index], self._dtype)
-
-    def _validate_values(self, values):
-        """
-        Method ensures that the passed value(s) can be cast to the
-        same dtype, i.e. that are associated with this property or the
-        inferred dtype of the first entry of the values list.
-
-        :param values: an iterable that contains the values.
-        """
-        for v in values:
-            try:
-                dtypes.get(v, self.dtype)
-            except Exception:
-                return False
-        return True
-
-    def _convert_value_input(self, new_value):
-        """
-        This method ensures, that the passed new value is a list.
-        If new_value is a string, it will convert it to a list of
-        strings if the new_value contains embracing brackets.
-
-        :return: list of new_value
-        """
-        if isinstance(new_value, str):
-            if new_value[0] == "[" and new_value[-1] == "]":
-                new_value = list(map(str.strip, new_value[1:-1].split(",")))
-            else:
-                new_value = [new_value]
-        elif isinstance(new_value, dict):
-            new_value = [str(new_value)]
-        elif hasattr(new_value, '__iter__') or hasattr(new_value, '__next__'):
-            new_value = list(new_value)
-        elif not isinstance(new_value, list):
-            new_value = [new_value]
-        else:
-            raise ValueError("odml.Property._convert_value_input: "
-                             "unsupported data type for values: %s" % type(new_value))
-        return new_value
-
-    @property
-    def values(self):
-        """
-        Returns the value(s) stored in this property. Method always returns a list
-        that is a copy (!) of the stored value. Changing this list will NOT change
-        the property.
-        For manipulation of the stored values use the append, extend, and direct
-        access methods (using brackets).
-
-        For example:
-        >>> p = odml.Property("prop", values=[1, 2, 3])
-        >>> print(p.values)
-        [1, 2, 3]
-        >>> p.values.append(4)
-        >>> print(p.values)
-        [1, 2, 3]
-
-        Individual values can be accessed and manipulated like this:
-        >>> print(p[0])
-        [1]
-        >>> p[0] = 4
-        >>> print(p[0])
-        [4]
-
-        The values can be iterated e.g. with a loop:
-        >>> for v in p.values:
-        >>>   print(v)
-        4
-        2
-        3
-        """
-        return list(self._values)
-
-    @values.setter
-    def values(self, new_value):
-        """
-        Set the values of the property discarding any previous information.
-        Method will try to convert the passed value to the dtype of
-        the property and raise a ValueError if not possible.
-
-        :param new_value: a single value or list of values.
-        """
-        # Make sure boolean value 'False' gets through as well...
-        if new_value is None or \
-                (isinstance(new_value, (list, tuple, str)) and len(new_value) == 0):
-            self._values = []
-            return
-
-        new_value = self._convert_value_input(new_value)
-
-        if self._dtype is None:
-            self._dtype = dtypes.infer_dtype(new_value[0])
-
-        if not self._validate_values(new_value):
-            raise ValueError("odml.Property.values: passed values are not of "
-                             "consistent type!")
-        self._values = [dtypes.get(v, self.dtype) for v in new_value]
-
-    @property
-    def value_origin(self):
-        return self._value_origin
-
-    @value_origin.setter
-    def value_origin(self, new_value):
-        if new_value == "":
-            new_value = None
-        self._value_origin = new_value
-
-    @property
-    def uncertainty(self):
-        return self._uncertainty
-
-    @uncertainty.setter
-    def uncertainty(self, new_value):
-        if new_value == "":
-            new_value = None
-
-        if new_value and not isinstance(new_value, (int, float)):
-            try:
-                new_value = float(new_value)
-            except ValueError:
-                raise ValueError("odml.Property.uncertainty: passed uncertainty '%s' "
-                                 "is not float or int." % new_value)
-
-        self._uncertainty = new_value
-
-    @property
-    def unit(self):
-        return self._unit
-
-    @unit.setter
-    def unit(self, new_value):
-        if new_value == "":
-            new_value = None
-        self._unit = new_value
-
-    @property
-    def reference(self):
-        return self._reference
-
-    @reference.setter
-    def reference(self, new_value):
-        if new_value == "":
-            new_value = None
-        self._reference = new_value
-
-    @property
-    def definition(self):
-        return self._definition
-
-    @definition.setter
-    def definition(self, new_value):
-        if new_value == "":
-            new_value = None
-        self._definition = new_value
-
-    @property
-    def dependency(self):
-        return self._dependency
-
-    @dependency.setter
-    def dependency(self, new_value):
-        if new_value == "":
-            new_value = None
-        self._dependency = new_value
-
-    @property
-    def dependency_value(self):
-        return self._dependency_value
-
-    @dependency_value.setter
-    def dependency_value(self, new_value):
-        if new_value == "":
-            new_value = None
-        self._dependency_value = new_value
-
-    def remove(self, value):
-        """
-        Remove a value from this property. Only the first encountered
-        occurrence of the passed in value is removed from the properties
-        list of values.
-        """
-        if value in self._values:
-            self._values.remove(value)
-
-    def get_path(self):
-        """
-        Return the absolute path to this object.
-        """
-        if not self.parent:
-            return "/"
-
-        return self.parent.get_path() + ":" + self.name
-
-    def clone(self, keep_id=False):
-        """
-        Clone this property to copy it independently to another document.
-        By default the id of the cloned object will be set to a different uuid.
-
-        :param keep_id: If this attribute is set to True, the uuid of the
-                        object will remain unchanged.
-        :return: The cloned property
-        """
-        obj = super(BaseProperty, self).clone()
-        obj._parent = None
-        obj.values = self._values
-        if not keep_id:
-            obj.new_id()
-
-        return obj
-
-    def merge_check(self, source, strict=True):
-        """
-        Checks whether a source Property can be merged with self as destination and
-        raises a ValueError if the values of source and destination are not compatible.
-        With parameter *strict=True* a ValueError is also raised, if any of the
-        attributes unit, definition, uncertainty, reference or value_origin and dtype
-        differ in source and destination.
-
-        :param source: an odML Property.
-        :param strict: If True, the attributes dtype, unit, uncertainty, definition,
-                       reference and value_origin of source and destination
-                       must be identical.
-        """
-        if not isinstance(source, BaseProperty):
-            raise ValueError("odml.Property.merge: odML Property required.")
-
-        # Catch unmerge-able values at this point to avoid
-        # failing Section tree merges which cannot easily be rolled back.
-        new_value = self._convert_value_input(source.values)
-        if not self._validate_values(new_value):
-            raise ValueError("odml.Property.merge: passed value(s) cannot "
-                             "be converted to data type '%s'!" % self._dtype)
-        if not strict:
-            return
-
-        if (self.dtype is not None and source.dtype is not None and
-                self.dtype != source.dtype):
-            raise ValueError("odml.Property.merge: src and dest dtypes do not match!")
-
-        if self.unit is not None and source.unit is not None and self.unit != source.unit:
-            raise ValueError("odml.Property.merge: "
-                             "src and dest units (%s, %s) do not match!" %
-                             (source.unit, self.unit))
-
-        if (self.uncertainty is not None and source.uncertainty is not None and
-                self.uncertainty != source.uncertainty):
-            raise ValueError("odml.Property.merge: "
-                             "src and dest uncertainty both set and do not match!")
-
-        if self.definition is not None and source.definition is not None:
-            self_def = ''.join(map(str.strip, self.definition.split())).lower()
-            other_def = ''.join(map(str.strip, source.definition.split())).lower()
-            if self_def != other_def:
-                raise ValueError("odml.Property.merge: "
-                                 "src and dest definitions do not match!")
-
-        if self.reference is not None and source.reference is not None:
-            self_ref = ''.join(map(str.strip, self.reference.lower().split()))
-            other_ref = ''.join(map(str.strip, source.reference.lower().split()))
-            if self_ref != other_ref:
-                raise ValueError("odml.Property.merge: "
-                                 "src and dest references are in conflict!")
-
-        if self.value_origin is not None and source.value_origin is not None:
-            self_ori = ''.join(map(str.strip, self.value_origin.lower().split()))
-            other_ori = ''.join(map(str.strip, source.value_origin.lower().split()))
-            if self_ori != other_ori:
-                raise ValueError("odml.Property.merge: "
-                                 "src and dest value_origin are in conflict!")
-
-    def merge(self, other, strict=True):
-        """
-        Merges the Property 'other' into self, if possible. Information
-        will be synchronized. By default the method will raise a ValueError when the
-        information in this property and the passed property are in conflict.
-
-        :param other: an odML Property.
-        :param strict: Bool value to indicate whether types should be implicitly converted
-               even when information may be lost. Default is True, i.e. no conversion,
-               and a ValueError will be raised if types or other attributes do not match.
-               If a conflict arises with strict=False, the attribute value of self will
-               be kept, while the attribute value of other will be lost.
-        """
-        if not isinstance(other, BaseProperty):
-            raise TypeError("odml.Property.merge: odml Property required.")
-
-        self.merge_check(other, strict)
-
-        if self.value_origin is None and other.value_origin is not None:
-            self.value_origin = other.value_origin
-        if self.uncertainty is None and other.uncertainty is not None:
-            self.uncertainty = other.uncertainty
-        if self.reference is None and other.reference is not None:
-            self.reference = other.reference
-        if self.definition is None and other.definition is not None:
-            self.definition = other.definition
-        if self.unit is None and other.unit is not None:
-            self.unit = other.unit
-
-        to_add = [v for v in other.values if v not in self._values]
-        self.extend(to_add, strict=strict)
-
-    def unmerge(self, other):
-        """
-        Stub that doesn't do anything for this class.
-        """
-        pass
-
-    def get_merged_equivalent(self):
-        """
-        Return the merged object (i.e. if the parent section is linked to another one,
-        return the corresponding property of the linked section) or None.
-        """
-        if self.parent is None or self.parent._merged is None:
-            return None
-
-        return self.parent._merged.contains(self)
-
-    @inherit_docstring
-    def get_terminology_equivalent(self):
-        if self._parent is None:
-            return None
-        sec = self._parent.get_terminology_equivalent()
-        if sec is None:
-            return None
-        try:
-            return sec.properties[self.name]
-        except KeyError:
-            return None
-
-    def extend(self, obj, strict=True):
-        """
-        Extend the list of values stored in this property by the passed values. Method
-        will raise a ValueError, if values cannot be converted to the current dtype.
-        One can also pass another Property to append all values stored in that one.
-        In this case units must match!
-
-        :param obj: single value, list of values or a Property.
-        :param strict: a Bool that controls whether dtypes must match. Default is True.
-        """
-        if isinstance(obj, BaseProperty):
-            if obj.unit != self.unit:
-                raise ValueError("odml.Property.extend: src and dest units (%s, %s) "
-                                 "do not match!" % (obj.unit, self.unit))
-            self.extend(obj.values)
-            return
-
-        if self.__len__() == 0:
-            self.values = obj
-            return
-
-        new_value = self._convert_value_input(obj)
-        if len(new_value) > 0 and strict and dtypes.infer_dtype(new_value[0]) != self.dtype:
-            raise ValueError("odml.Property.extend: "
-                             "passed value data type does not match dtype!")
-
-        if not self._validate_values(new_value):
-            raise ValueError("odml.Property.extend: passed value(s) cannot be converted "
-                             "to data type \'%s\'!" % self._dtype)
-        self._values.extend([dtypes.get(v, self.dtype) for v in new_value])
-
-    def append(self, obj, strict=True):
-        """
-        Append a single value to the list of stored values. Method will raise
-        a ValueError if the passed value cannot be converted to the current dtype.
-
-        :param obj: the additional value.
-        :param strict: a Bool that controls whether dtypes must match. Default is True.
-        """
-        # Ignore empty values before nasty stuff happens, but make sure
-        # 0 and False get through.
-        if obj in [None, "", [], {}]:
-            return
-
-        if not self.values:
-            self.values = obj
-            return
-
-        new_value = self._convert_value_input(obj)
-        if len(new_value) > 1:
-            raise ValueError("odml.property.append: Use extend to add a list of values!")
-
-        if len(new_value) > 0 and strict and dtypes.infer_dtype(new_value[0]) != self.dtype:
-            raise ValueError("odml.Property.append: "
-                             "passed value data type does not match dtype!")
-
-        if not self._validate_values(new_value):
-            raise ValueError("odml.Property.append: passed value(s) cannot be converted "
-                             "to data type \'%s\'!" % self._dtype)
-
-        self._values.append(dtypes.get(new_value[0], self.dtype))
-
-    def pprint(self, indent=2, max_length=80, current_depth=-1):
-        """
-        Pretty print method to visualize Properties and Section-Property trees.
-
-        :param indent: number of leading spaces for every child Property.
-        :param max_length: maximum number of characters printed in one line.
-        :param current_depth: number of hierarchical levels printed from the
-                              starting Section.
-        """
-        property_spaces = ""
-        prefix = ""
-        if current_depth >= 0:
-            property_spaces = " " * ((current_depth + 2) * indent)
-            prefix = "|-"
-
-        if self.unit is None:
-            value_string = str(self.values)
-        else:
-            value_string = "{}{}".format(self.values, self.unit)
-
-        p_len = len(property_spaces) + len(self.name) + len(value_string)
-        if p_len >= max_length - 4:
-            split_len = int((max_length - len(property_spaces)
-                             + len(self.name) - len(prefix))/2)
-            str1 = value_string[0: split_len]
-            str2 = value_string[-split_len:]
-            print(("{}{} {}: {} ... {}".format(property_spaces, prefix,
-                                               self.name, str1, str2)))
-        else:
-            print(("{}{} {}: {}".format(property_spaces, prefix, self.name,
-                                        value_string)))
+/annex/objects/MD5-s37033--4dc2967745ebb3301d92c973f9d799de

+ 1 - 0
code/python-odml/odml/rdf/__init__.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s0--d41d8cd98f00b204e9800998ecf8427e

+ 1 - 0
code/python-odml/odml/rdf/fuzzy_finder.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s8407--5c9d40ffab262a5aef09319a0f0d881b

+ 1 - 0
code/python-odml/odml/rdf/query_creator.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s12209--b497d612d29a4bc5d6c10c91682d955d

+ 1 - 0
code/python-odml/odml/resources/odml-ontology.ttl

@@ -0,0 +1 @@
+/annex/objects/MD5-s37003--647d0e9a80de7c0dc5ab11d88cea04aa

+ 1 - 0
code/python-odml/odml/resources/section_subclasses.yaml

@@ -0,0 +1 @@
+/annex/objects/MD5-s2182--3ad838aa28fd72b5f4acc5c59cdd8f19

+ 1 - 0
code/python-odml/odml/scripts/__init__.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s0--d41d8cd98f00b204e9800998ecf8427e

+ 0 - 127
code/python-odml/odml/scripts/odml_conversion.py

@@ -1,127 +0,0 @@
-"""odmlConversion
-
-odmlConversion searches for odML files within a provided SEARCHDIR
-and converts them to the newest odML format version.
-Original files will never be overwritten. New files will be
-written either to a new directory at the current or a specified
-location.
-
-Usage: odmlconversion [-r] [-o OUT] SEARCHDIR
-
-Arguments:
-    SEARCHDIR       Directory to search for odML files.
-
-Options:
-    -o OUT          Output directory. Must exist if specified.
-                    If not specified, output files will be
-                    written to the current directory.
-    -r              Search recursively. Directory structures
-                    will not be retained.
-    -h --help       Show this screen.
-    --version       Show version.
-"""
-
-import os
-import pathlib
-import sys
-import tempfile
-
-from docopt import docopt
-
-try:
-    from StringIO import StringIO
-except ImportError:
-    from io import StringIO
-
-import odml
-
-from odml.tools.version_converter import VersionConverter as VerConf
-
-try:
-    unicode = unicode
-except NameError:
-    unicode = str
-
-
-def run_conversion(file_list, output_dir, report, source_format="XML"):
-    """
-    Convert a list of odML files to the latest odML version.
-    :param file_list: list of files to be converted.
-    :param output_dir: Directory where odML files converted to
-                       the latest odML version will be saved.
-    :param report: Reporting StringIO.
-    :param source_format: Original file format of the odML source files.
-                          XML, JSON and YAML are supported, default is XML.
-    """
-    # Exceptions are kept as broad as possible to ignore any non-odML or
-    # invalid odML files and ensuring everything that can be will be converted.
-    for curr_file in file_list:
-        file_path = unicode(curr_file.absolute())
-        report.write("[Info] Handling file '%s'\n" % file_path)
-        # When loading the current file succeeds, it is
-        # a recent odML format file and can be ignored.
-        try:
-            odml.load(file_path, source_format)
-            report.write("[Info] Skip recent version file '%s'" % file_path)
-        except Exception as exc:
-            out_name = os.path.splitext(os.path.basename(file_path))[0]
-            outfile = os.path.join(output_dir, "%s_conv.xml" % out_name)
-            try:
-                VerConf(file_path).write_to_file(outfile, source_format)
-            except Exception as exc:
-                # Ignore files we cannot parse or convert
-                report.write("[Error] version converting file '%s': '%s'\n" %
-                             (file_path, exc))
-
-
-def main(args=None):
-    """
-    Convenience script to automatically convert odML files
-    within a directory (tree) to the newest file version.
-    Check the cli help for details.
-    :param args: Command line arguments
-    """
-    parser = docopt(__doc__, argv=args, version="0.1.0")
-
-    root = parser['SEARCHDIR']
-    if not os.path.isdir(root):
-        print(docopt(__doc__, "-h"))
-        exit(1)
-
-    # Handle all supported odML file formats.
-    if parser['-r']:
-        xfiles = list(pathlib.Path(root).rglob('*.odml'))
-        xfiles.extend(list(pathlib.Path(root).rglob('*.xml')))
-        jfiles = list(pathlib.Path(root).rglob('*.json'))
-        yfiles = list(pathlib.Path(root).rglob('*.yaml'))
-    else:
-        xfiles = list(pathlib.Path(root).glob('*.odml'))
-        xfiles.extend(list(pathlib.Path(root).glob('*.xml')))
-        jfiles = list(pathlib.Path(root).glob('*.json'))
-        yfiles = list(pathlib.Path(root).glob('*.yaml'))
-
-    out_root = os.getcwd()
-    if parser["-o"]:
-        if not os.path.isdir(parser["-o"]):
-            print("[Error] Could not find output directory '%s'" % parser["-o"])
-            exit(1)
-
-        out_root = parser["-o"]
-
-    out_dir = tempfile.mkdtemp(prefix="odmlconv_", dir=out_root)
-
-    # Use this monkeypatch reporter until there is a way
-    # to run the converters silently.
-    report = StringIO()
-    report.write("[Info] Files will be saved to '%s'\n" % out_dir)
-
-    run_conversion(xfiles, out_dir, report)
-    run_conversion(jfiles, out_dir, report, "JSON")
-    run_conversion(yfiles, out_dir, report, "YAML")
-
-    print(report.getvalue())
-    report.close()
-
-
-if __name__ == "__main__":
-    main(sys.argv[1:])

+ 1 - 0
code/python-odml/odml/scripts/odml_convert.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s4596--6592164ae4485243075e87b6a3565671

+ 1 - 156
code/python-odml/odml/scripts/odml_to_rdf.py

@@ -1,156 +1 @@
-"""odmlToRDF
-
-odmlToRDF searches for odML files within a provided SEARCHDIR
-and converts them to the newest odML format version and
-exports all found and resulting odML files to XML formatted RDF.
-Original files will never be overwritten. New files will be
-written either to a new directory at the current or a specified
-location.
-
-Usage: odmltordf [-r] [-o OUT] SEARCHDIR
-
-Arguments:
-    SEARCHDIR       Directory to search for odML files.
-
-Options:
-    -o OUT          Output directory. Must exist if specified.
-                    If not specified, output files will be
-                    written to the current directory.
-    -r              Search recursively. Directory structures
-                    will not be retained.
-    -h --help       Show this screen.
-    --version       Show version.
-"""
-
-import os
-import pathlib
-import sys
-import tempfile
-
-from docopt import docopt
-
-try:
-    from StringIO import StringIO
-except ImportError:
-    from io import StringIO
-
-import odml
-
-from odml.tools.odmlparser import ODMLReader, ODMLWriter
-from odml.tools.version_converter import VersionConverter as VerConf
-
-try:
-    unicode = unicode
-except NameError:
-    unicode = str
-
-
-def run_rdf_export(odml_file, export_dir):
-    """
-    Convert an odML file to an XML RDF file and
-    export it to an export directory with the
-    same name as the original file and a '.rdf' file
-    ending.
-    :param odml_file: odML file to be converted to RDF.
-    :param export_dir:
-    """
-    out_name = os.path.splitext(os.path.basename(odml_file))[0]
-    out_file = os.path.join(export_dir, "%s.rdf" % out_name)
-    doc = ODMLReader().from_file(odml_file)
-    ODMLWriter("RDF").write_file(doc, out_file)
-
-
-def run_conversion(file_list, output_dir, rdf_dir, report, source_format="XML"):
-    """
-    Convert a list of odML files to the latest odML version if required
-    and export all files to XML RDF files in a specified output directory.
-    :param file_list: list of files to be exported to RDF.
-    :param output_dir: Directory where odML files converted to
-                       the latest odML version will be saved.
-    :param rdf_dir: Directory where exported RDF files will be saved.
-    :param report: Reporting StringIO.
-    :param source_format: Original file format of the odML source files.
-                          XML, JSON and YAML are supported, default is XML.
-    """
-    # Exceptions are kept as broad as possible to ignore any non-odML or
-    # invalid odML files and ensuring everything that can be will be converted.
-    for curr_file in file_list:
-        file_path = unicode(curr_file.absolute())
-        report.write("[Info] Handling file '%s'\n" % file_path)
-        # When loading the current file succeeds, it is
-        # a recent odML format file and can be exported
-        # to RDF right away. Otherwise it needs to be
-        # converted to the latest odML version first.
-        try:
-            odml.load(file_path, source_format)
-            report.write("[Info] RDF conversion of '%s'\n" % file_path)
-            run_rdf_export(file_path, rdf_dir)
-        except Exception as exc:
-            out_name = os.path.splitext(os.path.basename(file_path))[0]
-            outfile = os.path.join(output_dir, "%s_conv.xml" % out_name)
-            try:
-                VerConf(file_path).write_to_file(outfile, source_format)
-                try:
-                    report.write("[Info] RDF conversion of '%s'\n" % outfile)
-                    run_rdf_export(outfile, rdf_dir)
-                except Exception as exc:
-                    report.write("[Error] converting '%s' to RDF: '%s'\n" %
-                                 (file_path, exc))
-            except Exception as exc:
-                # Ignore files we cannot parse or convert
-                report.write("[Error] version converting file '%s': '%s'\n" %
-                             (file_path, exc))
-
-
-def main(args=None):
-    """
-    Convenience script to automatically convert odML files
-    within a directory (tree) to RDF. Check the cli help
-    for details.
-    :param args: Command line arguments
-    """
-    parser = docopt(__doc__, argv=args, version="0.1.0")
-
-    root = parser['SEARCHDIR']
-    if not os.path.isdir(root):
-        print(docopt(__doc__, "-h"))
-        exit(1)
-
-    # Handle all supported odML file formats.
-    if parser['-r']:
-        xfiles = list(pathlib.Path(root).rglob('*.odml'))
-        xfiles.extend(list(pathlib.Path(root).rglob('*.xml')))
-        jfiles = list(pathlib.Path(root).rglob('*.json'))
-        yfiles = list(pathlib.Path(root).rglob('*.yaml'))
-    else:
-        xfiles = list(pathlib.Path(root).glob('*.odml'))
-        xfiles.extend(list(pathlib.Path(root).glob('*.xml')))
-        jfiles = list(pathlib.Path(root).glob('*.json'))
-        yfiles = list(pathlib.Path(root).glob('*.yaml'))
-
-    out_root = os.getcwd()
-    if parser["-o"]:
-        if not os.path.isdir(parser["-o"]):
-            print("[Error] Could not find output directory '%s'" % parser["-o"])
-            exit(1)
-
-        out_root = parser["-o"]
-
-    out_dir = tempfile.mkdtemp(prefix="odmlconv_", dir=out_root)
-    rdf_dir = tempfile.mkdtemp(prefix="odmlrdf_", dir=out_dir)
-
-    # Use this monkeypatch reporter until there is a way
-    # to run the converters silently.
-    report = StringIO()
-    report.write("[Info] Files will be saved to '%s'\n" % out_dir)
-
-    run_conversion(xfiles, out_dir, rdf_dir, report)
-    run_conversion(jfiles, out_dir, rdf_dir, report, "JSON")
-    run_conversion(yfiles, out_dir, rdf_dir, report, "YAML")
-
-    print(report.getvalue())
-    report.close()
-
-
-if __name__ == "__main__":
-    main(sys.argv[1:])
+/annex/objects/MD5-s5636--cdc74d8d3698e10f2d534d11ac99bd79

+ 1 - 0
code/python-odml/odml/scripts/odml_view.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s3582--610af96f561cea4e3c186385445de552

+ 1 - 640
code/python-odml/odml/section.py

@@ -1,640 +1 @@
-# -*- coding: utf-8
-import collections
-import uuid
-
-from . import base
-from . import format
-from . import terminology
-from .doc import BaseDocument
-# this is supposedly ok, as we only use it for an isinstance check
-from .property import BaseProperty
-# it MUST however not be used to create any Property objects
-from .tools.doc_inherit import inherit_docstring, allow_inherit_docstring
-
-
-@allow_inherit_docstring
-class BaseSection(base.Sectionable):
-    """ An odML Section """
-    type = None
-    reference = None  # the *import* property
-    _link = None
-    _include = None
-    _merged = None
-
-    _format = format.Section
-
-    def __init__(self, name=None, type=None, parent=None,
-                 definition=None, reference=None,
-                 repository=None, link=None, include=None, oid=None):
-
-        # Sets _sections Smartlist and _repository to None, so run first.
-        super(BaseSection, self).__init__()
-        self._props = base.SmartList(BaseProperty)
-
-        try:
-            if oid is not None:
-                self._id = str(uuid.UUID(oid))
-            else:
-                self._id = str(uuid.uuid4())
-        except ValueError as e:
-            print(e)
-            self._id = str(uuid.uuid4())
-
-        # Use id if no name was provided.
-        if not name:
-            name = self._id
-
-        self._parent = None
-        self._name = name
-        self._definition = definition
-        self._reference = reference
-        self._repository = repository
-        self._link = link
-        self._include = include
-
-        # this may fire a change event, so have the section setup then
-        self.type = type
-        self.parent = parent
-
-    def __repr__(self):
-        return "Section[%d|%d] {name = %s, type = %s, id = %s}" % (len(self._sections),
-                                                                   len(self._props),
-                                                                   self._name,
-                                                                   self.type,
-                                                                   self.id)
-
-    def __iter__(self):
-        """
-        Iterate over each section and property contained in this section
-        """
-        for section in self._sections:
-            yield section
-        for prop in self._props:
-            yield prop
-
-    def __len__(self):
-        """
-        Number of children (sections AND properties)
-        """
-        return len(self._sections) + len(self._props)
-
-    @property
-    def oid(self):
-        """
-        The uuid for the section. Required for entity creation and comparison,
-        saving and loading.
-        """
-        return self.id
-
-    @property
-    def id(self):
-        """
-        The uuid for the section.
-        """
-        return self._id
-
-    def new_id(self, oid=None):
-        """
-        new_id sets the id of the current object to a RFC 4122 compliant UUID.
-        If an id was provided, it is assigned if it is RFC 4122 UUID format compliant.
-        If no id was provided, a new UUID is generated and assigned.
-        :param oid: UUID string as specified in RFC 4122.
-        """
-        if oid is not None:
-            self._id = str(uuid.UUID(oid))
-        else:
-            self._id = str(uuid.uuid4())
-
-    @property
-    def name(self):
-        return self._name
-
-    @name.setter
-    def name(self, new_value):
-        if self.name == new_value:
-            return
-
-        curr_parent = self.parent
-        if hasattr(curr_parent, "sections") and new_value in curr_parent.sections:
-            raise KeyError("Object with the same name already exists!")
-
-        self._name = new_value
-
-    @property
-    def include(self):
-        """
-        The same as :py:attr:`odml.section.BaseSection.link`, except that
-        include specifies an arbitrary url instead of a local path within
-        the same document
-        """
-        return self._include
-
-    @include.setter
-    def include(self, new_value):
-        if self._link is not None:
-            raise TypeError("%s.include: You can either set link or include, "
-                            "but not both." % repr(self))
-
-        if not new_value:
-            self._include = None
-            self.clean()
-            return
-
-        if '#' in new_value:
-            url, path = new_value.split('#', 1)
-        else:
-            url, path = new_value, None
-
-        terminology.deferred_load(url)
-
-        if self.parent is None:
-            self._include = new_value
-            return
-
-        term = terminology.load(url)
-        new_section = term.get_section_by_path(
-            path) if path is not None else term.sections[0]
-
-        if self._include is not None:
-            self.clean()
-        self._include = new_value
-
-        # strict needs to be False, otherwise finalizing a document will
-        # basically always fail.
-        self.merge(new_section, strict=False)
-
-    @property
-    def link(self):
-        """
-        Specifies a softlink, i.e. a path within the document
-        When the merge()-method is called, the link will be resolved creating
-        according copies of the section referenced by the link attribute.
-        When the unmerge() method is called (happens when running clean())
-        the link is unresolved, i.e. all properties and sections that are
-        completely equivalent to the merged object will be removed.
-        (They will be restored accordingly when calling merge()).
-        When changing the *link* attribute, the previously merged section is
-        unmerged, and the new reference will be immediately resolved. To avoid
-        this side-effect, directly change the *_link* attribute.
-        """
-        return self._link
-
-    @link.setter
-    def link(self, new_value):
-        if self._include is not None:
-            raise TypeError("%s.link: You can either set link or include,"
-                            " but not both." % repr(self))
-
-        if self.parent is None:  # we cannot possibly know where the link goes
-            self._link = new_value
-            return
-
-        if not new_value:
-            self._link = None
-            self.clean()
-            return
-
-        # raises exception if path cannot be found
-        new_section = self.get_section_by_path(new_value)
-        if self._link is not None:
-            self.clean()
-        self._link = new_value
-
-        # strict needs to be False, otherwise finalizing a document will
-        # basically always fail.
-        self.merge(new_section, strict=False)
-
-    @property
-    def definition(self):
-        """ Name Definition of the section """
-        if hasattr(self, "_definition"):
-            return self._definition
-        else:
-            return None
-
-    @definition.setter
-    def definition(self, new_value):
-        if new_value == "":
-            new_value = None
-        self._definition = new_value
-
-    @definition.deleter
-    def definition(self):
-        del self._definition
-
-    @property
-    def reference(self):
-        return self._reference
-
-    @reference.setter
-    def reference(self, new_value):
-        if new_value == "":
-            new_value = None
-        self._reference = new_value
-
-    # API (public)
-    #
-    #  properties
-    @property
-    def properties(self):
-        """ The list of all properties contained in this section """
-        return self._props
-
-    @property
-    def props(self):
-        """ The list of all properties contained in this section;
-            NIXpy format style alias for 'properties'."""
-        return self._props
-
-    @property
-    def sections(self):
-        """ The list of all child-sections of this section """
-        return self._sections
-
-    @property
-    def parent(self):
-        """ The parent section, the parent document or None """
-        return self._parent
-
-    @parent.setter
-    def parent(self, new_parent):
-        if new_parent is None and self._parent is None:
-            return
-        elif new_parent is None and self._parent is not None:
-            self._parent.remove(self)
-            self._parent = None
-        elif self._validate_parent(new_parent):
-            if self._parent is not None:
-                self._parent.remove(self)
-            self._parent = new_parent
-            self._parent.append(self)
-        else:
-            raise ValueError(
-                "odml.Section.parent: passed value is not of consistent type!"
-                "\nodml.Document or odml.Section expected")
-
-    def _validate_parent(self, new_parent):
-        if isinstance(new_parent, BaseDocument) or \
-           isinstance(new_parent, BaseSection):
-            return True
-        return False
-
-    def get_repository(self):
-        """
-        Returns the repository responsible for this section,
-        which might not be the *repository* attribute, but may
-        be inherited from a parent section / the document
-        """
-        if self._repository is None and self.parent is not None:
-            return self.parent.get_repository()
-        return super(BaseSection, self).repository
-
-    @base.Sectionable.repository.setter
-    def repository(self, url):
-        base.Sectionable.repository.fset(self, url)
-
-    @inherit_docstring
-    def get_terminology_equivalent(self):
-        repo = self.get_repository()
-        if repo is None:
-            return None
-        term = terminology.load(repo)
-        if term is None:
-            return None
-        return term.find_related(type=self.type)
-
-    def get_merged_equivalent(self):
-        """
-        Return the merged object or None
-        """
-        return self._merged
-
-    def append(self, obj):
-        """
-        Method adds single Sections and Properties to the respective child-lists
-        of the current Section.
-
-        :param obj: Section or Property object.
-        """
-        if isinstance(obj, BaseSection):
-            self._sections.append(obj)
-            obj._parent = self
-        elif isinstance(obj, BaseProperty):
-            self._props.append(obj)
-            obj._parent = self
-        elif isinstance(obj, collections.Iterable) and not isinstance(obj, str):
-            raise ValueError("odml.Section.append: "
-                             "Use extend to add a list of Sections or Properties.")
-        else:
-            raise ValueError("odml.Section.append: "
-                             "Can only append Sections or Properties.")
-
-    def extend(self, obj_list):
-        """
-        Method adds Sections and Properties to the respective child-lists
-        of the current Section.
-
-        :param obj_list: Iterable containing Section and Property entries.
-        """
-        if not isinstance(obj_list, collections.Iterable):
-            raise TypeError("'%s' object is not iterable" % type(obj_list).__name__)
-
-        # Make sure only Sections and Properties with unique names will be added.
-        for obj in obj_list:
-            if not isinstance(obj, BaseSection) and not isinstance(obj, BaseProperty):
-                raise ValueError("odml.Section.extend: "
-                                 "Can only extend sections and properties.")
-
-            elif isinstance(obj, BaseSection) and obj.name in self.sections:
-                raise KeyError("odml.Section.extend: "
-                               "Section with name '%s' already exists." % obj.name)
-
-            elif isinstance(obj, BaseProperty) and obj.name in self.properties:
-                raise KeyError("odml.Section.extend: "
-                               "Property with name '%s' already exists." % obj.name)
-
-        for obj in obj_list:
-            self.append(obj)
-
-    def insert(self, position, obj):
-        """
-        Insert a Section or a Property at the respective child-list position.
-        A ValueError will be raised, if a Section or a Property with the same
-        name already exists in the respective child-list.
-
-        :param position: index at which the object should be inserted.
-        :param obj: Section or Property object.
-        """
-        if isinstance(obj, BaseSection):
-            if obj.name in self.sections:
-                raise ValueError("odml.Section.insert: "
-                                 "Section with name '%s' already exists." % obj.name)
-
-            self._sections.insert(position, obj)
-            obj._parent = self
-        elif isinstance(obj, BaseProperty):
-            if obj.name in self.properties:
-                raise ValueError("odml.Section.insert: "
-                                 "Property with name '%s' already exists." % obj.name)
-
-            self._props.insert(position, obj)
-            obj._parent = self
-        else:
-            raise ValueError("Can only insert sections and properties")
-
-    def remove(self, obj):
-        """
-        Remove a Section or a Property from the respective child-lists of the current
-        Section and sets the parent attribute of the handed in object to None.
-        Raises a ValueError if the object is not a Section or a Property or if
-        the object is not contained in the child-lists.
-
-        :param obj: Section or Property object.
-        """
-        if isinstance(obj, BaseSection):
-            self._sections.remove(obj)
-            obj._parent = None
-        elif isinstance(obj, BaseProperty):
-            self._props.remove(obj)
-            obj._parent = None
-        else:
-            raise ValueError("Can only remove sections and properties")
-
-    def clone(self, children=True, keep_id=False):
-        """
-        Clone this Section allowing to copy it independently
-        to another document. By default the id of any cloned
-        object will be set to a new uuid.
-
-        :param children: If True, also clone child sections and properties
-                         recursively.
-        :param keep_id: If this attribute is set to True, the uuids of the
-                        Section and all child objects will remain unchanged.
-        :return: The cloned Section.
-        """
-        obj = super(BaseSection, self).clone(children, keep_id)
-        if not keep_id:
-            obj.new_id()
-
-        obj._props = base.SmartList(BaseProperty)
-        if children:
-            for p in self._props:
-                obj.append(p.clone(keep_id))
-
-        return obj
-
-    def contains(self, obj):
-        """
-        If the child-lists of the current Section contain a Section with
-        the same *name* and *type* or a Property with the same *name* as
-        the provided object, the found Section or Property is returned.
-
-        :param obj: Section or Property object.
-        """
-        if isinstance(obj, BaseSection):
-            return super(BaseSection, self).contains(obj)
-
-        elif isinstance(obj, BaseProperty):
-            for i in self._props:
-                if obj.name == i.name:
-                    return i
-        else:
-            raise ValueError("odml.Section.contains:"
-                             "Section or Property object expected.")
-
-    def merge_check(self, source_section, strict=True):
-        """
-        Recursively checks whether a source Section and all its children can be merged
-        with self and all its children as destination and raises a ValueError if any of
-        the Section attributes definition and reference differ in source and destination.
-
-        :param source_section: an odML Section.
-        :param strict: If True, definition and reference attributes of any merged Sections
-                       as well as most attributes of merged Properties on the same
-                       tree level in source and destination have to be identical.
-        """
-        if strict and self.definition is not None and source_section.definition is not None:
-            self_def = ''.join(map(str.strip, self.definition.split())).lower()
-            other_def = ''.join(map(str.strip, source_section.definition.split())).lower()
-            if self_def != other_def:
-                raise ValueError(
-                    "odml.Section.merge: src and dest definitions do not match!")
-
-        if strict and self.reference is not None and source_section.reference is not None:
-            self_ref = ''.join(map(str.strip, self.reference.lower().split()))
-            other_ref = ''.join(map(str.strip, source_section.reference.lower().split()))
-            if self_ref != other_ref:
-                raise ValueError(
-                    "odml.Section.merge: src and dest references are in conflict!")
-
-        # Check all the way down the rabbit hole / Section tree.
-        for obj in source_section:
-            mine = self.contains(obj)
-            if mine is not None:
-                mine.merge_check(obj, strict)
-
-    def merge(self, section=None, strict=True):
-        """
-        Merges this section with another *section*.
-        See also: :py:attr:`odml.section.BaseSection.link`
-        If section is none, sets the link/include attribute (if _link or
-        _include are set), causing the section to be automatically merged
-        to the referenced section.
-
-        :param section: an odML Section. If section is None, *link* or *include*
-                        will be resolved instead.
-        :param strict: Bool value to indicate whether the attributes of affected
-                       child Properties except their ids and values have to be identical
-                       to be merged. Default is True.
-        """
-        if section is None:
-            # for the high level interface
-            if self._link is not None:
-                self.link = self._link
-            elif self._include is not None:
-                self.include = self._include
-            return
-
-        # Check all the way down the tree if the destination source and
-        # its children can be merged with self and its children since
-        # there is no rollback in case of a downstream merge error.
-        self.merge_check(section, strict)
-
-        if self.definition is None and section.definition is not None:
-            self.definition = section.definition
-        if self.reference is None and section.reference is not None:
-            self.reference = section.reference
-
-        for obj in section:
-            mine = self.contains(obj)
-            if mine is not None:
-                mine.merge(obj, strict)
-            else:
-                mine = obj.clone()
-                mine._merged = obj
-                self.append(mine)
-        self._merged = section
-
-    @inherit_docstring
-    def clean(self):
-        if self._merged is not None:
-            self.unmerge(self._merged)
-        super(BaseSection, self).clean()
-
-    def unmerge(self, section):
-        """
-        Clean up a merged section by removing objects that are totally equal
-        to the linked object
-        """
-        if self == section:
-            raise RuntimeError("cannot unmerge myself?")
-        removals = []
-        for obj in section:
-            mine = self.contains(obj)
-            if mine is None:
-                continue
-            if mine == obj:
-                removals.append(mine)
-            else:
-                mine.unmerge(obj)
-        for obj in removals:
-            self.remove(obj)
-
-        # The path may not be valid anymore, so make sure to update it
-        # however this does not reflect changes happening while the section
-        # is unmerged
-        if self._link is not None:
-            # TODO get_absolute_path, # TODO don't change if the section can
-            # still be reached using the old link
-            self._link = self.get_relative_path(section)
-
-        self._merged = None
-
-    @property
-    def is_merged(self):
-        """
-        Returns True if the section is merged with another one (e.g. through
-        :py:attr:`odml.section.BaseSection.link` or
-        :py:attr:`odml.section.BaseSection.include`)
-        The merged object can be accessed through the *_merged* attribute.
-        """
-        return self._merged is not None
-
-    @property
-    def can_be_merged(self):
-        """
-        Returns True if either a *link* or an *include* attribute is specified
-        """
-        return self._link is not None or self._include is not None
-
-    def _reorder(self, childlist, new_index):
-        l = childlist
-        old_index = l.index(self)
-
-        # 2 cases: insert after old_index / insert before
-        if new_index > old_index:
-            new_index += 1
-        l.insert(new_index, self)
-        if new_index < old_index:
-            del l[old_index + 1]
-        else:
-            del l[old_index]
-        return old_index
-
-    def reorder(self, new_index):
-        """
-        Move this object in its parent child-list to the position *new_index*.
-
-        :return: The old index at which the object was found.
-        """
-        if not self.parent:
-            raise ValueError("odml.Section.reorder: "
-                             "Section has no parent, cannot reorder in parent list.")
-
-        return self._reorder(self.parent.sections, new_index)
-
-    def create_property(self, name, value=None, dtype=None, oid=None):
-        """
-        Create a new property that is a child of this section.
-
-        :param name: The name of the property.
-        :param value: Some data value, it can be a single value or
-                      a list of homogeneous values.
-        :param dtype: The data type of the values stored in the property,
-                      if dtype is not given, the type is deduced from the values.
-                      Check odml.DType for supported data types.
-        :param oid: object id, UUID string as specified in RFC 4122. If no id
-                    is provided, an id will be generated and assigned.
-        :return: The new property.
-        """
-        prop = BaseProperty(name=name, value=value, dtype=dtype, oid=oid)
-        prop.parent = self
-
-        return prop
-
-    def pprint(self, indent=2, max_depth=1, max_length=80, current_depth=0):
-        """
-        Pretty print method to visualize Section-Property trees.
-
-        :param indent: number of leading spaces for every child Section or Property.
-        :param max_length: maximum number of characters printed in one line.
-        :param current_depth: number of hierarchical levels printed from the
-                              starting Section.
-        """
-        spaces = " " * (current_depth * indent)
-        sec_str = "{} {} [{}]".format(spaces, self.name, self.type)
-        print(sec_str)
-        for p in self.props:
-            p.pprint(current_depth=current_depth, indent=indent,
-                     max_length=max_length)
-        if max_depth == -1 or current_depth < max_depth:
-            for s in self.sections:
-                s.pprint(current_depth=current_depth+1, max_depth=max_depth,
-                         indent=indent, max_length=max_length)
-        elif max_depth == current_depth:
-            child_sec_indent = spaces + " " * indent
-            more_indent = spaces + " " * (current_depth + 2 * indent)
-            for s in self.sections:
-                print("{} {} [{}]\n{}[...]".format(child_sec_indent,
-                                                   s.name, s.type,
-                                                   more_indent))
+/annex/objects/MD5-s32926--5449f1c99d6acc7c36e9afb09b9d5ffa

+ 1 - 0
code/python-odml/odml/templates.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s6012--bdb37d6d7d8ded7f83b1376ebff1385e

+ 1 - 110
code/python-odml/odml/terminology.py

@@ -1,110 +1 @@
-"""
-Handles (deferred) loading of terminology data and access to it
-for odML documents
-"""
-
-import datetime
-import os
-import sys
-import tempfile
-import threading
-try:
-    import urllib.request as urllib2
-except ImportError:
-    import urllib2
-
-from hashlib import md5
-
-from .tools.parser_utils import ParserException
-from .tools.xmlparser import XMLReader
-
-
-REPOSITORY_BASE = 'http://portal.g-node.org/odml/terminologies'
-REPOSITORY = '/'.join([REPOSITORY_BASE, 'v1.1', 'terminologies.xml'])
-
-CACHE_AGE = datetime.timedelta(days=1)
-
-
-def cache_load(url):
-    """
-    Load the url and store it in a temporary cache directory
-    subsequent requests for this url will use the cached version
-    """
-    filename = '.'.join([md5(url.encode()).hexdigest(), os.path.basename(url)])
-    cache_dir = os.path.join(tempfile.gettempdir(), "odml.cache")
-    if not os.path.exists(cache_dir):
-        try:
-            os.makedirs(cache_dir)
-        except OSError:  # might happen due to concurrency
-            if not os.path.exists(cache_dir):
-                raise
-    cache_file = os.path.join(cache_dir, filename)
-    if not os.path.exists(cache_file) \
-       or datetime.datetime.fromtimestamp(os.path.getmtime(cache_file)) < \
-       datetime.datetime.now() - CACHE_AGE:
-        try:
-            data = urllib2.urlopen(url).read()
-            if sys.version_info.major > 2:
-                data = data.decode("utf-8")
-        except Exception as e:
-            print("failed loading '%s': %s" % (url, e))
-            return
-        fp = open(cache_file, "w")
-        fp.write(str(data))
-        fp.close()
-    return open(cache_file)
-
-
-class Terminologies(dict):
-    loading = {}
-
-    def load(self, url):
-        """
-        Load and cache a terminology-url
-
-        Returns the odml-document for the url
-        """
-        if url in self:
-            return self[url]
-
-        if url in self.loading:
-            self.loading[url].join()
-            self.loading.pop(url, None)
-            return self.load(url)
-
-        return self._load(url)
-
-    def _load(self, url):
-        # TODO also cache the data locally on disk
-        # if url.startswith("http"): return None
-        fp = cache_load(url)
-        if fp is None:
-            print("did not successfully load '%s'" % url)
-            return
-        try:
-            term = XMLReader(filename=url, ignore_errors=True).from_file(fp)
-            term.finalize()
-        except ParserException as e:
-            print("Failed to load %s due to parser errors" % url)
-            print(' "%s"' % e)
-            term = None
-        self[url] = term
-        return term
-
-    def deferred_load(self, url):
-        """
-        Start a thread to load the terminology in background
-        """
-        if url in self or url in self.loading:
-            return
-        self.loading[url] = threading.Thread(target=self._load, args=(url,))
-        self.loading[url].start()
-
-
-terminologies = Terminologies()
-load = terminologies.load
-deferred_load = terminologies.deferred_load
-
-
-if __name__ == "__main__":
-    f = cache_load(REPOSITORY)
+/annex/objects/MD5-s4260--c2365fb9eaf1ffef9cb5943c0fdbb046

+ 1 - 0
code/python-odml/odml/tools/__init__.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s187--e957b6e9eae71c9994572e44df8df823

+ 1 - 0
code/python-odml/odml/tools/converters/__init__.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s140--edaf263834389a66d1b0c68d42150a9f

+ 1 - 0
code/python-odml/odml/tools/converters/format_converter.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s8081--11715b31cf5acb27225a1f8cf7d17f91

+ 1 - 0
code/python-odml/odml/tools/converters/version_converter.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s20312--4faad32d6af2de5bc5fd3a71e1712b7d

+ 1 - 208
code/python-odml/odml/tools/dict_parser.py

@@ -1,208 +1 @@
-"""
-Dict parser converts the content of a dictionary
-into a proper and verified odML document.
-"""
-
-from .. import format as odmlfmt
-from ..info import FORMAT_VERSION
-from .parser_utils import InvalidVersionException, ParserException
-
-
-class DictWriter:
-    """
-    A writer to parse an odML document to a Python dictionary object equivalent.
-    """
-
-    def __init__(self):
-        self.doc = None  # odML document
-
-    def to_dict(self, odml_document):
-        self.doc = odml_document
-        parsed_doc = {}
-
-        for i in odmlfmt.Document.arguments_keys:
-            attr = i
-            if i in odmlfmt.Document.map_keys:
-                attr = odmlfmt.Document.map(i)
-
-            if hasattr(odml_document, attr):
-                if attr == 'sections':
-                    sections = self.get_sections(odml_document.sections)
-                    parsed_doc[attr] = sections
-                else:
-                    tag = getattr(odml_document, attr)
-
-                    if tag:
-                        # Always use the arguments key attribute name when saving
-                        parsed_doc[i] = tag
-
-        return parsed_doc
-
-    def get_sections(self, section_list):
-        section_seq = []
-
-        for section in section_list:
-            section_dict = {}
-
-            for i in odmlfmt.Section.arguments_keys:
-                attr = i
-
-                if i in odmlfmt.Section.map_keys:
-                    attr = odmlfmt.Section.map(i)
-
-                if hasattr(section, attr):
-                    if attr == 'properties':
-                        properties = self.get_properties(section.properties)
-                        section_dict[attr] = properties
-                    elif attr == 'sections':
-                        sections = self.get_sections(section.sections)
-                        section_dict[attr] = sections
-                    else:
-                        tag = getattr(section, attr)
-
-                        if tag:
-                            # Always use the arguments key attribute name when saving
-                            section_dict[i] = tag
-
-            section_seq.append(section_dict)
-
-        return section_seq
-
-    @staticmethod
-    def get_properties(props_list):
-        props_seq = []
-
-        for prop in props_list:
-            prop_dict = {}
-
-            for i in odmlfmt.Property.arguments_keys:
-                attr = i
-                if i in odmlfmt.Property.map_keys:
-                    attr = odmlfmt.Property.map(i)
-
-                if hasattr(prop, attr):
-                    tag = getattr(prop, attr)
-                    if isinstance(tag, tuple):
-                        prop_dict[attr] = list(tag)
-                    elif (tag == []) or tag:  # Even if 'values' is empty, allow '[]'
-                        # Custom odML tuples require special handling.
-                        if attr == "values" and prop.dtype and \
-                                prop.dtype.endswith("-tuple") and len(prop.values) > 0:
-                            prop_dict["value"] = "(%s)" % ";".join(prop.values[0])
-                        else:
-                            # Always use the arguments key attribute name when saving
-                            prop_dict[i] = tag
-
-            props_seq.append(prop_dict)
-
-        return props_seq
-
-
-class DictReader:
-    """
-    A reader to parse dictionaries with odML content into a proper odML document.
-    """
-
-    def __init__(self, show_warnings=True):
-        """
-        :param show_warnings: Toggle whether to print warnings to the command line.
-                              Any warnings can be accessed via the Reader's class
-                              warnings attribute after parsing is done.
-        """
-        self.parsed_doc = None  # Python dictionary object equivalent
-        self.show_warnings = show_warnings
-        self.warnings = []
-
-    def is_valid_attribute(self, attr, fmt):
-        if attr in fmt.arguments_keys:
-            return attr
-
-        if fmt.revmap(attr):
-            return attr
-
-        msg = "Invalid element <%s> inside <%s> tag" % (attr, fmt.__class__.__name__)
-        self.warnings.append(msg)
-        if self.show_warnings:
-            print(msg)
-        return None
-
-    def to_odml(self, parsed_doc):
-        self.parsed_doc = parsed_doc
-
-        # Parse only odML documents of supported format versions.
-        if 'Document' not in self.parsed_doc:
-            msg = "Missing root element 'Document'"
-            raise ParserException(msg)
-        elif 'odml-version' not in self.parsed_doc:
-            raise ParserException("Invalid odML document: Could not find odml-version.")
-
-        elif self.parsed_doc.get('odml-version') != FORMAT_VERSION:
-            msg = ("Cannot parse odML document with format version '%s'. \n"
-                   "\tUse the 'tools.VersionConverter' to import previous odML formats."
-                   % self.parsed_doc.get('odml-version'))
-            raise InvalidVersionException(msg)
-
-        self.parsed_doc = self.parsed_doc['Document']
-
-        doc_attrs = {}
-        doc_secs = []
-
-        for i in self.parsed_doc:
-            attr = self.is_valid_attribute(i, odmlfmt.Document)
-            if attr == 'sections':
-                doc_secs = self.parse_sections(self.parsed_doc['sections'])
-            elif attr:
-                # Make sure to always use the correct odml format attribute name
-                doc_attrs[odmlfmt.Document.map(attr)] = self.parsed_doc[i]
-
-        doc = odmlfmt.Document.create(**doc_attrs)
-        for sec in doc_secs:
-            doc.append(sec)
-
-        return doc
-
-    def parse_sections(self, section_list):
-        odml_sections = []
-
-        for section in section_list:
-            sec_attrs = {}
-            children_secs = []
-            sec_props = []
-
-            for i in section:
-                attr = self.is_valid_attribute(i, odmlfmt.Section)
-                if attr == 'properties':
-                    sec_props = self.parse_properties(section['properties'])
-                elif attr == 'sections':
-                    children_secs = self.parse_sections(section['sections'])
-                elif attr:
-                    # Make sure to always use the correct odml format attribute name
-                    sec_attrs[odmlfmt.Section.map(attr)] = section[attr]
-
-            sec = odmlfmt.Section.create(**sec_attrs)
-            for prop in sec_props:
-                sec.append(prop)
-
-            for child_sec in children_secs:
-                sec.append(child_sec)
-
-            odml_sections.append(sec)
-
-        return odml_sections
-
-    def parse_properties(self, props_list):
-        odml_props = []
-
-        for _property in props_list:
-            prop_attrs = {}
-
-            for i in _property:
-                attr = self.is_valid_attribute(i, odmlfmt.Property)
-                if attr:
-                    # Make sure to always use the correct odml format attribute name
-                    prop_attrs[odmlfmt.Property.map(attr)] = _property[attr]
-
-            prop = odmlfmt.Property.create(**prop_attrs)
-            odml_props.append(prop)
-
-        return odml_props
+/annex/objects/MD5-s13494--b61fb18bae01f93432d1871645503d9a

+ 1 - 31
code/python-odml/odml/tools/doc_inherit.py

@@ -1,31 +1 @@
-"""
-This is a working hack to provide inherited docstrings.
-The only other working way I tried would involve metaclasses.
-
-Each method to inherit a docstring is flagged using the @inherit_docstring
-decorator.
-
-The actual inheritance is done in the class decorator @allow_inherit_docstring,
-which uses the classes base-classes and its mro and copies the first docstring
-it finds.
-"""
-
-
-def allow_inherit_docstring(cls):
-    bases = cls.__bases__
-    for attr, attribute in cls.__dict__.items():
-        if hasattr(attribute, "inherit_docstring"):
-            if not attribute.__doc__:
-                for mro_cls in (mro_cls for base in bases
-                                for mro_cls in base.mro()
-                                if hasattr(mro_cls, attr)):
-                    doc = getattr(getattr(mro_cls, attr), '__doc__')
-                    if doc:
-                        attribute.__doc__ = doc
-                        break
-    return cls
-
-
-def inherit_docstring(obj):
-    obj.inherit_docstring = True
-    return obj
+/annex/objects/MD5-s1431--4320616a9e64e5af8e11fe3fc8ca6dbc

+ 1 - 47
code/python-odml/odml/tools/dumper.py

@@ -1,47 +1 @@
-"""
-Dumps odML-Structures
-"""
-from .xmlparser import to_csv
-
-
-def get_props(obj, props):
-    out = []
-    for p in props:
-        if hasattr(obj, p):
-            x = getattr(obj, p)
-            if x is not None:
-                if isinstance(x, list) or isinstance(x, tuple):
-                    out.append("%s=%s" % (p, to_csv(x)))
-                else:
-                    out.append("%s=%s" % (p, repr(x)))
-
-    return ", ".join(out)
-
-
-def dumpProperty(property, indent=1):
-    # TODO : (PEP8) Find a better way to split the following line
-    print("%*s:%s (%s)" % (indent, " ", property.name,
-          get_props(property, ["definition", "values", "uncertainty", "unit",
-                               "dtype", "value_reference", "dependency",
-                               "dependencyValue"])))
-
-
-def dumpSection(section, indent=1):
-    if section is None:
-        return
-
-    # TODO : (PEP8) Find a better way to split the following line
-    print("%*s*%s (%s)" % (indent, " ", section.name,
-          get_props(section, ["type", "definition", "link",
-                              "include", "repository"])))
-
-    for prop in section.properties:
-        dumpProperty(prop, indent + 1)
-
-    for sub in section.sections:
-        dumpSection(sub, indent * 2)
-
-
-def dumpDoc(doc):
-    for sec in doc:
-        dumpSection(sec)
+/annex/objects/MD5-s2138--62da2785edeb40ff88ba662fffe27d97

+ 0 - 150
code/python-odml/odml/tools/format_converter.py

@@ -1,150 +0,0 @@
-import argparse
-import os
-import re
-import sys
-
-import odml
-from .rdf_converter import RDFWriter
-from .version_converter import VersionConverter
-
-try:
-    unicode = unicode
-except NameError:
-    unicode = str
-
-
-class FormatConverter(object):
-
-    _conversion_formats = {
-        'v1_1': '.xml',
-        'odml': '.odml',
-        # rdflib version "4.2.2" serialization formats
-        'xml': '.rdf',
-        'pretty-xml': '.rdf',
-        'trix': '.rdf',
-        'n3': '.n3',
-        'turtle': '.ttl',
-        'ttl': '.ttl',
-        'ntriples': '.nt',
-        'nt': '.nt',
-        'nt11': '.nt',
-        'trig': '.trig',
-        'json-ld': '.jsonld'
-    }
-
-    @classmethod
-    def convert(cls, args=None):
-        """
-        Enable usage of the argparse for calling convert_dir(...)
-        Example:
-            1) >> python format_converter.py ./..path../input_dir v1_1 -out ./..path../output_dir -r
-            
-               Convert files from the path <./..path../input_dir> to .xml odml version 1.1,
-               writes them into <./..path../output_dir> including subdirectories 
-               and its files from the input path.
-            
-            2) >> python format_converter.py ./..path../input_dir odml
-            
-               Converts files from path <./..path../input_dir> to .odml,
-               writes them into <./..path../input_dir_odml> not including subdirectories.
-        """
-        parser = argparse.ArgumentParser(description="Convert directory with odml files to another format")
-        parser.add_argument("input_dir", help="Path to input directory")
-        parser.add_argument("result_format", choices=list(cls._conversion_formats),
-                            help="Format of output files")
-        parser.add_argument("-out", "--output_dir", help="Path for output directory")
-        parser.add_argument("-r", "--recursive", action="store_true",
-                            help="Enable converting files from subdirectories")
-        args = parser.parse_args(args)
-        r = True if args.recursive else False
-        cls.convert_dir(args.input_dir, args.output_dir, r, args.result_format)
-
-    @classmethod
-    def convert_dir(cls, input_dir, output_dir, parse_subdirs, res_format):
-        """
-        Convert files from given input directory to the specified res_format.
-        :param input_dir: Path to input directory
-        :param output_dir: Path for output directory. If None, new directory will be created on the same level as input
-        :param parse_subdirs: If True enable converting files from subdirectories
-        :param res_format: Format of output files. 
-                           Possible choices: "v1_1" (converts to version 1.1 from version 1 xml)
-                                             "odml" (converts to .odml from version 1.1 .xml files)
-                                             "turtle", "nt" etc. (converts to rdf formats from version 1.1 .odml files)
-                                             (see full list of rdf serializers in FormatConverter._conversion_formats)
-        """
-        if res_format not in cls._conversion_formats:
-            raise ValueError("Format for output files is incorrect. "
-                             "Please choose from the list: {}".format(cls._conversion_formats.keys()))
-
-        cls._check_input_output_directory(input_dir, output_dir)
-        input_dir = os.path.join(input_dir, '')
-
-        if output_dir is None:
-            input_dir_name = os.path.basename(os.path.dirname(input_dir))
-            root_dir = os.path.dirname(os.path.dirname(input_dir))  # find the directory that contains input_dir
-            output_dir_name = input_dir_name + "_" + res_format
-            output_dir = os.path.join(root_dir, output_dir_name)
-            cls._create_sub_directory(output_dir)
-
-        output_dir = os.path.join(output_dir, '')
-
-        if not parse_subdirs:
-            for file_name in os.listdir(input_dir):
-                if os.path.isfile(os.path.join(input_dir, file_name)):
-                    cls._convert_file(os.path.join(input_dir, file_name), os.path.join(output_dir, file_name),
-                                      res_format)
-        else:
-            for dir_path, dir_names, file_names in os.walk(input_dir):
-                for file_name in file_names:
-                    in_file_path = os.path.join(dir_path, file_name)
-                    out_dir = re.sub(r"" + input_dir, r"" + output_dir, dir_path)
-                    out_file_path = os.path.join(out_dir, file_name)
-                    cls._create_sub_directory(out_dir)
-                    cls._convert_file(in_file_path, out_file_path, res_format)
-
-    @classmethod
-    def _convert_file(cls, input_path, output_path, res_format):
-        """
-        Convert a file from given input_path to res_format.
-        """
-        if res_format == "v1_1":
-            VersionConverter(input_path).write_to_file(output_path)
-        elif res_format == "odml":
-            if not output_path.endswith(".odml"):
-                p, _ = os.path.splitext(output_path)
-                output_path = p + ".odml"
-            odml.save(odml.load(input_path), output_path)
-        elif res_format in cls._conversion_formats:
-            if not output_path.endswith(cls._conversion_formats[res_format]):
-                p, _ = os.path.splitext(output_path)
-                output_path = p + cls._conversion_formats[res_format]
-            RDFWriter(odml.load(input_path)).write_file(output_path, res_format)
-
-    @staticmethod
-    def _create_sub_directory(dir_path):
-        """
-        Creates the new directory to store the converted file.
-        """
-        if not os.path.isdir(dir_path):
-            os.makedirs(dir_path)
-
-    @staticmethod
-    def _check_input_output_directory(input_dir, output_dir):
-        """
-        Checks if provided directory is valid - not None, is directory and not a root folder in the File System 
-        if output dir was not provided.
-        Raise relevant exceptions.
-        """
-        if not input_dir or not os.path.isdir(input_dir):
-            raise ValueError("The path to input directory is not a valid path")
-
-        if output_dir is not None and not os.path.isdir(output_dir):
-            raise ValueError("The path to output directory is not a valid path")
-
-        if not output_dir:
-            if os.path.dirname(input_dir) == input_dir:
-                raise ValueError("The input directory cannot be a root folder of the File System if "
-                                 "output directory was not specified")
-
-if __name__ == "__main__":
-    FormatConverter.convert(sys.argv[1:])

+ 0 - 207
code/python-odml/odml/tools/fuzzy_finder.py

@@ -1,207 +0,0 @@
-from odml.tools.query_creator import QueryCreator, QueryParser, QueryParserFuzzy
-
-
-class FuzzyFinder(object):
-    """
-    FuzzyFinder tool for querying graph through 'fuzzy' queries. 
-    If the user do not know exact attributes and structure of the odML data model,
-    the finder executes multiple queries to better match the parameters and returns sets of triples.
-    """
-    def __init__(self, graph=None, q_params=None):
-        self.graph = graph
-        self.q_params = q_params
-        self.prepared_queries_list = []
-        self._subsets = []
-
-    def find(self, mode='fuzzy', graph=None, q_str=None, q_params=None):
-        # TODO warn users if they added non-odml attributes ('naming' instead of 'name' e.g.)
-        """
-        Apply set of queries to the graph and returns info that was retrieved from queries.
-        
-        :param mode:     define the type of parser which will be used for parsing parameters or queries.
-                         Please find our more info about concrete parsers in odml/tool/query_creator.py or tutorials.
-        :param graph:    graph object.
-        :param q_str:    query string which used in QueryCreator class.
-                         Example for QueryParser: doc(author:D. N. Adams) section(name:Stimulus) prop(name:Contrast, value:20, unit:%)
-                         Example for QueryParserFuzzy: "FIND sec(name) prop(type) HAVING Stimulus, Contrast"
-        :param q_params: dictionary object with set of parameters for a query
-                         Example for QueryParser: {'Sec': [('name', 'Stimulus')],
-                                                   'Doc': [('author', 'D. N. Adams')],
-                                                   'Prop': [('name', 'Contrast'), ('value':[20, 25]), ('unit':'%')]}
-                         Example for QueryParserFuzzy: {'Sec': ['name', 'type'],
-                                                        'Doc': ['author'],
-                                                        'Search': ['Stimulus', 'Contrast']}
-        :return:         string which contains set of triples.
-        """
-        if mode == 'fuzzy':
-            q_parser = QueryParserFuzzy()
-            pairs_generator = self._generate_parameters_pairs_fuzzy
-        elif mode == 'match':
-            q_parser = QueryParser()
-            pairs_generator = self._generate_parameters_pairs
-        else:
-            raise ValueError("Parameter mode can be either 'fuzzy' or 'match'")
-
-        self._validate_find_input_attributes(graph, q_str, q_params, q_parser)
-
-        self._generate_parameters_subsets(pairs_generator())
-
-        return self._output_query_results()
-
-    def _validate_find_input_attributes(self, graph, q_str, q_params, q_parser):
-        if not graph and not self.graph:
-            raise ValueError("Please provide a RDF graph")
-
-        if not self.graph:
-            self.graph = graph
-
-        if q_str and q_params:
-            raise ValueError("Please pass query parameters only as a string or a dict object")
-
-        if q_str:
-            self.q_params = q_parser.parse_query_string(q_str)
-        elif q_params:
-            self.q_params = q_params
-        else:
-            raise ValueError("Please pass query parameters either as a string or a dict object")
-
-    def _generate_parameters_pairs(self):
-        """
-        Example: {'Sec': [('name', 'some_name'), ('type', 'Stimulus')]}
-        :return: [('Sec', ('name', 'some_name')), ('Sec', ('type', 'Stimulus'))]
-        """
-        parameters_pairs = []
-        possible_keys = QueryCreator.possible_q_dict_keys
-        for key in possible_keys:
-            if key in self.q_params.keys():
-                object_attrs = self.q_params[key]
-                for object_attr in object_attrs:
-                    s = tuple([key, object_attr])
-                    parameters_pairs.append(s)
-        return parameters_pairs
-
-    def _generate_parameters_pairs_fuzzy(self):
-        """
-        Generates set of tuples matching search select and where parts of fuzzy finder query
-        from dictionary of parameters.
-        
-        Example:  {'Sec': ['name', 'type'],
-                   'Doc': ['author'],
-                   'Search': ['Stimulus', 'Contrast']} 
-        :return:  [('Sec', ('name', 'Stimulus')), ('Sec', ('name', 'Contrast')), 
-                   ('Sec', ('type', 'Stimulus')), ('Sec', ('name', 'Contrast')),
-                   ('Doc', ('author', 'Stimulus')), ('Doc', ('author', 'Contrast'))]
-        """
-        parameters_pairs = []
-        search_values = []
-        possible_keys = QueryCreator.possible_q_dict_keys
-        if 'Search' in self.q_params.keys():
-            search_values = self.q_params['Search']
-
-        for key in possible_keys:
-            if key in self.q_params.keys():
-                object_attrs = self.q_params[key]
-                for object_attr in object_attrs:
-                    for value in search_values:
-                        parameters_pairs.append(tuple([key, tuple([object_attr, value])]))
-        return parameters_pairs
-
-    def _generate_parameters_subsets(self, attrs):
-        """
-        Generates the set of parameters to create queries from specific to more broad ones.
-        """
-        self._subsets = []
-        if len(attrs) > 0:
-            self._subsets_util_dfs(0, [], self._subsets, sorted(attrs))
-
-        self._subsets.sort(key=len, reverse=True)
-
-    def _subsets_util_dfs(self, index, path, res, attrs):
-        """
-        Generates all subsets of attrs set using Depth-first search.
-        Example (with numbers for explicity: [1,2,3] -> [[1], [2], [3], [1,2], [1,3], [2,3], [1,2,3]]
-        
-        :param index: help index for going through list.
-        :param path:  array for saving subsets.
-        :param res:   result subset.
-        :param attrs: input list of attrs e.g. [('Sec', ('name', 'some_name')), ('Sec', ('type', 'Stimulus'))]
-        """
-        if path:
-            res.append(path)
-        for i in range(index, len(attrs)):
-            if self._check_duplicate_attrs(path, attrs[i]):
-                self._subsets_util_dfs(i + 1, path + [attrs[i]], res, attrs)
-
-    @staticmethod
-    def _check_duplicate_attrs(attrs_list, attr):
-        for i in attrs_list:
-            if attr[1][0] == i[1][0]:
-                return False
-        return True
-
-    def _output_query_results(self):
-        output_triples_string = ""
-        # TODO define when we want to stop loop, influence factors(time, previous result etc.)
-        for query in self._subsets:
-            # FIXME we do need really need to have QueryCreator object
-            # put it here to write initial query to output string for explicity
-            creator = self._prepare_query(query)
-            q = creator.get_query()
-
-            triples = self._execute_query(q)
-            if triples:
-                output_triples_string += creator.query
-                output_triples_string += triples
-                output_triples_string += '\n'
-
-        return output_triples_string
-
-    def _execute_query(self, query):
-        """
-        Execute prepared query on the graph.
-        
-        :param query: prepared query object
-        :return: string with output triples
-        """
-        output_string = ""
-        for row in self.graph.query(query):
-            row_string = self._build_output_str(row)
-            output_string += row_string
-        return output_string
-
-    @staticmethod
-    def _build_output_str(row):
-        """
-        Build output string depending on the query variables.
-        
-        :param row: rdflib query row.
-        :return: string with values.
-        """
-        out_str = ""
-        possible_vars = QueryCreator.possible_query_variables
-
-        for v in possible_vars.keys():
-            try:
-                val = getattr(row, v)
-                out_str += '{0}: {1}\n'.format(possible_vars[v], val)
-            except AttributeError:
-                pass
-        return out_str
-
-    @staticmethod
-    def _prepare_query(args):
-        """
-        Return a query for given parameters.
-        
-        :param args: dict with list of odML object attributes for creation query
-                     Example: {'Sec': [('name', 'some_name'), ('type', 'Stimulus')]}
-        :return: QueryCreator object.
-        """
-        q_params = {}
-        for arg in args:
-            if arg[0] in q_params:
-                q_params[arg[0]].append(arg[1])
-            else:
-                q_params[arg[0]] = [arg[1]]
-        creator = QueryCreator(q_params)
-        return creator

+ 1 - 199
code/python-odml/odml/tools/odmlparser.py

@@ -1,199 +1 @@
-#!/usr/bin/env python
-"""
-A generic odML parsing module.
-
-Parses odML files and documents.
-"""
-
-import datetime
-import json
-import sys
-import yaml
-
-from os.path import basename
-
-from . import xmlparser
-from .dict_parser import DictWriter, DictReader
-from ..info import FORMAT_VERSION
-from .parser_utils import ParserException
-from .parser_utils import SUPPORTED_PARSERS
-from .rdf_converter import RDFReader, RDFWriter
-from ..validation import Validation
-
-try:
-    unicode = unicode
-except NameError:
-    unicode = str
-
-
-class ODMLWriter:
-    """
-        A generic odML document writer, for XML, YAML and JSON.
-
-        Usage:
-            xml_writer = ODMLWriter(parser='XML')
-            xml_writer.write_file(odml_document, filepath)
-    """
-
-    def __init__(self, parser='XML'):
-        self.parsed_doc = None  # Python dictionary object equivalent
-        parser = parser.upper()
-
-        if parser not in SUPPORTED_PARSERS:
-            raise NotImplementedError("'%s' odML parser does not exist!" % parser)
-
-        self.parser = parser
-
-    def write_file(self, odml_document, filename):
-        # Write document only if it does not contain validation errors.
-        validation = Validation(odml_document)
-        msg = ""
-        for err in validation.errors:
-            if err.is_error:
-                msg += "\n\t- %s %s: %s" % (err.obj, err.rank, err.msg)
-        if msg != "":
-            msg = "Resolve document validation errors before saving %s" % msg
-            raise ParserException(msg)
-
-        with open(filename, 'w') as file:
-            # Add XML header to support odML stylesheets.
-            if self.parser == 'XML':
-                file.write(xmlparser.XMLWriter.header)
-
-            file.write(self.to_string(odml_document))
-
-    def to_string(self, odml_document):
-        string_doc = ''
-
-        if self.parser == 'XML':
-            string_doc = unicode(xmlparser.XMLWriter(odml_document))
-        elif self.parser == "RDF":
-            # Use turtle as default output format for now.
-            string_doc = RDFWriter(odml_document).get_rdf_str("xml")
-        else:
-            self.parsed_doc = DictWriter().to_dict(odml_document)
-
-            odml_output = {'Document': self.parsed_doc,
-                           'odml-version': FORMAT_VERSION}
-
-            if self.parser == 'YAML':
-                string_doc = yaml.dump(odml_output, default_flow_style=False)
-            elif self.parser == 'JSON':
-                string_doc = json.dumps(odml_output, indent=4,
-                                        cls=JSONDateTimeSerializer)
-
-        if sys.version_info.major < 3:
-            string_doc = string_doc.encode("utf-8")
-
-        return string_doc
-
-
-# Required to serialize datetime values with JSON.
-class JSONDateTimeSerializer(json.JSONEncoder):
-    def default(self, o):
-        if isinstance(o, (datetime.datetime, datetime.date, datetime.time)):
-            return str(o)
-
-        return json.JSONEncoder.default(self, o)
-
-
-class ODMLReader:
-    """
-    A reader to parse odML files or strings into odml documents,
-    based on the given data exchange format, like XML, YAML, JSON or RDF.
-
-    Usage:
-        yaml_odml_doc = ODMLReader(parser='YAML').from_file("odml_doc.yaml")
-        json_odml_doc = ODMLReader(parser='JSON').from_file("odml_doc.json")
-    """
-
-    def __init__(self, parser='XML', show_warnings=True):
-        """
-        :param parser: odml parser; supported are 'XML', 'JSON', 'YAML' and 'RDF'.
-        :param show_warnings: Toggle whether to print warnings to the command line.
-        """
-        self.doc = None  # odML document
-        self.parsed_doc = None  # Python dictionary object equivalent
-        parser = parser.upper()
-        if parser not in SUPPORTED_PARSERS:
-            raise NotImplementedError("'%s' odML parser does not exist!" % parser)
-        self.parser = parser
-        self.show_warnings = show_warnings
-        self.warnings = []
-
-    def from_file(self, file, doc_format=None):
-
-        if self.parser == 'XML':
-            par = xmlparser.XMLReader(ignore_errors=True,
-                                      show_warnings=self.show_warnings)
-            self.warnings = par.warnings
-            self.doc = par.from_file(file)
-            return self.doc
-
-        elif self.parser == 'YAML':
-            with open(file) as yaml_data:
-                try:
-                    self.parsed_doc = yaml.load(yaml_data)
-                except yaml.parser.ParserError as err:
-                    print(err)
-                    return
-
-            par = DictReader(show_warnings=self.show_warnings)
-            self.doc = par.to_odml(self.parsed_doc)
-            # Provide original file name via the in memory document
-            self.doc._origin_file_name = basename(file)
-            return self.doc
-
-        elif self.parser == 'JSON':
-            with open(file) as json_data:
-                try:
-                    self.parsed_doc = json.load(json_data)
-                except ValueError as err:  # Python 2 does not support JSONDecodeError
-                    print("JSON Decoder Error: %s" % err)
-                    return
-
-            par = DictReader(show_warnings=self.show_warnings)
-            self.doc = par.to_odml(self.parsed_doc)
-            # Provide original file name via the in memory document
-            self.doc._origin_file_name = basename(file)
-            return self.doc
-
-        elif self.parser == 'RDF':
-            if not doc_format:
-                raise ValueError("Format of the rdf file was not specified")
-
-            self.doc = RDFReader().from_file(file, doc_format)
-            return self.doc
-
-    def from_string(self, string, doc_format=None):
-
-        if self.parser == 'XML':
-            self.doc = xmlparser.XMLReader().from_string(string)
-            return self.doc
-
-        elif self.parser == 'YAML':
-            try:
-                self.parsed_doc = yaml.load(string)
-            except yaml.parser.ParserError as err:
-                print(err)
-                return
-
-            self.doc = DictReader().to_odml(self.parsed_doc)
-            return self.doc
-
-        elif self.parser == 'JSON':
-            try:
-                self.parsed_doc = json.loads(string)
-            except ValueError as err:  # Python 2 does not support JSONDecodeError
-                print("JSON Decoder Error: %s" % err)
-                return
-
-            self.doc = DictReader().to_odml(self.parsed_doc)
-            return self.doc
-
-        elif self.parser == 'RDF':
-            if not doc_format:
-                raise ValueError("Format of the rdf file was not specified")
-
-            self.doc = RDFReader().from_string(string, doc_format)
-            return self.doc
+/annex/objects/MD5-s11656--e4d1f8e39dd2e024eb6d4ee6570b18e2

+ 1 - 20
code/python-odml/odml/tools/parser_utils.py

@@ -1,20 +1 @@
-"""
-Utility file to provide constants, exceptions and functions
-commonly used by the odML tools parsers and converters.
-"""
-
-SUPPORTED_PARSERS = ['XML', 'YAML', 'JSON', 'RDF']
-
-
-class ParserException(Exception):
-    """
-    Exception wrapper used by various odML parsers.
-    """
-    pass
-
-
-class InvalidVersionException(ParserException):
-    """
-    Exception wrapper to indicate a non-compatible odML version.
-    """
-    pass
+/annex/objects/MD5-s1427--5b291791192c77d0d1730905aaf8c275

+ 0 - 284
code/python-odml/odml/tools/query_creator.py

@@ -1,284 +0,0 @@
-import re
-from abc import ABCMeta, abstractmethod
-
-from rdflib import Namespace, RDF
-from rdflib.plugins.sparql import prepareQuery
-
-from ..format import Document
-from ..format import Property
-from ..format import Section
-
-
-class BaseQueryCreator:
-
-    __metaclass__ = ABCMeta
-
-    possible_query_variables = {'d': 'Document', 's': 'Section',
-                                'p': 'Property', 'v': 'Bag URI', 'value': 'Value'}
-
-    possible_q_dict_keys = ['Doc', 'Sec', 'Prop']
-
-    def __init__(self, q_dict=None):
-        """
-        :param q_dict: dictionary with query parameters
-        """
-        self.q_dict = q_dict if q_dict else {}
-        self.query = ''
-        super(BaseQueryCreator, self).__init__()
-
-    @abstractmethod
-    def get_query(self, q_str, q_parser):
-        pass
-    
-    @abstractmethod
-    def _prepare_query(self):
-        pass
-
-
-class BaseQueryParser:
-
-    __metaclass__ = ABCMeta
-
-    def __init__(self):
-        self.q_dict = {}
-
-    @abstractmethod
-    def parse_query_string(self, q_str):
-        pass
-
-
-class QueryParserFuzzy(BaseQueryParser):
-
-    def __init__(self):
-        super(QueryParserFuzzy, self).__init__()
-
-    def parse_query_string(self, q_str):
-        """
-        Parse query string and returns dict object with parameters.
-        :param q_str: query string.
-                      Example: FIND sec(name, type) prop(type) HAVING Stimulus, Contrast
-        :return: dict object.
-                 Example: {'Sec': ['name', 'type'],
-                           'Doc': ['author'],
-                           'Search': ['Stimulus', 'Contrast']}
-        """
-        self.q_dict = {}
-        find_pattern = re.compile("FIND(.*?)HAVING")
-        find_group = re.search(find_pattern, q_str).group(1).strip()
-        if find_group:
-            self._parse_find(find_group)
-
-        having_pattern = re.compile("HAVING(.*)")
-        having_group = re.search(having_pattern, q_str).group(1).strip()
-        if having_group:
-            if 'Search' in self.q_dict.keys():
-                raise ValueError('Search values are already parsed')
-            self._parse_having(having_group)
-        else:
-            raise ValueError('Search values in having part were not specified')
-
-        return self.q_dict
-
-    def _parse_find(self, find_part):
-        """
-        Parses find string part into list of specific keys to whih search values would be apllied
-        e.g. 'sec(name, type) prop(name)' into {'Sec': ['name', 'type'], 'Prop': ['name']} .
-        
-        :param find_part: string which represent list of searchable odML data model objects 
-                            like document(doc), sections(sec) or properties(prop).
-                            e.g. 'sec(name, type) prop(name)'
-        """
-        doc_pattern = re.compile("(doc|document)\(.*?\)")
-        doc = re.search(doc_pattern, find_part)
-        if doc:
-            self._parse_doc(doc)
-
-        sec_pattern = re.compile("(sec|section)\(.*?\)")
-        sec = re.search(sec_pattern, find_part)
-        if sec:
-            self._parse_sec(sec)
-
-        prop_pattern = re.compile("(prop|property)\(.*?\)")
-        prop = re.search(prop_pattern, find_part)
-        if prop:
-            self._parse_prop(prop)
-
-    def _parse_doc(self, doc):
-        p = re.compile("[\(|, ](id|author|date|version|repository|sections)[\)|,]")
-        if doc:
-            self.q_dict['Doc'] = re.findall(p, doc.group(0))
-
-    def _parse_sec(self, sec):
-        p = re.compile("[\(|, ](id|name|definition|type|repository|reference|sections|properties)[\)|,]")
-        if sec:
-            self.q_dict['Sec'] = re.findall(p, sec.group(0))
-
-    def _parse_prop(self, prop):
-        p = re.compile("[\(|, ](id|name|definition|dtype|unit|uncertainty|reference|value_origin)[\)|,]")
-        if prop:
-            self.q_dict['Prop'] = re.findall(p, prop.group(0))
-
-    def _parse_having(self, having_part):
-        """
-        Parses search value string into list of specific values 
-        e.g. 'Stimulus, Contrast, Date' into list [Stimulus, Contrast, Date].
-        
-        :param having_part: string with search values, e.g. 'Stimulus, Contrast'
-                      Also spaces errors in the string like 'Stimulus,    ,  Contrast' will be ignored.
-        """
-        search_values_list = []
-        search_params = re.compile("(.*?)(?:,|$)")
-        if having_part:
-            search_values = re.findall(search_params, having_part)
-            for v in search_values:
-                if v.strip():
-                    search_values_list.append(v.strip())
-        self.q_dict['Search'] = search_values_list
-
-
-class QueryParser(BaseQueryParser):
-
-    def __init__(self):
-        super(QueryParser, self).__init__()
-
-    def parse_query_string(self, q_str):
-        """
-        :param q_str: query string
-                      Example: doc(author:D. N. Adams) section(name:Stimulus) prop(name:Contrast, value:20, unit:%)
-        :return: dict object
-                 Example: {'Sec': [('name', 'Stimulus')],
-                           'Doc': [('author', 'D. N. Adams')],
-                           'Prop': [('name', 'Contrast'), ('value':[20]), ('unit':'%')]}
-        """
-        doc_pattern = re.compile("(doc|document)\(.*?\)")
-        doc = re.search(doc_pattern, q_str)
-        if doc:
-            self._parse_doc(doc)
-
-        sec_pattern = re.compile("(sec|section)\(.*?\)")
-        sec = re.search(sec_pattern, q_str)
-        if sec:
-            self._parse_sec(sec)
-
-        prop_pattern = re.compile("(prop|property)\(.*?\)")
-        prop = re.search(prop_pattern, q_str)
-        if prop:
-            self._parse_prop(prop)
-        
-        return self.q_dict
-
-    def _parse_doc(self, doc):
-        p = re.compile("[, |\(](id|author|date|version|repository|sections):(.*?)[,|\)]")
-        if doc:
-            self.q_dict['Doc'] = re.findall(p, doc.group(0))
-
-    def _parse_sec(self, sec):
-        p = re.compile("[, |\(](id|name|definition|type|repository|reference|sections|properties):(.*?)[,|\)]")
-        if sec:
-            self.q_dict['Sec'] = re.findall(p, sec.group(0))
-
-    def _parse_prop(self, prop):
-        p = re.compile("[, |\(](id|name|definition|dtype|unit|uncertainty|reference|value_origin):(.*?)[,|\)]")
-        if prop:
-            self.q_dict['Prop'] = re.findall(p, prop.group(0))
-
-            p_value = re.compile("value:\[(.*)]")
-
-            value_group = re.findall(p_value, prop.group(0))
-            if value_group:
-                values = re.split(", ?", value_group[0])
-                self.q_dict['Prop'].append(('value', values))
-
-
-class QueryCreator(BaseQueryCreator):
-    """ 
-    Class for simplifying the creation of prepared SPARQL queries 
-    
-    Usage:
-        q = "doc(author:D. N. Adams) section(name:Stimulus) prop(name:Contrast, value:20, unit:%)"
-        prepared_query = QueryCreator().get_query(q, QueryParser())
-        
-        q = "FIND sec(name, type) prop(name) HAVING Recording, Recording-2012-04-04-ab, Date"
-        prepared_query = QueryCreator().get_query(q, QueryParser2())
-    """
-
-    def __init__(self, q_dict=None):
-        """
-        :param q_dict: dictionary with query parameters
-        """
-        super(QueryCreator, self).__init__(q_dict)
-
-    def get_query(self, q_str=None, q_parser=None):
-        """
-        :param q_parser: one of possible query parsers.
-        :param q_str: doc(author:D. N. Adams) section(name:Stimulus) prop(name:Contrast, value:20, unit:%)
-        :return rdflib prepare query.
-        """
-        # TODO find out if the validation for the q_str is important
-        # We can possibly warn about not used parts and print the parsed dictionary
-        if not self.q_dict:
-            if not q_str:
-                raise AttributeError("Please fulfill q_str param (query string)")
-            elif not q_parser:
-                raise AttributeError("Please fulfill q_parser param (query parser)")
-            self.q_dict = q_parser.parse_query_string(q_str)
-        self._prepare_query()
-        return prepareQuery(self.query, initNs={"odml": Namespace("https://g-node.org/projects/odml-rdf#"),
-                                                "rdf": RDF})
-
-    def _prepare_query(self):
-        """
-        Creates rdflib query using parameters from self.q_dict.
-        :return: string representing rdflib query.
-        """
-
-        odml_uri = "https://g-node.org/projects/odml-rdf#"
-        self.query = 'SELECT * WHERE {\n'
-
-        if 'Doc' in self.q_dict.keys():
-            doc_attrs = self.q_dict['Doc']
-            if len(doc_attrs) > 0:
-                self.query += '?d rdf:type odml:Document .\n'
-                for i in doc_attrs:
-                    if len(i) > 2:
-                        raise ValueError("Attributes in the query \"{}\" are not valid.".format(i))
-                    else:
-                        attr = Document.rdf_map(i[0])
-                        if attr:
-                            self.query += '?d {0} \"{1}\" .\n'.format(re.sub(odml_uri,
-                                                                             "odml:", attr), i[1])
-        if 'Sec' in self.q_dict.keys():
-            sec_attrs = self.q_dict['Sec']
-            if len(sec_attrs) > 0:
-                self.query += '?d odml:hasSection ?s .\n' \
-                              '?s rdf:type odml:Section .\n'
-                for i in sec_attrs:
-                    if len(i) > 2:
-                        raise ValueError("Attributes in the query \"{}\" are not valid.".format(i))
-                    else:
-                        attr = Section.rdf_map(i[0])
-                        if attr:
-                            self.query += '?s {0} \"{1}\" .\n'.format(re.sub(odml_uri,
-                                                                             "odml:", attr), i[1])
-        if 'Prop' in self.q_dict.keys():
-            prop_attrs = self.q_dict['Prop']
-            if len(prop_attrs) > 0:
-                self.query += '?s odml:hasProperty ?p .\n' \
-                              '?p rdf:type odml:Property .\n'
-                for i in prop_attrs:
-                    if len(i) > 2:
-                        raise ValueError("Attributes in the query \"{}\" are not valid.".format(i))
-                    elif i[0] == 'value':
-                        values = i[1]
-                        if values:
-                            self.query += "?p odml:hasValue ?v .\n?v rdf:type rdf:Bag .\n"
-                            for v in values:
-                                self.query += '?v rdf:li \"{}\" .\n'.format(v)
-                    else:
-                        attr = Property.rdf_map(i[0])
-                        if attr:
-                            self.query += '?p {0} \"{1}\" .\n'.format(re.sub(odml_uri,
-                                                                             "odml:", attr), i[1])
-
-        self.query += '}\n'
-        return self.query

+ 1 - 314
code/python-odml/odml/tools/rdf_converter.py

@@ -1,314 +1 @@
-import os
-import uuid
-import yaml
-
-from io import StringIO
-from os.path import dirname, abspath
-from rdflib import Graph, Literal, URIRef
-from rdflib.graph import Seq
-from rdflib.namespace import XSD, RDF
-
-import odml
-from ..format import Format, Document, Section, Property
-from .dict_parser import DictReader
-from .parser_utils import ParserException
-from ..info import FORMAT_VERSION
-
-try:
-    unicode = unicode
-except NameError:
-    unicode = str
-
-odmlns = Format.namespace()
-
-
-class RDFWriter(object):
-    """
-    A writer to parse odML files into RDF documents.
-
-    Usage:
-        RDFWriter(odml_docs).get_rdf_str('turtle')
-        RDFWriter(odml_docs).write_file("/output_path", "rdf_format")
-    """
-
-    def __init__(self, odml_documents):
-        """
-        :param odml_documents: list of odml documents 
-        """
-        self.docs = odml_documents if not isinstance(odml_documents, odml.doc.BaseDocument) else [odml_documents]
-        self.hub_root = None
-        self.g = Graph()
-        self.g.bind("odml", odmlns)
-
-        self.section_subclasses = {}
-
-        # TODO doc/section_subclasses.yaml has to be exported on install, otherwise
-        # the RDFWriter is broken. Below is a quick and dirty fix to at least
-        # unbreak on install.
-        subclass_path = os.path.join(dirname(dirname(dirname(abspath(__file__)))),
-                         'doc', 'section_subclasses.yaml')
-
-        if os.path.isfile(subclass_path):
-            with open(subclass_path, "r") as f:
-                try:
-                    self.section_subclasses = yaml.load(f)
-                except yaml.parser.ParserError as err:
-                    print(err)
-                    return
-
-    def convert_to_rdf(self):
-        self.hub_root = URIRef(odmlns.Hub)
-        if self.docs:
-            for doc in self.docs:
-                self.save_element(doc)
-        return self.g
-
-    def save_element(self, e, node=None):
-        """
-        Save the current element to the RDF graph
-        :param e: current element 
-        :param node: A node to pass the earlier created node to inner elements
-        :return: the RDF graph 
-        """
-        fmt = e.format()
-
-        if not node:
-            curr_node = URIRef(odmlns + unicode(e.id))
-        else:
-            curr_node = node
-
-        if fmt.name == "section":
-            s = self._get_section_subclass(e)
-            u = s if s else fmt.rdf_type
-            self.g.add((curr_node, RDF.type, URIRef(u)))
-        else:
-            self.g.add((curr_node, RDF.type, URIRef(fmt.rdf_type)))
-
-        # adding doc to the hub
-        if isinstance(fmt, Document.__class__):
-            self.g.add((self.hub_root, odmlns.hasDocument, curr_node))
-
-            # If available add the documents filename to the document node
-            # so we can identify where the data came from.
-            if hasattr(e, "_origin_file_name"):
-                self.g.add((curr_node, odmlns.hasFileName, Literal(e._origin_file_name)))
-
-        for k in fmt.rdf_map_keys:
-            if k == 'id':
-                continue
-            elif (isinstance(fmt, Document.__class__) or
-                    isinstance(fmt, Section.__class__)) and k == "repository":
-                terminology_url = getattr(e, k)
-                if terminology_url is None or not terminology_url:
-                    continue
-                terminology_node = self._get_terminology_by_value(terminology_url)
-                if terminology_node:
-                    self.g.add((curr_node, fmt.rdf_map(k), terminology_node))
-                else:
-                    # adding terminology to the hub and to link with the doc
-                    node = URIRef(odmlns + unicode(uuid.uuid4()))
-                    self.g.add((node, RDF.type, URIRef(terminology_url)))
-                    self.g.add((self.hub_root, odmlns.hasTerminology, node))
-                    self.g.add((curr_node, fmt.rdf_map(k), node))
-            # generating nodes for entities: sections, properties and bags of values
-            elif (isinstance(fmt, Document.__class__) or
-                    isinstance(fmt, Section.__class__)) and \
-                    k == 'sections' and len(getattr(e, k)) > 0:
-                sections = getattr(e, k)
-                for s in sections:
-                    node = URIRef(odmlns + unicode(s.id))
-                    self.g.add((curr_node, fmt.rdf_map(k), node))
-                    self.save_element(s, node)
-            elif isinstance(fmt, Section.__class__) and \
-                    k == 'properties' and len(getattr(e, k)) > 0:
-                properties = getattr(e, k)
-                for p in properties:
-                    node = URIRef(odmlns + unicode(p.id))
-                    self.g.add((curr_node, fmt.rdf_map(k), node))
-                    self.save_element(p, node)
-            elif isinstance(fmt, Property.__class__) and \
-                    k == 'value' and len(getattr(e, k)) > 0:
-                values = getattr(e, k)
-                seq = URIRef(odmlns + unicode(uuid.uuid4()))
-                self.g.add((seq, RDF.type, RDF.Seq))
-                self.g.add((curr_node, fmt.rdf_map(k), seq))
-                # rdflib so far does not respect RDF:li item order
-                # in RDF:Seq on loading so we have to use custom
-                # numbered Node elements for now. Once rdflib upgrades
-                # this should be reversed to RDF:li again!
-                # see https://github.com/RDFLib/rdflib/issues/280
-                # -- keep until supported
-                # bag = URIRef(odmlns + unicode(uuid.uuid4()))
-                # self.g.add((bag, RDF.type, RDF.Bag))
-                # self.g.add((curr_node, fmt.rdf_map(k), bag))
-                # for v in values:
-                #     self.g.add((bag, RDF.li, Literal(v)))
-
-                counter = 1
-                for v in values:
-                    pred = "%s_%s" % (unicode(RDF), counter)
-                    self.g.add((seq, URIRef(pred), Literal(v)))
-                    counter = counter + 1
-
-            # adding entities' properties
-            else:
-                val = getattr(e, k)
-                if val is None or not val:
-                    continue
-                elif k == 'date':
-                    self.g.add((curr_node, fmt.rdf_map(k), Literal(val, datatype=XSD.date)))
-                else:
-                    self.g.add((curr_node, fmt.rdf_map(k), Literal(val)))
-        return self.g
-
-    def _get_terminology_by_value(self, url):
-        return self.g.value(predicate=RDF.type, object=URIRef(url))
-
-    def _get_section_subclass(self, e):
-        """
-        :return: RDF identifier of section subclass type if present in section_subclasses dict
-        """
-        sec_type = getattr(e, "type")
-        if sec_type and sec_type in self.section_subclasses:
-            return odmlns[self.section_subclasses[sec_type]]
-        else:
-            return None
-
-    def __str__(self):
-        return self.convert_to_rdf().serialize(format='turtle').decode("utf-8")
-
-    def __unicode__(self):
-        return self.convert_to_rdf().serialize(format='turtle').decode("utf-8")
-
-    def get_rdf_str(self, rdf_format):
-        """
-        Get converted into one of the supported formats data 
-        :param rdf_format: possible formats: 'xml', 'n3', 'turtle', 
-                                             'nt', 'pretty-xml', 'trix', 
-                                             'trig', 'nquads', 'json-ld'.
-               Full lists see in odml.tools.format_converter.FormatConverter._conversion_formats
-        :return: string object
-        """
-        return self.convert_to_rdf().serialize(format=rdf_format).decode("utf-8")
-
-    def write_file(self, filename, rdf_format):
-        data = self.get_rdf_str(rdf_format)
-        with open(filename, "w") as file:
-            file.write(data)
-
-
-class RDFReader(object):
-    """
-    A reader to parse odML RDF files or strings into odml documents.
-
-    Usage:
-        file = RDFReader().from_file("/path_to_input_rdf", "rdf_format")
-        file = RDFReader().from_string("rdf file as string", "rdf_format")
-        RDFReader().write_file("/input_path", "rdf_format", "/output_path")
-    """
-
-    def __init__(self, filename=None, doc_format=None):
-        self.docs = []  # list of parsed odml docs
-        if filename and doc_format:
-            self.g = Graph().parse(source=filename, format=doc_format)
-
-    def to_odml(self):
-        """
-        :return: list of converter odml documents
-        """
-        docs_uris = list(self.g.objects(subject=URIRef(odmlns.Hub),
-                                        predicate=odmlns.hasDocument))
-        for doc in docs_uris:
-            par = self.parse_document(doc)
-            par_doc = DictReader().to_odml(par)
-            self.docs.append(par_doc)
-
-        return self.docs
-
-    def from_file(self, filename, doc_format):
-        self.g = Graph().parse(source=filename, format=doc_format)
-        docs = self.to_odml()
-        for d in docs:
-            # Provide original file name via the document
-            d._origin_file_name = os.path.basename(filename)
-        return docs
-
-    def from_string(self, file, doc_format):
-        self.g = Graph().parse(source=StringIO(file), format=doc_format)
-        return self.to_odml()
-
-    # TODO check mandatory attrs
-    def parse_document(self, doc_uri):
-        rdf_doc = Document
-        doc_attrs = {}
-        for attr in rdf_doc.rdf_map_items:
-            elems = list(self.g.objects(subject=doc_uri, predicate=attr[1]))
-            if attr[0] == "sections":
-                doc_attrs[attr[0]] = []
-                for s in elems:
-                    doc_attrs[attr[0]].append(self.parse_section(s))
-            elif attr[0] == "id":
-                doc_attrs[attr[0]] = doc_uri.split("#", 1)[1]
-            else:
-                if len(elems) > 0:
-                    doc_attrs[attr[0]] = unicode(elems[0].toPython())
-
-        return {'Document': doc_attrs, 'odml-version': FORMAT_VERSION}
-
-    # TODO section subclass conversion
-    def parse_section(self, sec_uri):
-        rdf_sec = Section
-        sec_attrs = {}
-        for attr in rdf_sec.rdf_map_items:
-            elems = list(self.g.objects(subject=sec_uri, predicate=attr[1]))
-            if attr[0] == "sections":
-                sec_attrs[attr[0]] = []
-                for s in elems:
-                    sec_attrs[attr[0]].append(self.parse_section(s))
-            elif attr[0] == "properties":
-                sec_attrs[attr[0]] = []
-                for p in elems:
-                    sec_attrs[attr[0]].append(self.parse_property(p))
-            elif attr[0] == "id":
-                sec_attrs[attr[0]] = sec_uri.split("#", 1)[1]
-            else:
-                if len(elems) > 0:
-                    sec_attrs[attr[0]] = unicode(elems[0].toPython())
-        self._check_mandatory_attrs(sec_attrs)
-        return sec_attrs
-
-    def parse_property(self, prop_uri):
-        rdf_prop = Property
-        prop_attrs = {}
-        for attr in rdf_prop.rdf_map_items:
-            elems = list(self.g.objects(subject=prop_uri, predicate=attr[1]))
-            if attr[0] == "value" and len(elems) > 0:
-                prop_attrs[attr[0]] = []
-
-                # rdflib does not respect order with RDF.li items yet, see comment above
-                # support both RDF.li and rdf:_nnn for now.
-                # Remove rdf:_nnn once rdflib respects RDF.li order in an RDF.Seq obj.
-                values = list(self.g.objects(subject=elems[0], predicate=RDF.li))
-                if len(values) > 0:
-                    for v in values:
-                        prop_attrs[attr[0]].append(v.toPython())
-                else:
-                    # rdf:__nnn part
-                    valseq = Seq(graph=self.g, subject=elems[0])
-                    for seqitem in valseq:
-                        prop_attrs[attr[0]].append(seqitem.toPython())
-
-            elif attr[0] == "id":
-                prop_attrs[attr[0]] = prop_uri.split("#", 1)[1]
-            else:
-                if len(elems) > 0:
-                    prop_attrs[attr[0]] = unicode(elems[0].toPython())
-        self._check_mandatory_attrs(prop_attrs)
-        return prop_attrs
-
-    def _check_mandatory_attrs(self, attrs):
-        if "name" not in attrs:
-            if "id" in attrs:
-                raise ParserException("Entity with id: %s does not have required \"name\" attribute" % attrs["id"])
-            else:
-                raise ParserException("Some entities does not have required \"name\" attribute")
+/annex/objects/MD5-s22810--02fd602fe6d95c537aad037444cf281f

+ 1 - 465
code/python-odml/odml/tools/version_converter.py

@@ -1,465 +1 @@
-import io
-import json
-import os
-import sys
-import yaml
-
-from lxml import etree as ET
-from .. import format
-from ..info import FORMAT_VERSION
-from ..terminology import Terminologies, REPOSITORY_BASE
-
-try:
-    unicode = unicode
-except NameError:
-    unicode = str
-
-
-class VersionConverter(object):
-    """
-    Class for converting odml xml files from version 1.0 to 1.1
-    """
-    _version_map = {
-        'filename': 'value_origin',
-        'dtype': 'type'
-    }
-
-    def __init__(self, filename):
-        self.filename = filename
-        self.conversion_log = []
-
-    def _parse_xml(self):
-        """
-        _parse_xml checks whether the provided file object can be parsed
-        and returns the parsed lxml tree.
-        :return: ElementTree
-        """
-        # Make pretty print available by resetting format
-        parser = ET.XMLParser(remove_blank_text=True)
-        if isinstance(self.filename, io.StringIO):
-            doc = self.filename.getvalue()
-            tree = ET.ElementTree(ET.fromstring(doc, parser))
-
-        elif os.path.exists(self.filename) and os.path.getsize(self.filename) > 0:
-            tree = ET.parse(self.filename, parser)
-        else:
-            msg = "Cannot parse provided file object '%s'." % self.filename
-            raise Exception(msg)
-
-        return tree
-
-    def _parse_json(self):
-        with open(self.filename) as file:
-            parsed_doc = json.load(file)
-
-        return self._parse_dict_document(parsed_doc)
-
-    def _parse_yaml(self):
-        with open(self.filename) as file:
-            parsed_doc = yaml.load(file)
-
-        return self._parse_dict_document(parsed_doc)
-
-    @classmethod
-    def _parse_dict_document(cls, parsed_doc):
-        """
-        _parse_dict_document parses a python dictionary containing a valid
-        v1.0 odML document into an lxml.ElementTree XML equivalent and returns
-        the resulting lxml ElementTree.
-        :param parsed_doc: python dictionary containing a valid v1.0 odML document.
-        :return: lxml ElementTree
-        """
-        root = ET.Element("odML")
-
-        parsed_doc = parsed_doc['Document']
-
-        for elem in parsed_doc:
-            if elem == 'sections':
-                cls._parse_dict_sections(root, parsed_doc['sections'])
-            elif elem:
-                curr_element = ET.Element(elem)
-                curr_element.text = parsed_doc[elem]
-                root.append(curr_element)
-
-        return ET.ElementTree(root)
-
-    @classmethod
-    def _parse_dict_sections(cls, parent_element, section_list):
-        """
-        _parse_dict_sections parses a list containing python dictionaries of v1.0 odML
-        style sections into lxml.Element XML equivalents and appends the parsed Sections
-        to the provided lxml.Element parent.
-        :param parent_element: lxml.Element to which parsed sections will be appended.
-        :param section_list: list of python dictionaries containing valid v1.0 odML
-                             Sections.
-        """
-        for section in section_list:
-            sec = ET.Element("section")
-            for element in section:
-                if element == 'properties':
-                    cls._parse_dict_properties(sec, section['properties'])
-                elif element == 'sections':
-                    cls._parse_dict_sections(sec, section['sections'])
-                elif element:
-                    elem = ET.Element(element)
-                    elem.text = section[element]
-                    sec.append(elem)
-
-            parent_element.append(sec)
-
-    @classmethod
-    def _parse_dict_properties(cls, parent_element, props_list):
-        """
-        _parse_dict_properties parses a list containing python dictionaries of v1.0 odML
-        style properties into lxml.Element XML equivalents and appends the parsed
-        Properties to the provided lxml.Element parent.
-        :param parent_element: lxml.Element to which parsed properties will be appended.
-        :param props_list: list of python dictionaries containing valid v1.0 odML
-                           Properties.
-        """
-        for curr_prop in props_list:
-            prop = ET.Element("property")
-            for element in curr_prop:
-                if element == 'values':
-                    cls._parse_dict_values(prop, curr_prop['values'])
-                elif element:
-                    elem = ET.Element(element)
-                    elem.text = curr_prop[element]
-                    prop.append(elem)
-
-            parent_element.append(prop)
-
-    @staticmethod
-    def _parse_dict_values(parent_element, value_list):
-        """
-        _parse_dict_values parses a list containing python dictionaries of v1.0 odML
-        style values into lxml.Element XML equivalents and appends the parsed
-        Values to the provided lxml.Element parent.
-        :param parent_element: lxml.Element to which parsed values will be appended.
-        :param value_list: list of python dictionaries containing valid v1.0 odML Values.
-        """
-        for value in value_list:
-            val = ET.Element("value")
-            for element in value:
-                if element:
-                    if element == 'value':
-                        val.text = str(value[element])
-                    else:
-                        elem = ET.Element(element)
-                        elem.text = str(value[element])
-                        val.append(elem)
-
-            parent_element.append(val)
-
-    def _convert(self, tree):
-        """
-        Converts an lxml.ElementTree containing a v1.0 odML document to odML v1.1.
-        Unites multiple value objects and moves all supported Value elements to
-        its parent Property. Exports only Document, Section and Property elements,
-        that are supported by odML v1.1.
-        """
-        # Reset status messages
-        self.conversion_log = []
-
-        tree = self._replace_same_name_entities(tree)
-        root = tree.getroot()
-        root.set("version", FORMAT_VERSION)
-
-        # Handle Values, exclude unsupported Property attributes and unnamed Properties.
-        self._handle_properties(root)
-
-        # Exclude unsupported Section attributes, ignore comments, handle repositories.
-        for sec in root.iter("section"):
-            sec_name = sec.find("name").text
-            for e in sec:
-                if e.tag not in format.Section.arguments_keys and isinstance(e.tag, str):
-                    self._log("[Info] Omitted non-Section attribute "
-                              "'%s: %s/%s'" % (sec_name, e.tag, e.text))
-                    sec.remove(e)
-                    continue
-
-                if e.tag == "repository":
-                    self._handle_repository(e)
-                elif e.tag == "include":
-                    self._handle_include(e)
-
-        # Exclude unsupported Document attributes, ignore comments, handle repositories.
-        for e in root:
-            if e.tag not in format.Document.arguments_keys and isinstance(e.tag, str):
-                self._log("[Info] Omitted non-Document "
-                          "attribute '%s/%s'" % (e.tag, e.text))
-                root.remove(e)
-                continue
-
-            if e.tag == "repository":
-                self._handle_repository(e)
-
-        return tree
-
-    def _handle_include(self, element):
-        """
-        _handle_include checks whether a provided include element is
-        v1.1 compatible and logs a warning message otherwise.
-        :param element: lxml element containing the provided include link.
-        """
-        content = element.text
-        cache = {}
-        term_handler = Terminologies(cache)
-        term = term_handler.load(element.text)
-
-        # If the include url can be loaded and parsed, everything is fine.
-        if term is not None:
-            return
-
-        # If the include url is a v1.0 odml-terminology one,
-        # check whether a v1.1 is available and use it instead.
-        if '/'.join([REPOSITORY_BASE, "v1.0"]) in element.text:
-            element.text = element.text.replace('v1.0', 'v1.1')
-            term = term_handler.load(element.text)
-
-            if term is not None:
-                msg = "[Info] Replaced Section.include url '%s' with '%s'." \
-                      % (content, element.text)
-                self._log(msg)
-                return
-
-        # Log a warning, if no v1.1 compatible url can be provided.
-        self._log("[Warning] Section include file '%s' "
-                  "is not odML v1.1 compatible." % content)
-
-    def _handle_repository(self, element):
-        """
-        The method handles provided odML repositories.
-        :param element: lxml element containing the provided odML repository link.
-        """
-        content = element.text
-        cache = {}
-        term_handler = Terminologies(cache)
-        term = term_handler.load(element.text)
-
-        # If the repository url can be loaded and parsed, everything is fine.
-        if term is not None:
-            return
-
-        # If the repository url is a v1.0 odml-terminology one,
-        # check whether a v1.1 is available and use it instead.
-        if '/'.join([REPOSITORY_BASE, "v1.0"]) in element.text:
-            element.text = element.text.replace('v1.0', 'v1.1')
-            term = term_handler.load(element.text)
-
-            if term is not None:
-                msg = "[Info] Replaced repository url '%s' with '%s'." \
-                      % (content, element.text)
-                self._log(msg)
-                return
-
-        # Print a warning, if no v1.1 compatible repository url can be provided.
-        self._log("[Warning] Repository file '%s' is not odML v1.1 compatible." % content)
-
-    def _handle_properties(self, root):
-        """
-        Method removes all property elements w/o name attribute, converts Value
-        elements from v1.0 to v1.1 style and removes unsupported Property elements.
-        :param root:
-        """
-        for prop in root.iter("property"):
-            main_val = ET.Element("value")
-            multiple_values = False
-            parent = prop.getparent()
-
-            # If a Property has no name attribute, remove it from its parent and
-            # continue with the next Property.
-            if prop.find("name") is None:
-                self._log("[Warning] Omitted Property without "
-                          "name tag: '%s'" % ET.tostring(prop))
-                parent.remove(prop)
-                continue
-
-            sname = "unnamed"
-            if parent.find("name") is not None:
-                sname = parent.find("name").text
-            stype = "untyped"
-            if parent.find("type") is not None:
-                stype = parent.find("type").text
-            prop_id = "%s|%s:%s" % (sname, stype, prop.find("name").text)
-
-            # Special handling of Values
-            for value in prop.iter("value"):
-                # Move supported elements from Value to parent Property.
-                self._handle_value(value, prop_id)
-
-                if value.text:
-                    if main_val.text:
-                        main_val.text += "," + value.text.strip()
-                        multiple_values = True
-                    else:
-                        main_val.text = value.text.strip()
-
-                prop.remove(value)
-
-            # Append value element only if it contains an actual value
-            if main_val.text:
-                # Multiple values require brackets
-                if multiple_values:
-                    main_val.text = "[" + main_val.text + "]"
-
-                prop.append(main_val)
-
-            # Reverse map "dependency_value", exclude unsupported Property attributes.
-            for elem in prop:
-                if elem.tag == "dependency_value":
-                    elem.tag = "dependencyvalue"
-
-                if (elem.tag not in format.Property.arguments_keys and
-                        isinstance(elem.tag, str)):
-                    self._log("[Info] Omitted non-Property attribute "
-                              "'%s: %s/%s'" % (prop_id, elem.tag, elem.text))
-                    prop.remove(elem)
-
-    def _handle_value(self, value, log_id):
-        """
-        Values changed from odML v1.0 to v1.1. This function moves all supported
-        odML Property elements from a v1.0 Value element to the parent Property element.
-        Adds a log entry for every non-exported element.
-        :param value: etree element containing the v1.0 Value.
-        :param log_id: String containing Section and Property name and type to log
-                       omitted elements and value contents.
-        """
-        for val_elem in value.iter():
-            if val_elem.tag != "value":
-                # Check whether current Value attribute has already been exported
-                # under its own or a different name. Give a warning, if the values differ.
-                parent = value.getparent()
-                if val_elem.tag in self._version_map:
-                    check_export = parent.find(self._version_map[val_elem.tag])
-                else:
-                    check_export = parent.find(val_elem.tag)
-
-                if check_export is not None:
-                    if check_export.text != val_elem.text:
-                        self._log("[Warning] Value element '%s: %s/%s' already exported, "
-                                  "omitting further element value '%s'"
-                                  % (log_id, val_elem.tag,
-                                     check_export.text, val_elem.text))
-
-                # Include only supported Property attributes
-                elif val_elem.tag in format.Property.arguments_keys:
-                    new_elem = ET.Element(val_elem.tag)
-                    new_elem.text = val_elem.text
-
-                    if val_elem.tag in ["type", "dtype"] and val_elem.text == "binary":
-                        new_elem.text = "text"
-                        self._log("[Warning] Replacing unsupported value type "
-                                  "'binary' with 'text' (%s)" % log_id)
-
-                    parent.append(new_elem)
-                elif val_elem.tag in self._version_map:
-                    new_elem = ET.Element(self._version_map[val_elem.tag])
-                    new_elem.text = val_elem.text
-
-                    if val_elem.tag in ["type", "dtype"] and val_elem.text == "binary":
-                        new_elem.text = "text"
-                        self._log("[Warning] Replacing unsupported value type "
-                                  "'binary' with 'text' (%s)" % log_id)
-
-                    parent.append(new_elem)
-                else:
-                    self._log("[Info] Omitted non-Value attribute '%s: %s/%s'"
-                              % (log_id, val_elem.tag, val_elem.text))
-
-    @classmethod
-    def _replace_same_name_entities(cls, tree):
-        """
-        Changes same section names in the doc by adding <-{index}>
-        to the next section occurrences.
-        :param tree: ElementTree of the doc
-        :return: ElementTree
-        """
-        sec_map = {}
-        prop_map = {}
-        root = tree.getroot()
-        for sec in root.iter("section"):
-
-            sec_name = sec.find("name")
-            if sec_name is not None:
-                cls._change_entity_name(tree, sec_map, sec_name)
-            else:
-                raise Exception("Section attribute name is not specified")
-
-            for prop in sec.iter("property"):
-                if prop.getparent() == sec:
-                    prop_name = prop.find("name")
-                    if prop_name is not None:
-                        cls._change_entity_name(tree, prop_map, prop_name)
-            prop_map.clear()
-        return tree
-
-    @staticmethod
-    def _change_entity_name(tree, elem_map, name):
-        """
-        Adds numbering to identical element names where their odml.Section
-        or odml.Property parents reside on the same level in the tree.
-        :param tree: The element tree containing the 'name' element.
-        :param elem_map: lxml path to occurrence maps of named Sections or Properties.
-        :param name: lxml element containing the name text of a Section or Property.
-        """
-        named_path = "%s:%s" % (tree.getpath(name.getparent().getparent()), name.text)
-        if named_path not in elem_map:
-            elem_map[named_path] = 1
-        else:
-            elem_map[named_path] += 1
-            name.text += "-" + str(elem_map[named_path])
-
-    def _log(self, msg):
-        """
-        Adds the passed message to the conversion_log attribute and
-        prints the message to the command line.
-        """
-        self.conversion_log.append(msg)
-        print(msg)
-
-    def __str__(self):
-        tree = self.convert()
-        return ET.tounicode(tree, pretty_print=True) if tree else ""
-
-    def __unicode__(self):
-        tree = self.convert()
-        return ET.tounicode(tree, pretty_print=True) if tree else ""
-
-    def convert(self, backend="XML"):
-        """
-        This method returns the content of the provided file object converted
-        to odML version 1.1 as a string object which is directly consumable
-        by the odml.tools.ODMLReader.
-        """
-        if backend.upper() == "JSON":
-            old_tree = self._parse_json()
-        elif backend.upper() == "YAML":
-            old_tree = self._parse_yaml()
-        elif backend.upper() == "XML":
-            old_tree = self._parse_xml()
-        else:
-            raise Exception("Unknown backend, only XML, JSON and YAML are supported.")
-
-        tree = self._convert(old_tree)
-        return ET.tounicode(tree, pretty_print=True) if tree else ""
-
-    def write_to_file(self, filename, backend="XML"):
-        """
-        This method converts the content of the provided converter file object
-        to odML version 1.1 and writes the results to `filename`.
-        :param filename: Output file.
-        :param backend: Format of the source file, default is XML.
-        """
-        data = self.convert(backend)
-        if sys.version_info < (3,):
-            data = data.encode('utf-8')
-
-        ext = [".xml", ".odml"]
-        if not filename.endswith(tuple(ext)):
-            filename = "%s.xml" % filename
-
-        if data and "<odML " in data:
-            with open(filename, "w") as file:
-                file.write('<?xml version="1.0" encoding="UTF-8"?>\n')
-                file.write(data)
+/annex/objects/MD5-s478--ab8bd1519183d5967148feb239a41923

+ 1 - 342
code/python-odml/odml/tools/xmlparser.py

@@ -1,342 +1 @@
-#!/usr/bin/env python
-"""
-The XML parsing module.
-Parses odML files. Can be invoked standalone:
-    python -m odml.tools.xmlparser file.odml
-"""
-import csv
-import sys
-from lxml import etree as ET
-from lxml.builder import E
-# this is needed for py2exe to include lxml completely
-from lxml import _elementpath as _dummy
-from os.path import basename
-
-try:
-    from StringIO import StringIO
-except ImportError:
-    from io import StringIO
-
-from .. import format
-from ..info import FORMAT_VERSION
-from .parser_utils import InvalidVersionException, ParserException
-
-try:
-    unicode = unicode
-except NameError:
-    unicode = str
-
-
-def to_csv(val):
-    # Make sure all individual values do not contain
-    # leading or trailing whitespaces.
-    unicode_values = list(map(unicode.strip, map(unicode, val)))
-    stream = StringIO()
-    writer = csv.writer(stream, dialect="excel")
-    writer.writerow(unicode_values)
-    # Strip any csv.writer added carriage return line feeds
-    # and double quotes before saving.
-    csv_string = stream.getvalue().strip().strip('"')
-    if len(unicode_values) > 1:
-        csv_string = "[" + csv_string + "]"
-    return csv_string
-
-
-def from_csv(value_string):
-    if not value_string:
-        return []
-    if value_string[0] == "[" and value_string[-1] == "]":
-        value_string = value_string[1:-1]
-    else:
-        # This is a single string entry, any comma contained
-        # is part of the value and must not be used to
-        # split up the string.
-        return [value_string]
-
-    if not value_string:
-        return []
-    stream = StringIO(value_string)
-    stream.seek(0)
-    reader = csv.reader(stream, dialect="excel")
-    return list(reader)[0]
-
-
-class XMLWriter:
-    """
-    Creates XML nodes storing the information of an odML Document
-    """
-    header = """<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet  type="text/xsl" href="odmlTerms.xsl"?>
-<?xml-stylesheet  type="text/xsl" href="odml.xsl"?>
-"""
-
-    def __init__(self, odml_document):
-        self.doc = odml_document
-
-    @staticmethod
-    def save_element(e):
-        """
-        returns an xml node for the odML object e
-        """
-        fmt = e.format()
-        cur = E(fmt.name)
-
-        # generate attributes
-        if isinstance(fmt, format.Document.__class__):
-            cur.attrib['version'] = FORMAT_VERSION
-
-        # generate elements
-        for k in fmt.arguments_keys:
-            if not hasattr(e, fmt.map(k)):
-                continue
-
-            val = getattr(e, fmt.map(k))
-            if val is None:
-                continue
-            if isinstance(fmt, format.Property.__class__) and k == "value":
-                # Custom odML tuples require special handling for save loading from file.
-                if e.dtype and e.dtype.endswith("-tuple") and len(val) > 0:
-                    ele = E(k, "(%s)" % ";".join(val[0]))
-                else:
-                    ele = E(k, to_csv(val))
-                cur.append(ele)
-            else:
-                if isinstance(val, list):
-                    for v in val:
-                        if v is None:
-                            continue
-                        ele = XMLWriter.save_element(v)
-                        cur.append(ele)
-                else:
-                    if sys.version_info < (3,):
-                        ele = E(k, unicode(val))
-                    else:
-                        ele = E(k, str(val))
-                    cur.append(ele)
-        return cur
-
-    def __str__(self):
-        return ET.tounicode(self.save_element(self.doc), pretty_print=True)
-
-    def __unicode__(self):
-        return ET.tounicode(self.save_element(self.doc), pretty_print=True)
-
-    def write_file(self, filename):
-        # calculate the data before opening the file in case we get any
-        # exception
-        if sys.version_info < (3,):
-            data = unicode(self).encode('utf-8')
-        else:
-            data = str(self)
-
-        with open(filename, "w") as file:
-            file.write(self.header)
-            file.write(data)
-
-
-def load(filename):
-    """
-    shortcut function for XMLReader().from_file(filename)
-    """
-    return XMLReader().from_file(filename)
-
-
-class XMLReader(object):
-    """
-    A reader to parse xml-files or strings into odml data structures
-    Usage:
-        >>> doc = XMLReader().from_file("file.odml")
-    """
-
-    def __init__(self, ignore_errors=False, show_warnings=True, filename=None):
-        """
-        :param ignore_errors: To allow loading and fixing of invalid odml files
-                              encountered errors can be converted to warnings
-                              instead. Such a document can only be saved when
-                              all errors have been addressed though.
-        :param show_warnings: Toggle whether to print warnings to the command line.
-                              Any warnings can be accessed via the Reader's class
-                              warnings attribute after parsing is done.
-        :param filename: Path to an odml file.
-        """
-        self.parser = ET.XMLParser(remove_comments=True)
-        self.tags = dict([(obj.name, obj) for obj in format.__all__])
-        self.ignore_errors = ignore_errors
-        self.show_warnings = show_warnings
-        self.filename = filename
-        self.warnings = []
-
-    @staticmethod
-    def _handle_version(root):
-        """
-        Check if the odML version of a handed in parsed lxml.etree is supported
-        by the current library and raise an Exception otherwise.
-        :param root: Root node of a parsed lxml.etree. The root tag has to
-                     contain a supported odML version number, otherwise it is not
-                     accepted as a valid odML file.
-        """
-        if root.tag != 'odML':
-            raise ParserException("Expecting <odML> tag but got <%s>.\n" % root.tag)
-        elif 'version' not in root.attrib:
-            raise ParserException("Could not find format version attribute "
-                                  "in <odML> tag.\n")
-        elif root.attrib['version'] != FORMAT_VERSION:
-            msg = ("Cannot parse odML document with format version '%s'. \n"
-                   "\tUse the 'tools.VersionConverter' to import previous odML formats."
-                   % root.attrib['version'])
-            raise InvalidVersionException(msg)
-
-    def from_file(self, xml_file):
-        """
-        parse the datastream from a file like object *xml_file*
-        and return an odml data structure
-        """
-        try:
-            root = ET.parse(xml_file, self.parser).getroot()
-            if hasattr(xml_file, "close"):
-                xml_file.close()
-        except ET.XMLSyntaxError as e:
-            raise ParserException(e.msg)
-
-        self._handle_version(root)
-        doc = self.parse_element(root)
-
-        # Provide original file name via the in memory document
-        if isinstance(xml_file, unicode):
-            doc._origin_file_name = basename(xml_file)
-        return doc
-
-    def from_string(self, string):
-        try:
-            root = ET.XML(string, self.parser)
-        except ET.XMLSyntaxError as e:
-            raise ParserException(e.msg)
-
-        self._handle_version(root)
-        return self.parse_element(root)
-
-    def check_mandatory_arguments(self, data, ArgClass, tag_name, node):
-        for k, v in ArgClass.arguments:
-            if v != 0 and not ArgClass.map(k) in data:
-                self.error("missing element <%s> within <%s> tag" %
-                           (k, tag_name) + repr(data), node)
-
-    def is_valid_argument(self, tag_name, ArgClass, parent_node, child=None):
-        if tag_name not in ArgClass.arguments_keys:
-            self.error("Invalid element <%s> inside <%s> tag" %
-                       (tag_name, parent_node.tag),
-                       parent_node if child is None else child)
-
-    def error(self, msg, elem):
-        if elem is not None:
-            msg += " (line %d)" % elem.sourceline
-        if self.ignore_errors:
-            return self.warn(msg, elem)
-        raise ParserException(msg)
-
-    def warn(self, msg, elem):
-        if elem is not None:
-            msg = "warning[%s:%d:<%s>]: %s\n" % (
-                self.filename, elem.sourceline, elem.tag, msg)
-        else:
-            msg = "warning: %s\n" % msg
-
-        self.warnings.append(msg)
-        if self.show_warnings:
-            sys.stderr.write(msg)
-
-    def parse_element(self, node):
-        if node.tag not in self.tags:
-            self.error("Invalid element <%s>" % node.tag, node)
-            return None  # won't be able to parse this one
-        return getattr(self, "parse_" + node.tag)(node, self.tags[node.tag])
-
-    def parse_tag(self, root, fmt, insert_children=True):
-        """
-        Parse an odml node based on the format description *fmt*
-        and instantiate the corresponding object.
-        :param root: lxml.etree node containing an odML object or object tree.
-        :param fmt: odML class corresponding to the content of the root node.
-        :param insert_children: Bool value. When True, child elements of the root node
-                                will be parsed to their odML equivalents and appended to
-                                the odML document. When False, child elements of the
-                                root node will be ignored.
-        """
-        arguments = {}
-        extra_args = {}
-        children = []
-
-        for k, v in root.attrib.iteritems():
-            k = k.lower()
-            # 'version' is currently the only supported XML attribute.
-            if k == 'version' and root.tag == 'odML':
-                continue
-
-            # We currently do not support XML attributes.
-            self.error("Attribute not supported, ignoring '%s=%s'" % (k, v), root)
-
-        for node in root:
-            node.tag = node.tag.lower()
-            self.is_valid_argument(node.tag, fmt, root, node)
-            if node.tag in fmt.arguments_keys:
-                # this is a heuristic, but works for now
-                if node.tag in self.tags and node.tag in fmt.map_keys:
-                    sub_obj = self.parse_element(node)
-                    if sub_obj is not None:
-                        extra_args[fmt.map(node.tag)] = sub_obj
-                        children.append(sub_obj)
-                else:
-                    tag = fmt.map(node.tag)
-                    if tag in arguments:
-                        self.warn("Element <%s> is given multiple times in "
-                                  "<%s> tag" % (node.tag, root.tag), node)
-
-                    # Special handling of values;
-                    curr_text = node.text.strip() if node.text else None
-                    if tag == "values" and curr_text:
-                        content = from_csv(node.text)
-                        arguments[tag] = content
-                    else:
-                        arguments[tag] = curr_text
-            else:
-                self.error("Invalid element <%s> in odML document section <%s>"
-                           % (node.tag, root.tag), node)
-
-        if sys.version_info > (3,):
-            check_args = dict(list(arguments.items()) + list(extra_args.items()))
-        else:
-            check_args = dict(arguments.items() + extra_args.items())
-
-        self.check_mandatory_arguments(check_args, fmt, root.tag, root)
-
-        # Instantiate the current odML object with the parsed attributes.
-        obj = fmt.create(**arguments)
-
-        if insert_children:
-            for child in children:
-                obj.append(child)
-
-        return obj
-
-    def parse_odML(self, root, fmt):
-        doc = self.parse_tag(root, fmt)
-        return doc
-
-    def parse_section(self, root, fmt):
-        return self.parse_tag(root, fmt)
-
-    def parse_property(self, root, fmt):
-        return self.parse_tag(root, fmt, insert_children=False)
-
-
-if __name__ == '__main__':
-    from optparse import OptionParser
-    import odml.tools.dumper as dumper
-
-    parser = OptionParser()
-    (options, args) = parser.parse_args()
-
-    if len(args) < 1:
-        parser.print_help()
-    else:
-        dumper.dumpDoc(load(args[0]))
+/annex/objects/MD5-s34485--45288ffb6527cf24e4d2952b8a9b412f

+ 1 - 0
code/python-odml/odml/util.py

@@ -0,0 +1 @@
+/annex/objects/MD5-s2232--aba6d830de576be893af33a3c9109b5c

+ 1 - 299
code/python-odml/odml/validation.py

@@ -1,299 +1 @@
-# -*- coding: utf-8
-"""
-Generic odML validation framework
-"""
-
-LABEL_ERROR = 'error'
-LABEL_WARNING = 'warning'
-
-
-class ValidationError(object):
-    """
-    Represents an error found in the validation process
-
-    The error is bound to an odML-object (*obj*) or a list of
-    those and contains a message and a rank which may be one of:
-    'error', 'warning'.
-    """
-
-    def __init__(self, obj, msg, rank=LABEL_ERROR):
-        self.obj = obj
-        self.msg = msg
-        self.rank = rank
-
-    @property
-    def is_warning(self):
-        return self.rank == LABEL_WARNING
-
-    @property
-    def is_error(self):
-        return self.rank == LABEL_ERROR
-
-    @property
-    def path(self):
-        return self.obj.get_path()
-
-    def __repr__(self):
-        return "<ValidationError(%s):%s '%s'>" % (self.rank,
-                                                  self.obj,
-                                                  self.msg)
-
-
-class Validation(object):
-
-    _handlers = {}
-
-    @staticmethod
-    def register_handler(klass, handler):
-        """
-        Add a validation handler for a odml class.
-        *type* may be one of the following:
-         * odML
-         * section
-         * property
-
-        And is called in the validation process for each corresponding
-        object. The *handler* is assumed to be a generator function
-        yielding all ValidationErrors it finds:
-
-          handler(obj)
-
-        The section handlers are only called for sections and not for
-        the document node. If both are required, you need to register
-        the handler twice.
-        """
-        Validation._handlers.setdefault(klass, set()).add(handler)
-
-    def __init__(self, doc):
-        self.doc = doc  # may also be a section
-        self.errors = []
-        self.validate(doc)
-
-        for sec in doc.itersections(recursive=True):
-            self.validate(sec)
-            for prop in sec.properties:
-                self.validate(prop)
-
-    def validate(self, obj):
-        handlers = self._handlers.get(obj.format().name, [])
-        for handler in handlers:
-            for err in handler(obj):
-                self.error(err)
-
-    def error(self, validation_error):
-        """
-        Register an error found during the validation process
-        """
-        self.errors.append(validation_error)
-
-    def __getitem__(self, obj):
-        """return a list of the errors for a certain object"""
-        errors = []
-        for err in self.errors:
-            if err.obj is obj:
-                errors.append(err)
-        return errors
-
-
-# ------------------------------------------------
-# validation rules
-
-def section_type_must_be_defined(sec):
-    """test that no section has an undefined type"""
-    if sec.type is None or sec.type == '' or sec.type == 'undefined':
-        yield ValidationError(sec, 'Section type undefined', LABEL_WARNING)
-
-
-Validation.register_handler('section', section_type_must_be_defined)
-
-
-def section_repository_present(sec):
-    """
-    1. warn, if a section has no repository or
-    2. the section type is not present in the repository
-    """
-    repo = sec.get_repository()
-    if repo is None:
-        yield ValidationError(sec,
-                              'A section should have an associated repository',
-                              LABEL_WARNING)
-        return
-
-    try:
-        tsec = sec.get_terminology_equivalent()
-    except Exception as exc:
-        yield ValidationError(sec,
-                              'Could not load terminology: %s' % exc,
-                              LABEL_WARNING)
-        return
-
-    if tsec is None:
-        yield ValidationError(sec,
-                              "Section type '%s' not found in terminology" % sec.type,
-                              LABEL_WARNING)
-
-
-Validation.register_handler('section', section_repository_present)
-
-
-def document_unique_ids(doc):
-    """
-    Traverse an odML Document and check whether all
-    assigned ids are unique within the document.
-
-    Yields all duplicate odML object id entries
-    that are encountered.
-
-    :param doc: odML document
-    """
-    id_map = {doc.id: "Document '%s'" % doc.get_path()}
-    for i in section_unique_ids(doc, id_map):
-        yield i
-
-
-def section_unique_ids(parent, id_map=None):
-    """
-    Traverse a parent (odML Document or Section)
-    and check whether all assigned ids are unique.
-
-    A "id":"odML object / path" dictionary of additional
-    'to-be-excluded' ids may be handed in via the
-    *id_map* attribute.
-
-    Yields all duplicate odML object id entries
-    that are encountered.
-
-    :param parent: odML Document or Section
-    :param id_map: "id":"odML object / path" dictionary
-    """
-    if not id_map:
-        id_map = {}
-
-    for sec in parent.sections:
-        for i in property_unique_ids(sec, id_map):
-            yield i
-
-        if sec.id in id_map:
-            yield ValidationError(sec, "Duplicate id in Section '%s' and %s" %
-                                  (sec.get_path(), id_map[sec.id]))
-        else:
-            id_map[sec.id] = "Section '%s'" % sec.get_path()
-
-        for i in section_unique_ids(sec, id_map):
-            yield i
-
-
-def property_unique_ids(section, id_map=None):
-    """
-    Check whether all ids assigned to the odML
-    Properties of an odML Section are unique.
-
-    A "id":"odML object / path" dictionary of additional
-    'to-be-excluded' ids may be handed in via the
-    *id_map* attribute.
-
-    Yields all duplicate odML object id entries
-    that are encountered.
-
-    :param section: odML Section
-    :param id_map: "id":"odML object / path" dictionary
-    """
-    if not id_map:
-        id_map = {}
-
-    for prop in section.properties:
-        if prop.id in id_map:
-            yield ValidationError(prop, "Duplicate id in Property '%s' and %s" %
-                                  (prop.get_path(), id_map[prop.id]))
-        else:
-            id_map[prop.id] = "Property '%s'" % prop.get_path()
-
-
-Validation.register_handler('odML', document_unique_ids)
-
-
-def object_unique_names(obj, children, attr=lambda x: x.name,
-                        msg="Object names must be unique"):
-    """
-    Test that object names within one section are unique
-
-    *attr* is a function, that returns the item that needs to be unique
-
-    *children* is a function, that returns the children to be
-    considered. This is to be able to use the same function
-    for sections and properties
-    """
-    names = set(map(attr, children(obj)))
-    if len(names) == len(children(obj)):
-        return  # quick exit
-    names = set()
-    for i in children(obj):
-        if attr(i) in names:
-            yield ValidationError(i, msg, LABEL_ERROR)
-        names.add(attr(i))
-
-
-def section_unique_name_type(obj):
-    for i in object_unique_names(
-            obj,
-            attr=lambda x: (x.name, x.type),
-            children=lambda x: x.sections,
-            msg="name/type combination must be unique"):
-        yield i
-
-
-def property_unique_names(obj):
-    for i in object_unique_names(obj, lambda x: x.properties):
-        yield i
-
-
-Validation.register_handler('odML', section_unique_name_type)
-Validation.register_handler('section', section_unique_name_type)
-Validation.register_handler('section', property_unique_names)
-
-
-def property_terminology_check(prop):
-    """
-    Executes a couple of checks:
-
-    1. warn, if there are properties that do not occur in the terminology
-    2. warn, if there are multiple values with different units or the unit does
-       not match the one in the terminology
-    """
-    tsec = prop.parent.get_terminology_equivalent()
-    if tsec is None:
-        return
-    try:
-        tsec.properties[prop.name]
-    except KeyError:
-        yield ValidationError(prop,
-                              "Property '%s' not found in terminology" % prop.name,
-                              LABEL_WARNING)
-
-
-Validation.register_handler('property', property_terminology_check)
-
-
-def property_dependency_check(prop):
-    """
-    Warn, if the dependency attribute refers to a non-existent attribute
-    or the dependency_value does not match
-    """
-    dep = prop.dependency
-    if dep is None:
-        return
-
-    try:
-        dep_obj = prop.parent[dep]
-    except KeyError:
-        yield ValidationError(prop,
-                              "Property refers to a non-existent dependency object",
-                              LABEL_WARNING)
-        return
-
-    if prop.dependency_value not in dep_obj.values[0]:
-        yield ValidationError(prop, "Dependency-value is not equal to value of"
-                              " the property's dependency", LABEL_WARNING)
-
-
-Validation.register_handler('property', property_dependency_check)
+/annex/objects/MD5-s21689--e6a140c8fd2b317719d606dce54fd00e

+ 1 - 0
code/python-odml/setup.cfg

@@ -0,0 +1 @@
+/annex/objects/MD5-s38--3f78c6150b7d619a476c799812e31d5a

+ 1 - 52
code/python-odml/setup.py

@@ -1,52 +1 @@
-import json
-import os
-import sys
-
-try:
-    from setuptools import setup
-except ImportError as ex:
-    from distutils.core import setup
-
-with open(os.path.join("odml", "info.json")) as infofile:
-    infodict = json.load(infofile)
-
-VERSION = infodict["VERSION"]
-FORMAT_VERSION = infodict["FORMAT_VERSION"]
-AUTHOR = infodict["AUTHOR"]
-COPYRIGHT = infodict["COPYRIGHT"]
-CONTACT = infodict["CONTACT"]
-HOMEPAGE = infodict["HOMEPAGE"]
-CLASSIFIERS = infodict["CLASSIFIERS"]
-
-
-packages = [
-    'odml',
-    'odml.tools',
-    'odml.scripts'
-]
-
-with open('README.rst') as f:
-    description_text = f.read()
-
-install_req = ["lxml", "pyyaml==3.13", "rdflib", "docopt", "pathlib"]
-
-if sys.version_info < (3, 4):
-    install_req += ["enum34"]
-
-setup(
-    name='odML',
-    version=VERSION,
-    description='open metadata Markup Language',
-    author=AUTHOR,
-    author_email=CONTACT,
-    url=HOMEPAGE,
-    packages=packages,
-    test_suite='test',
-    install_requires=install_req,
-    include_package_data=True,
-    long_description=description_text,
-    classifiers=CLASSIFIERS,
-    license="BSD",
-    entry_points={'console_scripts': ['odmltordf=odml.scripts.odml_to_rdf:main',
-                                      'odmlconversion=odml.scripts.odml_conversion:main']}
-)
+/annex/objects/MD5-s1578--0352ffa74f3acd55250b810a7c1f0b11

+ 0 - 0
code/python-odml/test/__init__.py


+ 1 - 311
code/python-odml/test/resources/example.odml

@@ -1,311 +1 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet  type="text/xsl" href="odmlTerms.xsl"?>
-<?xml-stylesheet  type="text/xsl" href="odml.xsl"?>
-<odML version="1.1">
-  <version>42</version>
-  <section>
-    <name>TheCrew</name>
-    <property>
-      <type>person</type>
-      <name>NameCrewMembers</name>
-      <value>[Arthur Philip Dent,Zaphod Beeblebrox,Tricia Marie McMillan,Ford Prefect]</value>
-      <id>77cdad5c-5d74-4e9f-9d74-c1ce8e79e951</id>
-      <definition>List of crew members names</definition>
-    </property>
-    <property>
-      <type>int</type>
-      <uncertainty>1</uncertainty>
-      <name>NoCrewMembers</name>
-      <reference>The Hitchhiker's guide to the Galaxy (novel)</reference>
-      <value>[4]</value>
-      <id>05e14adf-1ca2-4b2d-984d-6c84814a84de</id>
-      <definition>Number of crew members</definition>
-    </property>
-    <section>
-      <name>Arthur Philip Dent</name>
-      <property>
-        <type>string</type>
-        <name>Species</name>
-        <value>[Human]</value>
-        <id>f64e9d6a-e38d-499e-a03f-fe59b91ad6ba</id>
-        <definition>Species to which subject belongs to</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Nickname</name>
-        <value>[The sandwich-maker]</value>
-        <id>c9dd7ae6-66a1-49f0-9853-80f2cdf6b574</id>
-        <definition>Nickname(s) of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Occupation</name>
-        <value>[]</value>
-        <id>76941971-132a-4b3a-94db-e3cf356ea429</id>
-        <definition>Occupation of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Gender</name>
-        <value>[male]</value>
-        <id>5f1a5e56-d893-47bd-989a-9d3a596bc29e</id>
-        <definition>Sex of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>HomePlanet</name>
-        <value>[Earth]</value>
-        <id>6470acca-5457-4a43-a61c-6744372dff3b</id>
-        <definition>Home planet of the subject</definition>
-      </property>
-      <definition>Information on Arthur Dent</definition>
-      <id>e547c987-4beb-4250-bcb3-1991c535e7e8</id>
-      <type>crew/person</type>
-    </section>
-    <section>
-      <name>Zaphod Beeblebrox</name>
-      <property>
-        <type>string</type>
-        <name>Species</name>
-        <value>[Betelgeusian]</value>
-        <id>861a8469-708e-4950-be71-12c640d7e7d6</id>
-        <definition>Species to which subject belongs to</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Nickname</name>
-        <value>[]</value>
-        <id>ba06784b-d323-45c8-bb52-918b727f2ef1</id>
-        <definition>Nickname(s) of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Occupation</name>
-        <value>[Ex-Galactic President]</value>
-        <id>09b96b49-7bf3-4449-9e43-62d87bb23f16</id>
-        <definition>Occupation of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Gender</name>
-        <value>[male]</value>
-        <id>41f4ab65-afda-43c9-aa08-a384c9fba585</id>
-        <definition>Sex of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>HomePlanet</name>
-        <value>[A planet in the vicinity of Betelgeuse]</value>
-        <id>c81063a1-4727-4d51-bdfd-574923f387ab</id>
-        <definition>Home planet of the subject</definition>
-      </property>
-      <definition>Information on Zaphod Beeblebrox</definition>
-      <id>5d22732f-ebfd-494d-9fb0-0e938fc83291</id>
-      <type>crew/person</type>
-    </section>
-    <section>
-      <name>Tricia Marie McMillan</name>
-      <property>
-        <type>string</type>
-        <name>Species</name>
-        <value>[Human]</value>
-        <id>087d4862-50a5-4764-a2b5-01dded29ccab</id>
-        <definition>Species to which subject belongs to</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Nickname</name>
-        <value>[Trillian Astra]</value>
-        <id>15fef4d3-a9ed-4fc2-95db-7f7c90d85a8c</id>
-        <definition>Nickname(s) of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Occupation</name>
-        <value>[]</value>
-        <id>4ab85d8a-f884-4ef7-bf33-0d42044d95bb</id>
-        <definition>Occupation of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Gender</name>
-        <value>[female]</value>
-        <id>dd553e39-b3b1-4ef2-9b21-6145a3222d15</id>
-        <definition>Sex of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>HomePlanet</name>
-        <value>[Earth]</value>
-        <id>fe2abddf-f2e7-43f3-b3db-0932f94e17e9</id>
-        <definition>Home planet of the subject</definition>
-      </property>
-      <definition>Information on Trillian Astra</definition>
-      <id>b85c4c2d-4722-48fa-a118-5c2f553d7282</id>
-      <type>crew/person</type>
-    </section>
-    <section>
-      <name>Ford Prefect</name>
-      <property>
-        <type>string</type>
-        <name>Species</name>
-        <value>[Betelgeusian]</value>
-        <id>1493fb9b-6fb2-479e-923c-61242567ffd7</id>
-        <definition>Species to which subject belongs to</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Nickname</name>
-        <value>[Ix]</value>
-        <id>4b6eb605-dbfb-40e0-83c4-acca43e4fdbb</id>
-        <definition>Nickname(s) of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Occupation</name>
-        <value>[Researcher/Reporter]</value>
-        <id>3a69dba5-c780-447a-b9d9-e8da3cbbd4f4</id>
-        <definition>Occupation of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>Gender</name>
-        <value>[male]</value>
-        <id>01b8b16c-c80b-4432-93a9-0fab8de74e22</id>
-        <definition>Sex of the subject</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>HomePlanet</name>
-        <value>[A planet in the vicinity of Betelgeuse]</value>
-        <id>f47c0d5e-e2b8-425b-83f3-57bcbe44164d</id>
-        <definition>Home planet of the subject</definition>
-      </property>
-      <definition>Information on Ford Prefect</definition>
-      <id>97cbf33c-5aa8-41af-b158-13247e7481dd</id>
-      <type>crew/person</type>
-    </section>
-    <definition>Information on the crew</definition>
-    <id>6df940b5-b502-4749-8ad9-33d7432064f3</id>
-    <type>crew</type>
-  </section>
-  <section>
-    <name>TheStarship</name>
-    <property>
-      <type>string</type>
-      <name>Name</name>
-      <value>[Heart of Gold]</value>
-      <id>b0f80f23-e976-4a06-b146-b81e5f565d6b</id>
-      <definition>Name of person/device</definition>
-    </property>
-    <property>
-      <type>string</type>
-      <name>OwnerStatus</name>
-      <value>[stolen]</value>
-      <id>43b26234-6023-4e7f-8bc4-401b0fd0504a</id>
-      <definition>Owner status of device</definition>
-    </property>
-    <property>
-      <type>string</type>
-      <name>DriveType</name>
-      <value>[Infinite Propability Drive]</value>
-      <id>828d51ea-f5c8-4525-b2ff-757555449190</id>
-      <definition>Type of drive</definition>
-    </property>
-    <property>
-      <type>string</type>
-      <name>Technology</name>
-      <value>[secret]</value>
-      <id>0117aaa2-fa5d-4623-a63c-4342733205ec</id>
-      <definition>Technology used to built device</definition>
-    </property>
-    <property>
-      <type>float</type>
-      <name>Length</name>
-      <unit>m</unit>
-      <value>[150.0]</value>
-      <id>7e2a3940-833c-407b-9047-918d317af204</id>
-      <definition>Length of device</definition>
-    </property>
-    <property>
-      <type>string</type>
-      <name>Shape</name>
-      <value>[various]</value>
-      <id>f34bfcbb-1a57-4905-bc8b-ef953c0e736e</id>
-      <definition>Shape of device</definition>
-    </property>
-    <property>
-      <type>string</type>
-      <name>FactoryPlanet</name>
-      <value>[Damogran]</value>
-      <id>c39386b4-2023-4dd3-bf03-57bd3c65d5c0</id>
-      <definition>Planet where device was constructed</definition>
-    </property>
-    <section>
-      <name>Cybernetics</name>
-      <property>
-        <type>int</type>
-        <name>NoOfCybernetics</name>
-        <value>[2]</value>
-        <id>534155a2-8d6a-471d-a7cb-8a950ff5e157</id>
-        <definition>Number of cybernetic robots on the ship</definition>
-      </property>
-      <property>
-        <type>string</type>
-        <name>NamesOfCybernetics</name>
-        <value>[Marvin,Eddie]</value>
-        <id>7c00d7e3-2822-42b5-b5b3-b5c7dc51f67e</id>
-        <definition>Names of cybernetic robots on the ship</definition>
-      </property>
-      <section>
-        <name>Marvin</name>
-        <property>
-          <type>string</type>
-          <name>Type</name>
-          <value>[Genuine People Personality]</value>
-          <id>7f74bd80-4d08-43b3-aedc-7e3668b48d34</id>
-          <definition>Type of robot</definition>
-        </property>
-        <property>
-          <type>string</type>
-          <name>Manufacturer</name>
-          <value>[Sirius Cybernetics Corporation]</value>
-          <id>45cb21b1-b0e6-4eb0-a153-2059dd3d3444</id>
-          <definition>Manufacturer of robots</definition>
-        </property>
-        <definition>Information on Marvin</definition>
-        <id>2d66ac3e-5d25-45cc-89c1-1cc5890daa7b</id>
-        <type>starship/cybernetics</type>
-      </section>
-      <section>
-        <name>Eddie</name>
-        <property>
-          <type>string</type>
-          <name>Type</name>
-          <value>[Genuine People Personality]</value>
-          <id>2899d6df-7f15-48f5-aa11-aa368ba75eeb</id>
-          <definition>Type of robot</definition>
-        </property>
-        <property>
-          <type>string</type>
-          <name>Manufacturer</name>
-          <value>[Sirius Cybernetics Corporation]</value>
-          <id>dda738bb-47e4-462b-821c-ea900633dbee</id>
-          <definition>Manufacturer of robots</definition>
-        </property>
-        <definition>Information on Eddie</definition>
-        <id>953852d6-bbca-44d5-bad1-fb9bbca08655</id>
-        <type>starship/cybernetics</type>
-      </section>
-      <definition>Information on cybernetics present on the ship</definition>
-      <id>4f6f4994-cc0f-4d10-a643-4cdda5aa8248</id>
-      <type>starship/cybernetics</type>
-    </section>
-    <definition>Information on the starship</definition>
-    <id>38a36e78-ceca-4045-87a5-53a4dac29f10</id>
-    <type>starship</type>
-  </section>
-  <author>D. N. Adams</author>
-  <date>1979-10-12</date>
-  <id>cf6d24de-c780-4ad2-91ce-45dd5157d6b8</id>
-</odML>
+/annex/objects/MD5-s10839--489bec5f8741d7f9f6767e1448a99781

+ 1 - 0
code/python-odml/test/resources/ignore_errors.xml

@@ -0,0 +1 @@
+/annex/objects/MD5-s1877--0d7dca9319f9633ecae7e09c26d308f4

+ 1 - 5
code/python-odml/test/resources/invalid_root.xml

@@ -1,5 +1 @@
-<invalid>
-  <date>2018-02-27</date>
-  <version>1.0</version>
-  <author>Test author</author>
-</invalid>
+/annex/objects/MD5-s102--b5d5d71cb96686fe40942a09ee02c11c

+ 1 - 9
code/python-odml/test/resources/invalid_version.json

@@ -1,9 +1 @@
-{
-    "odml-version": "invalid",
-    "Document": {
-        "date": "2018-02-27",
-        "version": "1.0",
-        "sections": [],
-        "author": "Test author"
-    }
-}
+/annex/objects/MD5-s170--786ea762d8cfddee24224e9ae82d9187

+ 1 - 5
code/python-odml/test/resources/invalid_version.xml

@@ -1,5 +1 @@
-<odML version="invalid">
-  <date>2018-02-27</date>
-  <version>1.0</version>
-  <author>Test author</author>
-</odML>
+/annex/objects/MD5-s114--f5120e3ef39be5f276ca687555966210

+ 1 - 6
code/python-odml/test/resources/invalid_version.yaml

@@ -1,6 +1 @@
-Document:
-  author: Test author
-  date: '2018-02-27'
-  sections: []
-  version: '1.0'
-odml-version: 'totallyUnsupported'
+/annex/objects/MD5-s119--f394e29d09883672e28309089104b9d4

+ 1 - 6
code/python-odml/test/resources/local_repository_file_v1.0.xml

@@ -1,6 +1 @@
-<odML version="1.0">
-    <section>
-        <name>Repository test</name>
-        <type>odML 1.0 document</type>
-    </section>
-</odML>
+/annex/objects/MD5-s134--321e53952f7621af6a735cef5d16494d

+ 1 - 6
code/python-odml/test/resources/local_repository_file_v1.1.xml

@@ -1,6 +1 @@
-<odML version="1.1">
-    <section>
-        <name>Repository test</name>
-        <type>odML 1.1 document</type>
-    </section>
-</odML>
+/annex/objects/MD5-s134--f87f5a86def7a743beb4ebfe7408c41e

+ 1 - 6
code/python-odml/test/resources/missing_root.json

@@ -1,6 +1 @@
-{
-    "odml-version": "1.1",
-    "sometag": {
-      "Document": "somecontent"
-    }
-}
+/annex/objects/MD5-s85--64fc1fdc7f9ee207b6d6797a9101d9f5

+ 1 - 2
code/python-odml/test/resources/missing_root.yaml

@@ -1,2 +1 @@
-Root:
-  some: value
+/annex/objects/MD5-s20--2bb096f90c38f495b48b2df964ada311

+ 1 - 8
code/python-odml/test/resources/missing_version.json

@@ -1,8 +1 @@
-{
-    "Document": {
-        "date": "2018-02-27",
-        "version": "1.0",
-        "sections": [],
-        "author": "Test author"
-    }
-}
+/annex/objects/MD5-s139--6d6c074b796a1bb5f4230550609599c5

+ 1 - 5
code/python-odml/test/resources/missing_version.xml

@@ -1,5 +1 @@
-<odML>
-  <date>2018-02-27</date>
-  <version>1.0</version>
-  <author>Test author</author>
-</odML>
+/annex/objects/MD5-s96--1b44c7be3b5a1a3c0bbbe2d302a6025b

+ 1 - 5
code/python-odml/test/resources/missing_version.yaml

@@ -1,5 +1 @@
-Document:
-  author: Test author
-  date: '2018-02-27'
-  sections: []
-  version: '1.0'
+/annex/objects/MD5-s85--3e14913b372d817b7e32f3406d089190

+ 0 - 0
code/python-odml/test/resources/scripts/odml_convert/conversion_example_A.xml


Some files were not shown because too many files changed in this diff