Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mappings set not represented in the @context file #119

Open
richardofsussex opened this issue Oct 11, 2023 · 4 comments
Open

Mappings set not represented in the @context file #119

richardofsussex opened this issue Oct 11, 2023 · 4 comments

Comments

@richardofsussex
Copy link

Looking to include a simple mapping to another concept (a skos:exactMatch), I found that I couldn't include the set of mappings in my primary block, because my mappings are an anonymous array and items within a block have to have a key. The documentation suggests that the mappings set should have the key "mappings", but this is not reflected in the context document.

The examples of mappings show the mapping block, but not the context (i.e. the array) within which each one sits.

@nichtich
Copy link
Member

Do you refer to this example?:

{
    "@context": "https://gbv.github.io/jskos/context.json",
    "type": [
      "http://www.w3.org/2004/02/skos/core#exactMatch"
    ],
    "from": {
      "memberSet": [
        {
          "uri": "https://data.ng.ac.uk/0G0S-0008-0000-0000"
        }
      ]
    },
    "to": {
      "memberSet": [
        {
          "uri": "http://vocab.getty.edu/tgn/7004264"
        },
        {
          "uri": "https://sws.geonames.org/3177090"
        },
        {
          "uri": "https://www.wikidata.org/entity/Q13362"
        }
      ]
    }
  }
}

The purpose of @context is to define a mapping from JSKOS/JSON-LD to RDF triples but JSKOS Mappings goes beyond the simple SKOS model of mappings as plain triples. There is no common way to express one-to-many mappings in SKOS nor metadata about mappings (could be done by blank nodes or RDF*) so the JSKOS context file does not specify what to do with mapping data. Just converting all mappings to RDF statements is also problematic because mappings are not necessarily "true" in the same sense as other information (labels, relations...) but they may have author, date, annotation...

If you describe your use case, I might give hints how to best process JSKOS Mapping data to get RDF and this guidelines should make it into JSKOS specification.

tl;dr: JSKOS mappings are not supposed to automatically transformed to RDF triples without additional configuration.

@richardofsussex
Copy link
Author

We would be happy with a set of simple SKOS-like mappings. I can understand your wanting to improve on SKOS with regard to the metadata/contextual data associated with mappings, but we are aiming for an API where the concept's URI resolves to a single block of JSON. Therefore we would like to have a mappings array containing one or more SKOS-style mappings which can fit within this single block. Is this possible in JSKOS as it stands? - it's entirely possible that I have just missed the relevant piece of documentation.

@nichtich
Copy link
Member

If your example is meant to encodes three 1-to-1 mappings (instead of one 1-to-n mappings, not expressible in core SKOS anyway) the format should better be:

{
  "@context": "https://gbv.github.io/jskos/context.json",
  "uri": "https://data.ng.ac.uk/0G0S-0008-0000-0000",
  "prefLabel": { "en": "Ferrara" },
  "mappings": [ {
    "type": [ "http://www.w3.org/2004/02/skos/core#exactMatch" ],  
    "from": { "memberSet": [ { "uri": "https://data.ng.ac.uk/0G0S-0008-0000-0000" } ]  },  
    "to": { "memberSet": [ { "uri": "http://vocab.getty.edu/tgn/7004264" } ] }
   },{
    "type": [ "http://www.w3.org/2004/02/skos/core#exactMatch" ],  
    "from": { "memberSet": [ { "uri": "https://data.ng.ac.uk/0G0S-0008-0000-0000" } ]  },  
    "to": { "memberSet": [ { "uri": "https://sws.geonames.org/3177090" } ] }
  },{
    "type": [ "http://www.w3.org/2004/02/skos/core#exactMatch" ],  
    "from": { "memberSet": [ { "uri": "https://data.ng.ac.uk/0G0S-0008-0000-0000" } ]  },  
    "to": { "memberSet": [ { "uri": "https://www.wikidata.org/entity/Q13362" } ] }
 } ]
}

This allows to further process the mappings by applications aware of JSKOS format. Applications not aware of JSKOS, however won't make sense of the mapping data because the JSKOS context document does not tell how to convert these to plain RDF statements (in contrast to other fields such as prefLabel). To also serve these applications (that want to read your data as RDF without knowing about JSKOS) it is possible to extend JSKOS with custom fields like this:

{
  "@context": {
    "@import": "https://gbv.github.io/jskos/context.json",
    "_exactMatch": "http://www.w3.org/2004/02/skos/core#exactMatch"
   },
  "uri": "https://data.ng.ac.uk/0G0S-0008-0000-0000",
  "prefLabel": { "en": "Ferrara" },
  "mappings": [ {
    "type": [ "http://www.w3.org/2004/02/skos/core#exactMatch" ],  
    "from": { "memberSet": [ { "uri": "https://data.ng.ac.uk/0G0S-0008-0000-0000" } ]  },  
    "to": { "memberSet": [ { "uri": "http://vocab.getty.edu/tgn/7004264" } ] }
   },{
    "type": [ "http://www.w3.org/2004/02/skos/core#exactMatch" ],  
    "from": { "memberSet": [ { "uri": "https://data.ng.ac.uk/0G0S-0008-0000-0000" } ]  },  
    "to": { "memberSet": [ { "uri": "https://sws.geonames.org/3177090" } ] }
  },{
    "type": [ "http://www.w3.org/2004/02/skos/core#exactMatch" ],  
    "from": { "memberSet": [ { "uri": "https://data.ng.ac.uk/0G0S-0008-0000-0000" } ]  },  
    "to": { "memberSet": [ { "uri": "https://www.wikidata.org/entity/Q13362" } ] }
 } ],
  "_exactMatch": [
    "http://vocab.getty.edu/tgn/7004264",
    "https://sws.geonames.org/3177090",
    "https://www.wikidata.org/entity/Q13362"
  ]
}

This use of @context is not allowed by current version of JSKOS specification but I'll add it!

@richardofsussex
Copy link
Author

Thank you, that gives me a clear idea of what our options are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants