Closed
Description
Related to #269 . I would like to use @language
maps with @set
, but haven't found a way to do so.
My data is following the SKOS model, where each concept can have one preferred label per language, and any number of alternative labels per language. To make the data easy to work with, I'm trying to achieve the following output:
{
"@id": "http://data.ub.uio.no/realfagstermer/c012548",
"prefLabel": {
"nb": "Abbor",
"en": "European perch"
},
"altLabel": {
"nb": [
"Åbor"
]
}
}
The best context I've come up with is this (JSON-LD Playground):
{
"@context": {
"skos": "http://www.w3.org/2004/02/skos/core#",
"prefLabel": {
"@id": "skos:prefLabel",
"@container": "@language"
},
"altLabel": {
"@id": "skos:altLabel",
"@container": "@language"
}
}
}
but this makes altLabel
a set (or a js list) only if there's more than one item, an object otherwise. I would like to force altLabel
to always be a set.