skohub-io / skohub-vocabs

A lightweight tool to publish SKOS Vocabularies
https://skohub.io/
Apache License 2.0
36 stars 25 forks source link

Add inverse of `skos:member` #237

Open sroertgen opened 1 year ago

sroertgen commented 1 year ago

Currently there is no link from a concept or concept scheme to a collection. That is by design in SKOS. Though we now have information in the HTML that is not represented in the JSON data. @acka47 already noticed and mentioned this:

I know, there is already a PR at #200 but I have to add some information her efor the sake of completeness.

As there is no inverse for skos:member we will not be adding it to the concept's JSON-LD.

In a direct correspondence with @solth, I hinted to a solution for this but missed to post it here. Generally, I assumed that the HTML is built from the underlying JSON so that we might need the JSON-LD statement at skos:Concept pages that a concept ist memberOf a collection. We could add this as JSON-LD supports reverse properties. Basically, we could add to the JSON-LD context something like this:

{
"@context":{
"memberOf":{
"@reverse":"skos:member"
}
}
}

This would enable adding those statements to the JSON-LD, e.g. in https://test.skohub.io/acka47/testing-skohub-vocabs/heads/master/w3id.org/kim/hcrt/assessment.json:

{
"id":"https://w3id.org/kim/hcrt/assessment",
"memberOf":"https://w3id.org/kim/hcrt/test_collection"
}

Originally posted by @acka47 in https://github.com/skohub-io/skohub-vocabs/issues/159#issuecomment-1294562475