0

I am trying to do some job with json-ld, and I met 2 kind of vocab IRIs:

Why is this? Does it have anything to do about how to process the documents?

inf3rno
  • 24,976
  • 11
  • 115
  • 197

1 Answers1

1

The vocabulary in your first example is likely (but not necessarily) using 303 URIs, the one in the second example is using hash URIs.

Both are common vocabulary URI design principles, and solutions for the httpRange-14 issue.

See also the section Choosing between 303 and Hash.

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
  • Is it possible to visit the link of the hashed vocab, download an rdf graph about the vocabulary and use the selector after the hash mark (in the current IRI) to determine what the current RDF triple is about? – inf3rno Jun 26 '14 at 23:18
  • For example is it a common practice to have something like this: `{"@type": "http://my.vocab#Person", name: "John Doe"}` and automatically fetch the vocab with a jsonld processor to determine what constraints the `name` property has? It is hard to understand how to build and parse jsonld documents using multiple vocabs. – inf3rno Jun 26 '14 at 23:28
  • I read the description, so the IRIs are for web documents/resources and the part after the # is for things in the real world, which should have an IRI, but which are not web documents, so they should not send back any response. Funny, this makes me even more confused about RDF vocabs. :D :D :D – inf3rno Jun 26 '14 at 23:56
  • For example I have a bakery with breads, how do I model it on the web? I want to get info about the 123th bread, so I send a `GET /items/bread:123` request, which returns a JSON-LD document, I guess something like this: `{ "@id": "/items/bread:123", "@type": "/vocab#Item", "label": "Bread", "weight": {"amount": 1, "measure": "kg"}}`. But where should I put the `/#things/123th-bread` IRI in this which represents the binding between the real thing and the web resource? I think I'll end up bald by studying linked data with REST :D Btw. great answer! Should I ask all of these in another question? – inf3rno Jun 27 '14 at 00:34
  • @inf3rno: I think it would make sense to create another question about this, yes. -- I’m not sure if I follow your question (and I don’t "think" in JSON-LD), but in your bakery website you’d have `/items/bread:123` as URL for the page about the bread, and using the hash URI method, `/items/bread:123#thing` as URI about the real-world bread. So when you want to make statements about the real-world bread, you use `/items/bread:123#thing`. – unor Jun 27 '14 at 13:10
  • The subject and object part is okay, but what would be the predicate between the page and the thing? – inf3rno Jun 27 '14 at 14:19
  • 2
    @inf3rno: There are many properties that could be used, in many different vocabularies. For example, FOAF’s [`primaryTopic`](http://xmlns.com/foaf/spec/#term_primaryTopic)/[`isPrimaryTopicOf`](http://xmlns.com/foaf/spec/#term_isPrimaryTopicOf). – unor Jun 27 '14 at 14:34
  • Ohh I thought that is for the entire graph not for multiple relationships in a graph. Thanks! – inf3rno Jun 27 '14 at 14:49
  • The `foaf:primaryTopic` is only for describing the primary topic of the actual web document, nothing more... The `rdf:about` is for describing the link between things and other RDF resources which are about them. So in the example `/items/bread:123 rdf:about /items/bread:123#thing` – inf3rno Jun 30 '14 at 01:37
  • @inf3rno: The primary topic of a webpage about a specific bread (`/items/bread:123`) … is this specific bread (`/items/bread:123#thing`). -- AFAIK `rdf:about` is something totally different (it’s for declaring the subject in the RDF/XML serialization; it’s not a predicate defined in the RDF vocabulary which you could use in other RDF documents). – unor Jul 01 '14 at 12:56