What is the @vocab attribute in JSON-LD for? As I see it you can "import" a remote vocabulary, but isn't this the same you can do with @context? If I'm not wrong then you can "import" a remote source for @context as well. So where is the difference between @vocab and @context?
Extra question: Can I have more then one @vocab? For example the first referrers to schema.org and the other to rdfs?
@vocabis used specifically to declare a default vocabulary from which all terms derive, without having to declare specific mappings for each term (as you normally do in a@context).For example, see this snippet (taken from the JSON-LD 1.0 spec):
In this fragment,
@vocabis used to define that in this context, all terms derive from the schema.org vocabulary. So in the following fragments,Restaurantmaps tohttp://schema.org/Restaurant, andnamemaps tohttp://schema.org/name. You could of course have done this with explicit mappings in the@contextas well:but this quickly becomes tedious as you start using more and more terms from the same vocabulary.
@vocabis just a useful short way to say: "if I don't have an explicit mapping for a term, this is what it maps to".As for whether you can use more than one
@vocab: you can have more than one@vocabin a JSON-LD document (just as you can have more than one@context), but you can not have more than one in the same@context. I trust that the explanation that it defines a default also makes it clear why you can't have two in the same context.