Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include LICENSE
include README.rst
include odml/info.json
include doc/section_subclasses.yaml
include odml/resources/section_subclasses.yaml
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -51,4 +71,4 @@ stimulus/sine_wave: Sinewave
stimulus/square_wave: Squarewave
stimulus/white_noise: Whitenoise
subject: Subject
carmen_mini: CarmenMini
carmen_mini: CarmenMini
12 changes: 8 additions & 4 deletions odml/tools/rdf_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down Expand Up @@ -125,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))
Expand Down
2 changes: 1 addition & 1 deletion test/test_rdf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down