Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON-LD custom context

Tags:

json-ld

I am doing some research about JSON-LD. And I found the for the context is in every example used some public schema sites. Can I use my own ?

From:

{
   "@context":{
       "name": "http://schema.org/name"
   }
}

To:

{
   "@context":{
       "name": "http://my-site.com/name"
   }
}
like image 677
zdarsky.peter Avatar asked Mar 24 '15 21:03

zdarsky.peter


People also ask

What is JSON-LD context?

JSON-LD provides JSON-LD contexts which enable JSON documents to use simple, locally-meaningful names, while still enabling the messages to be meaningful beyond the initial exchange partners.

Is JSON-LD valid JSON?

A JSON-LD document is always a valid JSON document.

What is @ID in JSON-LD?

JSON-LD supports references to objects with a reserved key @id which can be used either as an object identifier or a reference to an object identifier. The value of @id must be a string.


1 Answers

Absolutely. In most cases you will actually need to do that as you probably won't find vocabularies (that's how those "schemas" are generally called) that cover everything you need. If possible, however, you should try to reuse existing vocabularies as it improves interoperabilty and enables code-reuse.

like image 178
Markus Lanthaler Avatar answered Sep 22 '22 19:09

Markus Lanthaler