I have properties in my model which have value as alternate array (which indicates a collection of alternates from which only one value is to be chosen). Earlier I was using RDF/XML to do this using rdf:Alt. See the following example
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ex="http://ns.example.com/example/">
<rdf:Description>
<ex:prop1>
<rdf:Alt>
<rdf:li>100</rdf:li>
<rdf:li>120</rdf:li>
<rdf:li>130</rdf:li>
</rdf:Alt>
</ex:prop1>
</rdf:Description>
</rdf:RDF>
But now I want to do same thing in JSON-LD. I tried converting the above snippet to JSON-LD by online converter and got the following result
{
"@context": {
"ex": "http://ns.example.com/example/",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
},
"@graph": [
{
"@id": "_:g70327238021300",
"ex:prop1": {
"@id": "_:g70327280101680"
}
},
{
"@id": "_:g70327280101680",
"@type": "rdf:Alt",
"rdf:_1": "100",
"rdf:_2": "120",
"rdf:_3": "130"
}
]
}
Actually I found out that rdf:Alt/Seq/Bag are marked as archaic by w3c. There is @list and @set for ordered and unordered arrays respectively in JSON-LD. So is there any other way to do this in JSON-LD without using "rdf:Alt" as @type?