ropensci / datapack

An R package to handle data packages
https://docs.ropensci.org/datapack
44 stars 9 forks source link

Verify the required dc:modified and dc:Agent statements get added to Resource Maps #81

Closed amoeba closed 7 years ago

amoeba commented 7 years ago

I'm creating this ticket after a discussion on the arctic-data repo (on our NCEAS GHE) about resource maps showing up that were not compliant with the OAI-ORE spec for Resource Maps.

From the spec

4.2 Metadata about the Resource Map and Aggregation

A Resource Map MUST express minimal metadata properties about the Resource Map. Those metadata properties are:

  • The identity of the authoring authority (human, organization, or agent) of the Resource Map, using the dcterms:creator predicate, with an object that MUST be a reference to a Resource of type http://purl.org/dc/terms/Agent. This MAY then be the subject of the following triples:
  • The last modification date-timestamp of the Resource Map, using the dcterms:modified term. This date-timestamp MUST be updated when the triples asserted within the Resource Map, and expressed in the serializations of that Resource Map, change so that consuming clients of the can determine appropriate actions.

A quick glance of the code makes it look like the dc:modified term is always added (good!) but the Agent statement is only added if the creator argument is set when createFromTriples is called. Because these are required, it would be good to exercise this a bit and, ideally, write a test or two to verify the createFromTriples method always produces spec-complaint Resource Map RDF/XML.

gothub commented 7 years ago

@amoeba The current development version of dataone uploadDataPackage does create resource maps with creator="DataONE R Client", but as you point out, there is no current default. Since arcticdatautils and potentially anyone else could create resource maps without specifying a creator, should a default value be set in createFromTriples? What would the value be?

amoeba commented 7 years ago

Yeah I think so. Since arcticdatautils only uses createFromTriples, that would explain the missing Agent on those resource maps. My mistake! createFromTriples seems to be the best place to put the default behavior.

Continuing to use "DataONE R Client" is reasonable. I guess it's either that, datapack, or redland. What do you think?

gothub commented 7 years ago

@amoeba Note that the creator and modified time fix is not on CRAN yet, and has only been in github for about 3 weeks.

Sounds good, I'll update createFromTriples to set the default of 'DataONE R Client`.

amoeba commented 7 years ago

Sounds great, thanks @gothub

gothub commented 7 years ago

Fixed in commit 888d2a70bbb7d7f082e39424a429429bb6b989f4

amoeba commented 7 years ago

Thanks!