Implementing separate methods for JSON and JSONLD - #494
Conversation
Adds methods - parse_sssom_jsonld - from_sssom_jsonld - write_jsonld - to_jsonld - test_parse_sssom_jsonld - test_write_sssom_jsonld Which are exactly analogous to what was there before for JSON.
| self.mapping_count, | ||
| f"{path} has the wrong number of mappings.", | ||
| ) | ||
|
|
There was a problem hiding this comment.
Little @cthoyt in Nicos head:
AGAIN??? Please add short explicit tests so I can understand what is going, in particular the difference between JSON and JSONLD serialisations.
There was a problem hiding this comment.
@matentzn: I will add tests after we have had some discussions on the nature of the JSON output.
The problem we might run into with that is that, as far as I know (and as I have noted in the discussion about the extension slots), LinkML does not have a "curie_map": {
"FBbt": "http://purl.obolibrary.org/obo/FBbt_"
}but unless I missed something in LinkML’s docs, this is not possible. All we can do is to have a list (i.e. a “multi-valued” field) of custom “dictionary entry“ types, like this: "curie_map": [
{ "key": "Fbbt",
"value": "http://purl.obolibrary.org/obo/FBbt_" }
]which of course would work but would be… weird, at the very least. My own solution (that nobody will like, I know) to that is simple: decide that CURIEfied identifiers are only for the TSV format (which is what the spec currently says, incidentally), JSON should only contain full-length identifiers. No CURIE map needed, problem solved. |
This PR adds methods
Which are exactly analogous to what was there before for JSON.
But its actual purpose is not so much to add those methods, but to carefully review the format (to make sure we are happy) so we can start making headway on mapping-commons/sssom#321.
Breaking changes
jsonparameter now refers tojson, but used to refer tojsonld. So anyone expectingjsonldwill now be served withjson.JSON Format
We need to make sure that the JSON format looks exactly as we envision it. Problems I see so far
curie_map. We will probably have to [New metadata element]:MappingSet.curie_mapsssom#225Here is an example JSON file
The two remaining errors are also exactly due to this problem: