- From: Gregg Kellogg <gregg@greggkellogg.net>
- Date: Mon, 17 Feb 2020 10:31:52 -0800
- To: Vladimir Alexiev <vladimir.alexiev@ontotext.com>
- Cc: public-json-ld@w3.org
- Message-Id: <43D199F1-30C9-45E7-8F07-02673005080F@greggkellogg.net>
I don’t see a way to do what you want; perhaps with framing. But, if you add “@type”: “@id” to the “prefix” term definition, it get’s a bit better:
{
"@context": {
"@vocab": "http://example.org/",
"ex": "http://example.org/",
"rdfs": {"@type": "@id"},
"xsd": {"@type": "@id"},
"prefixes" : {
"@type": "@id",
"@container": "@index",
"@index": "ex:pfx"
}
}
}
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
rdfs: <http://example.org/pfx> "rdfs" .
xsd: <http://example.org/pfx> "xsd" .
[<http://example.org/prefixes> rdfs:,
xsd:] .
You might need some SPARQL involved.
It’s useful to reduce input the the expanded form, as all this indexing stuff is really just syntactic sugar.
[
{
"http://example.org/prefixes": [
{
"@id": "http://www.w3.org/2000/01/rdf-schema#",
"http://example.org/pfx": [
{
"@value": "rdfs"
}
]
},
{
"@id": "http://www.w3.org/2001/XMLSchema#",
"http://example.org/pfx": [
{
"@value": "xsd"
}
]
}
]
}
]
Gregg Kellogg
gregg@greggkellogg.net
> On Feb 17, 2020, at 5:49 AM, Vladimir Alexiev <vladimir.alexiev@ontotext.com> wrote:
>
> I get the same error "invalid value object: Attempt to add illegal key to value object: ex:pfx" with this context:
>
> {
> "@context": {
> "@vocab": "http://example.org/ <http://example.org/>",
> "ex": "http://example.org/ <http://example.org/>",
> "prefixes" : {
> "@container": "@index",
> "@index": "ex:pfx"
> },
> "ex:pfx": {
> "@container": "@index",
> "@index": "ex:iri"
> }
> }
> }
Received on Monday, 17 February 2020 18:32:08 UTC