openMetadataInitiative / openMINDS_core

The openMINDS core metadata model includes schemas that can be used to describe the general origin, location and content of research products.
MIT License
20 stars 19 forks source link

update all $ref to resolve in jsonschema.RefResolver #19

Closed lzehl closed 4 years ago

lzehl commented 4 years ago

The schemas are defined here on the GitHub. If people are downloading the schemas in order use them for example in a Python script the $ref need to resolve in the jsonschema.RefResolver. Solution:

lzehl commented 4 years ago

Feedback from Stefan: should resolve using the link to the GitHub file (raw).

jcolomb commented 4 years ago

While technically easier to implement (one can get a part of the schema and get the other part directly via links to github), the link to the github file has some issues:

lzehl commented 4 years ago

All good points I agree. Not sure how to proceed though.

For versioning: in the best case I can imagine, the schemas are version dependent, but the $ref is rather independent of the version (schema should be at the same location).

Problem at the moment: $id is currently only an identifier, but does not lead to a downloadable file.

Not sure if indirect paths could be used as $ref to get to functionally usable schemas on a local machine.

I can't really find nice examples online, although I would have thought that this is a common problem...

lzehl commented 4 years ago

Feedback from Tom:

I will follow this approach. The references in the definitions.json file are easier to maintain. If we stumble upon another solution we can modify it again.

lzehl commented 4 years ago

@UlrikeS91 : thanks for helping. Here what needs to be done (v1.0):

UlrikeS91 commented 4 years ago

Hi @lzehl,

I added "definitions" to all schemata (each as it's own pull request). For some of them, I had some additional comments. Here a summary:

  1. I noted down whenever a ref wasn't referring to the correct name of the schema. I don't know if this is important information, but it's an inconsistency. You need to be the judge on whether or not this is interesting. FYI most of them were replaced by the "#ref" anyway and schema names are correctly referenced in the definitions schema (I checked that).

  2. MINDS "external" references: Some $ref's point to schemata that don't belong to the minds project. What should be done for those? Specifically, these are: Files (cscs), DOI (datacite) and Ontologies (ontology).

  3. MINDS "internal" references without schemata: Some $ref's point to schemata that do belong to the minds project, but the schemata don't exist as part of v1. What should be done with those? Should the schemata be added to v1? Specifically, these are: parcellationatlas (minds) and parcellationregion (minds).

All remarks can be looked up here: #24, #33, #37, #43.

lzehl commented 4 years ago

@UlrikeS91 : thanks for all the updates! I'm going to take care of the remaining issues before I close this issue. These open issues include : update missing v1.0 schemas, basic check if references are working as expected

skoehnen commented 4 years ago

We should discuss the URL issue with the Knowledge Graph team, the best solution would be to get https://schema.hbp.eu up and running and deploy openMINDS there.

lzehl commented 4 years ago

This issue is in principle solved at the moment (cf. v1.0). I will close it and open a specific issue on the domain vs raw ref to schemas ($id vs `@type; raw vs domain ref)