I cannot find a convenient way to express this:
@base: <http://example.org/abox/> .
@prefix : <http://example.org/tbox#> .
:bob a :Person {| :accordingTo :alice |} .
as compact JSON-LD-star using the @annotation design along with @type. Am I missing something or is this a limitation of the current design?
If it is, and without resorting to context trickery, I could imagine a new special form like this might do the trick:
{
"@context": {
"@base": "http://example.org/abox/",
"@vocab": "http://example.org/tbox#"
},
"@id": "bob",
"@type": {
"@type": "Person",
"@annotation": {
"accordingTo": {"@id": "alice"}
}
}
}
But with that, "@type": {"@type": "Person"} would have to be supported in general, which isn't so nice. I guess a variant could be "@type": {"@value": "Person"}. Alas, both forms might come off a bit like hacks for this purpose. Defining a new keyword, say @symbol, as a companion to @id but resolving against the context, might do it, but with all the drawbacks of yet another new keyword.
(It's possible to work around this limitation and get a "fairly compact" form, e.g. by not using @type and resorting to a plain rdf:type link using a regular non-@vocab-resolved @id value. (Or define a key in the context with a nested context where @base is set to the value of @vocab, albeit that'd resolve differently for e.g. hash-IRI:s as in the example.) But I'm looking for a way to leverage @type as is, resolving to @vocab, to keep the compact form as close to "regular" compact JSON-LD as possible.)
I cannot find a convenient way to express this:
as compact JSON-LD-star using the
@annotationdesign along with@type. Am I missing something or is this a limitation of the current design?If it is, and without resorting to context trickery, I could imagine a new special form like this might do the trick:
{ "@context": { "@base": "http://example.org/abox/", "@vocab": "http://example.org/tbox#" }, "@id": "bob", "@type": { "@type": "Person", "@annotation": { "accordingTo": {"@id": "alice"} } } }But with that,
"@type": {"@type": "Person"}would have to be supported in general, which isn't so nice. I guess a variant could be"@type": {"@value": "Person"}. Alas, both forms might come off a bit like hacks for this purpose. Defining a new keyword, say@symbol, as a companion to@idbut resolving against the context, might do it, but with all the drawbacks of yet another new keyword.(It's possible to work around this limitation and get a "fairly compact" form, e.g. by not using
@typeand resorting to a plainrdf:typelink using a regular non-@vocab-resolved@idvalue. (Or define a key in the context with a nested context where@baseis set to the value of@vocab, albeit that'd resolve differently for e.g. hash-IRI:s as in the example.) But I'm looking for a way to leverage@typeas is, resolving to@vocab, to keep the compact form as close to "regular" compact JSON-LD as possible.)