RE: Introduction and a question about JSON-LD

On Sunday, July 27, 2014 2:34 AM, Dimitri van Hees wrote:
> Hi Markus,
> 
> Ok, I think I understand it now. However, would this be OK to do?
> 
> {
>   "@context": "http://schema.org",
>   "homeLocation": {
>     "@id": "http://dbpedia.org/page/Tilburg",
>     "@type": "http://schema.org/City",
>     "name": "Tilburg"
>   }
> }

Sure. That's perfectly fine. Thanks to http-range14 madness, you might however want to use http://dbpedia.org/resource/Tilburg instead of page/Tilburg to avoid a lot of unproductive discussions.


> Because even if homeLocation and birthplace are different properties,
> they both actually are cities. And if this is OK, can I also state
> that by just passing a context file through the header on a 'normal'
> JSON response can make it valid JSON-LD, but just for the properties?

Yeah, you can hide the JSON-LD context in an HTTP Link header. I wouldn't encourage that for a new API but if you really want, you can of course. What do you mean with "but just for the properties" at the end of the paragraph above?


--
Markus Lanthaler
@markuslanthaler

Received on Sunday, 27 July 2014 18:16:12 UTC