From 26318d869e28e17d6eeb7cb669e1e9574cfe0418 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Wed, 22 Jan 2020 15:26:53 +0100 Subject: [PATCH 1/5] Update changelog --- CHANGELOG.md | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28572a4f..4dd0c210 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,53 @@ Used to document all changes from previous releases and collect changes until the next release. -# Latest changes in master +# Version 1.4.4 + +## Introduction of inline style sheet + +The `XMLWriter` can now be used to save an XML odML document with an inline XSL stylesheet for rendered viewing via a web browser. +The document can be saved with the current default G-Node odML document style or with a custom style. When a document containing such a stylesheet is loaded, the style is lost and needs to be provided again as described above. See issue #331 for details. + +## Export leaf feature + +Subsets of odML documents can now be exported using the introduced `export_leaf` features for `Section` and `Property`. +When invoked on a `Section` or a `Property`, the method will return all direct ancestor `Sections` including all their direct `Properties` up to the root of the document and return a new, cloned document containing only this particular direct branch. See issue #340 for details. + +## Major pyyaml dependency fix + +Since issue #291 the odml package had its pyyaml dependency fixed to version `4.2b4`. +This release fixes the original problem with the pyyaml distribution and removes the fix to pyyaml version `4.2b4`. +See issue #343 and pull request #344 for details. + +## odML package structure changes to reduce import cycles + +The package structure was changed to reduce the number of import cycles and make various parser classes more easily available via the `__init__` files. See issues #317 and #333 for details. + +The changes to the package structure should not affect any of the main parsers and how they were previously imported nor affect any of the command line scripts provided with this package. + +The following changes have been introduced to the package structure: +- a new subdirectory `odml.tools.converters` is added. +- `format_converter` and `version_converter` are moved into this directory. +- since [odml-ui](https://github.com/G-Node/odml-ui) depends on the `version_converter`, a dummy file is left at its original location. It imports the `VersionConverter` class from its new location and prints a deprecation warning. +- the dict `RDFConversionFormats` from file `tools.utils` has been moved to `RDF_CONVERSION_FORMATS` in file `tools.parser_utils` and all usages have been switched to the new dict. +- the dict `ConversionFormats` from file `tools.utils` has been moved to the only file its using it, `tools.converters.format_converter`. +- the now unused file `tools.utils` has been removed. +- a new subdirectory `odml.rdf` was added and the files `fuzzy_finder` and `query_creator` were moved into this directory. Both files provide convenience and additional functions for odML specific RDF and are fairly independent from the rest of the library. Conceptually they are best kept separate from other convenience tools and parsers. ## Minor changes, updates and fixes + - The `section_subclasses.yaml` file is moved from the `doc` folder to the new `odml/resources` folder. This allows usage of the file with all install options. See issue #212 for details. +- The RDF subclasses now also support DataCite Section types. +- The `rdf_converter` now features a new `load_rdf_subclasses` function, that either provides the content of the `resources/subclasses.yml` file or, if it cannot be accessed, deals with it without breaking the `RDFWriter`. +- Fixes calling the deprecated `odml.Property.value` attribute in the `rdf_converter`. +- The `RDFWriter` will now call every odml documents `finalize` method to ensure that all `links` and `includes` are resolved before exporting to RDF. +- The OWL odml ontology file is moved from `doc/root-ontology.ttl` to `odml/resources/odml-ontology.ttl` and included in `Manifest.in`. +- The RDF namespace is changed from https://g-node.org/projects/odml-rdf# to https://g-node.org/odml-rdf#. This step is taken since the odml-rdf ontology OWL file will be available under this URL. This change includes changes in all code and documentation occurrences in the project. +- Typos and minor inconsistencies where fixed in the odml - RDF subclasses mapping file `resources/section_subclasses.yaml`. +- The OWL odml ontology file `resources/odml-ontology.ttl` has been restructured: + - all available subclasses where moved to their own file section. + - all subclasses that are created via the `resources/section_subclasses.yaml` file have been added to the ontology file as well. +- Value errors concerning `date`, `time` and `datetime` now contain a message providing the required format. See issue #341 for details. # Version 1.4.3 From cb0787399b41b465d392758216407f515d56b147 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Wed, 22 Jan 2020 15:29:19 +0100 Subject: [PATCH 2/5] [setup.py] Remove pyyaml dependency fix With PR #344 the pyyaml dependency no longer needs to be fixed to version 4.2b4. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c22f666e..30f9ad37 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ with open('README.md') as f: description_text = f.read() -install_req = ["lxml", "pyyaml==4.2b4", "rdflib", "docopt", "pathlib"] +install_req = ["lxml", "pyyaml", "rdflib", "docopt", "pathlib"] if sys.version_info < (3, 4): install_req += ["enum34"] From 78d8cc11c1c6dcfc591ac2c4ee62a9feadbda152 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Wed, 22 Jan 2020 15:31:33 +0100 Subject: [PATCH 3/5] [info] Update version number and (c) date Also removes Python 2.7 from the PyPI classifiers list since Python 2 has reached end of life. --- doc/conf.py | 2 +- odml/info.json | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 2f2a4512..1da48b8b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -75,7 +75,7 @@ def __new__(meta, name, bases, clsdict): # General information about the project. project = u'python-odml' -copyright = u'2011-2018, German Neuroinformatics Node (G-Node); based on work by Hagen Fritsch' +copyright = u'2011-2020, 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 diff --git a/odml/info.json b/odml/info.json index 23991854..d624f88e 100644 --- a/odml/info.json +++ b/odml/info.json @@ -1,14 +1,13 @@ { - "VERSION": "1.4.3", + "VERSION": "1.4.4", "FORMAT_VERSION": "1.1", "AUTHOR": "Hagen Fritsch, Jan Grewe, Christian Kellner, Achilleas Koutsou, Michael Sonntag, Lyuba Zehl", - "COPYRIGHT": "(c) 2011-2019, German Neuroinformatics Node", + "COPYRIGHT": "(c) 2011-2020, German Neuroinformatics Node", "CONTACT": "dev@g-node.org", "HOMEPAGE": "https://github.com/G-Node/python-odml", "CLASSIFIERS": [ "Development Status :: 5 - Production/Stable", "Programming Language :: Python", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", From af41ae1bf09de70b1d19ac30b2aa024bc33286f8 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Wed, 22 Jan 2020 19:37:56 +0100 Subject: [PATCH 4/5] [setup] Set pyyaml minimum version Sucessfully tested pyyaml version 5.1 with python 2.7, 3.7 and 3.8 and use it as the new minimal version of pyyaml. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 30f9ad37..9418eda0 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ with open('README.md') as f: description_text = f.read() -install_req = ["lxml", "pyyaml", "rdflib", "docopt", "pathlib"] +install_req = ["lxml", "pyyaml>=5.1", "rdflib", "docopt", "pathlib"] if sys.version_info < (3, 4): install_req += ["enum34"] From f701013e41293a076543540870d2262d87275642 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Wed, 22 Jan 2020 20:03:58 +0100 Subject: [PATCH 5/5] [travis] Remove pyyaml restriction --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5a669c6d..5244dfb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ install: export PIPCMD=pip; fi; - - $PIPCMD install lxml enum34 pyyaml==4.2b4 rdflib + - $PIPCMD install lxml enum34 pyyaml rdflib script: - which $PYCMD