From b91417f7cddfcbdf06872fc2755c6f5b8f736bde Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Thu, 31 Oct 2019 18:21:08 +0100 Subject: [PATCH 1/5] [RDF/subsections] Add datacite types --- doc/section_subclasses.yaml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/section_subclasses.yaml b/doc/section_subclasses.yaml index 2640720b..88ea6064 100644 --- a/doc/section_subclasses.yaml +++ b/doc/section_subclasses.yaml @@ -2,7 +2,27 @@ analysis: Analysis analysis/psth: PSTH analysis/power_spectrum: PowerSpectrum cell: Cell +datacite/alternate_identifier: AlternateIdentifier +datacite/contributor: Contributer +datacite/contributor/affiliation: Affiliation +datacite/contributor/named_identifier: NamedIdentifier +datacite/creator: Creator +datacite/creator/affiliation: Affiliation +datacite/creator/named_identifier: NamedIdentifier +datacite/date: Date +datacite/description: Description +datacite/format: Format +datacite/funding_reference: FundingReference +datacite/geo_location: GeoLocation +datacite/identifier: Identifier +datacite/related_identifier: RelatedIdentifier +datacite/resource_type: ResourceType +datacite/rights: Rights +datacite/size: Size +datacite/subject: Subject +datacite/title: Title dataset: Dataset +data_reference: DataReference blackrock: Blackrock electrode: Electrode event: Event @@ -51,4 +71,4 @@ stimulus/sine_wave: Sinewave stimulus/square_wave: Squarewave stimulus/white_noise: Whitenoise subject: Subject -carmen_mini: CarmenMini \ No newline at end of file +carmen_mini: CarmenMini From 8ea96a706c3b509287104eaf4bb52b66561b546d Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Mon, 4 Nov 2019 12:27:52 +0100 Subject: [PATCH 2/5] [tools/rdfconverter] Add subsection file warning --- odml/tools/rdf_converter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odml/tools/rdf_converter.py b/odml/tools/rdf_converter.py index ceb18885..921df0a3 100644 --- a/odml/tools/rdf_converter.py +++ b/odml/tools/rdf_converter.py @@ -53,6 +53,8 @@ def __init__(self, odml_documents): except yaml.parser.ParserError as err: print(err) return + else: + print("[Warning] Could not find subclass file '%s'" % subclass_path) def convert_to_rdf(self): self.hub_root = URIRef(odmlns.Hub) From afdc61e8838d37e8f44b6b04b617db7509904116 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Mon, 4 Nov 2019 12:50:27 +0100 Subject: [PATCH 3/5] [tools/rdfconverter] Get 'values' attribute --- odml/tools/rdf_converter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/odml/tools/rdf_converter.py b/odml/tools/rdf_converter.py index 921df0a3..759b591e 100644 --- a/odml/tools/rdf_converter.py +++ b/odml/tools/rdf_converter.py @@ -127,8 +127,10 @@ def save_element(self, e, node=None): 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) + k == 'value' and len(getattr(e, fmt.map(k))) > 0: + # "value" needs to be mapped to its appropriate + # Property library attribute. + values = getattr(e, fmt.map(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)) From 01b8aecc0e8bb606c63959381dd19dff22d3366d Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Mon, 4 Nov 2019 15:10:25 +0100 Subject: [PATCH 4/5] [tools] Move section_subclasses.yaml Closes #212 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. --- CHANGELOG.md | 3 +++ MANIFEST.in | 2 +- {doc => odml/resources}/section_subclasses.yaml | 0 odml/tools/rdf_converter.py | 4 ++-- test/test_rdf_writer.py | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) rename {doc => odml/resources}/section_subclasses.yaml (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index d924697a..28572a4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ until the next release. # Latest changes in master +## 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. + # Version 1.4.3 ## Introduction of odML templates support and update in odML terminology handling diff --git a/MANIFEST.in b/MANIFEST.in index cdd06f95..056a4135 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ include LICENSE include README.rst include odml/info.json -include doc/section_subclasses.yaml +include odml/resources/section_subclasses.yaml diff --git a/doc/section_subclasses.yaml b/odml/resources/section_subclasses.yaml similarity index 100% rename from doc/section_subclasses.yaml rename to odml/resources/section_subclasses.yaml diff --git a/odml/tools/rdf_converter.py b/odml/tools/rdf_converter.py index 759b591e..5ffb4c6d 100644 --- a/odml/tools/rdf_converter.py +++ b/odml/tools/rdf_converter.py @@ -43,8 +43,8 @@ def __init__(self, odml_documents): self.section_subclasses = {} - subclass_path = os.path.join(dirname(dirname(dirname(abspath(__file__)))), - 'doc', 'section_subclasses.yaml') + subclass_path = os.path.join(odml.__path__[0], 'resources', + 'section_subclasses.yaml') if os.path.isfile(subclass_path): with open(subclass_path, "r") as f: diff --git a/test/test_rdf_writer.py b/test/test_rdf_writer.py index dc8b33d4..7edcc88e 100644 --- a/test/test_rdf_writer.py +++ b/test/test_rdf_writer.py @@ -132,7 +132,7 @@ def test_adding_values(self): object=Literal("val")))), 3) def test_section_subclass(self): - p = os.path.join(dirname(dirname(abspath(__file__))), 'doc', 'section_subclasses.yaml') + p = os.path.join(odml.__path__[0], 'resources', 'section_subclasses.yaml') with open(p, "r") as f: subclass = yaml.load(f) From 033932924bb40f540d1e4e67073395b7db4678e7 Mon Sep 17 00:00:00 2001 From: "M. Sonntag" Date: Thu, 7 Nov 2019 12:56:48 +0100 Subject: [PATCH 5/5] [docs/index] Update DOI section - fix invalid DOI link in Dragly reference - add Sprenger DOI reference --- docs/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 5e384b57..fe088af0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -135,7 +135,8 @@ its identifier RRID:SCR_001376 and/or the reference: ### Referenced By -- Dragly et al (2018) [doi:10.3389/fninf.2018.000169](https://doi.org/10.3389/fninf.2018.000169) +- Sprenger et al (2019) [doi:10.3389/fninf.2019.00062](https://doi.org/10.3389/fninf.2019.00062) +- Dragly et al (2018) [doi:10.3389/fninf.2018.00016](https://doi.org/10.3389/fninf.2018.00016) - 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)