-
Notifications
You must be signed in to change notification settings - Fork 12
notes #1
Comments
(if we add: {
"type": "@type",
"value": "@value",
} to the mdag root context, people can use |
Hey @msporny -- would love your feedback here. is there anything special i need to do to define that |
Keep in mind that RDF has the concept of a "value type" aka literal type (like "2015-04-13" is a "http://www.w3.org/2001/XMLSchema#date"), which I think you're using above. There is also an object type ( { "@type": "Person", name: "Juan Batiz-Benet" } is a "http://schema.org/Person"), which you might be interested in if the mlink is supposed to have other attributes associated with it. You can do some crazy RDF inference stuff with attributes and objects (for example, if you see "mlink" then the associated object is of type Foobar), but I suggest you stay away from stuff like that unless absolutely necessary. You don't want to have to write an inference engine for IPFS.
If you are trying to say "mlink" is a value type, then option #3 above is the cleanest and what I'd recommend (but be sure to also specify "@id" in the term declaration).
Yes, and it depends on what you mean by "type". Some relevant sections in the JSON-LD spec on typing values and typing objects: http://www.w3.org/TR/json-ld/#specifying-the-type http://www.w3.org/TR/json-ld/#typed-values http://www.w3.org/TR/json-ld/#type-coercion If you have a link to what you're trying to model w/ 'mlink', I'll be able to provide more help. |
Yes, I love this! |
@nicola happy to chat, just let me know what your availability is. My Skype: msporny - mobile: 540-641-1942 - and email: msporny@digitalbazaar.com |
@nicola @msporny me too! if relevant! @msporny thanks very much.
So, like so:
? or elsewhere?
skimmed the spec links, but i think that's just assigning types to other objects (e.g. assigning a node type or a value type to a jsonld object)? What i want is to define a new node type. which i guess is done just with What i'm modeling with We basically will have a few different kind of links (this json-ld formulation is very new, btw so we can adjust things):
and possibly others. [0] except for: censorship attacks, but those are circumvented with validites (e.g. cryptographic freshness) |
cc @mildred |
Edit note: in this message, RDF does not represents the XML serialization format, but the data model it represents. I think one issue of RDF and JSON-LD is that it does not allow efficient access of the data without some database, so I don't think a JSON-LD compatible format is then suitable for IPFS. We should instead find a format that could be converted to JSON-LD by ipfs, but that could also be efficient in data access. The main issue is that RDF lack data structures like ordered lists or indexed maps. For instance, in a RDF world, to find the file name foo.txt in a directory, you have to iterate over the unordered list of child nodes of a directory, and compare the entry name. Why not start from the current IPFS format and add RDF from here incrementally add:
This would be the following protocol buffer definition:
This data structure can easily be transformed to any RDF format, including JSON-LD. You don't need a context, it can be generated from the data structure. The only issue with it is that it is a little verbose. In objects of the same type, you'll repeat information. But not to repeat information requires to define a context format (I don't think we can reuse the JSON-LD context format) generic enough for all your use cases (and you don't really know them ahead of time) I'm on IRC freenode#ipfs, don't hesitate to ping me |
@jbenet, as discussed by email, I'm a maintainer of https://github.com/kazarena/json-gold - full JSON-LD API implementation for Golang. I'm also an active user of JSON-LD in Go and Python. Just dropping this message in case if I can be of any help with LD design/implementation related matters. |
these are all equivalent.
(1) no context, direct linked data link.
(2) mdag general context, use mlink shortcut.
define general mdag context
use it in commits
(3) specific commit context. well typed
define commit context
use it in commits
The text was updated successfully, but these errors were encountered: