- From: Niklas Lindström <lindstream@gmail.com>
- Date: Tue, 3 Sep 2013 17:06:10 +0200
- To: Alexey Zakhlestin <indeyets@gmail.com>
- Cc: Linked JSON <public-linked-json@w3.org>
Received on Tuesday, 3 September 2013 15:07:07 UTC
Hi Alexey,
On Tue, Sep 3, 2013 at 4:50 PM, Alexey Zakhlestin <indeyets@gmail.com>wrote:
> Is it possible to use aliases on the value side?
> Here's the example of what I try:
> https://gist.github.com/indeyets/d9e996c54bf0bac916e7
>
> I want to be able to use an alias as the value for "schema:author"
> property.
> Can I, somehow?
>
Yes, you can achieve this by changing your context to:
"@context": {
"schema": "http://schema.org/",
"localpedia": "http://example.org/localpedia/",
"schema:author": {"@type": "@vocab"},
"author1": "localpedia:author1"
}
Also, if you're willing to tweak your keys a little, your example can be
reduced to this (prefix-free keys, uniform @id values):
{
"@context": {
"@vocab": "http://schema.org/",
"localpedia": "http://example.org/localpedia/",
"author": {"@type": "@id"}
},
"@graph": [
{
"@type": "Article",
"author": "localpedia:author1"
},
{
"@id": "localpedia:author1",
"name": "Foo Bar"
}
]
}
Cheers,
Niklas
>
> --
> Alexey Zakhlestin,
> http://github.com/indeyets
>
>
Received on Tuesday, 3 September 2013 15:07:07 UTC