-
Notifications
You must be signed in to change notification settings - Fork 23
Added the example for bushes #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-Authored-By: Dave Longley <[email protected]>
Co-Authored-By: Dave Longley <[email protected]>
Co-Authored-By: Dave Longley <[email protected]>
Thanks @dlongley ! |
Semantically, this is the same as if the node objects were embedded, or were contained | ||
in some enclosing <a>array</a>.</p> | ||
<p> | ||
The problem with this approach is that we lose the ability to use a common context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true? This seems like the use case for {"@context": {}, "@graph": [ ... ]}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, yes, the solution so far to the problem is to use @graph
. But it turns out that @included
can play exactly the same role, except that using that keyword (instead of @graph
) is cleaner. The problem with using @graph
for something like that is that it looks like we are talking about a dataset when, in fact, we are not!
B.t.w., and that is relevant, the example is almost exactly the same is a few chapter below (example 111 in the PR) where datasets/named graphs are described. But there is difference between named graphs (or data sets) and a single graph which can then be handled via @included
.
B.t.w., and I forgot to do that: if we agree with this PR, then the text around 111 should be redone. Of course, 111 remains valid due to backward compatibility reasons but I would propose that the @included
should be promoted instead.
…@graph` for JSON-LD 1.1 usage.
Looks good, I fixed the examples and added a note to Example 111. |
I don't think this was the intended use of Bushes can be written (as I understand them): [{"@context": "...local context...", "@id": "...subject..."}, {}] or {
"@context": "...shared context...",
"@graph": [{"@id": "...subject..."}, {}]
} And datasets can be written as... {
"@context": "...shared context...",
"@id": "...name of graph...",
"@graph": [{"@id": "...subject..."}, {}]
} I've never found that confusing...but maybe I'm missing something? |
Put differently, if the following two examples are identical, we don't need the new one. New {
"@context": {
"Person": "http://xmlns.com/foaf/0.1/Person",
"name": "http://xmlns.com/foaf/0.1/name",
"knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@id"}
},
"@included": [{
"@id": "http://manu.sporny.org/about#manu",
"@type": "Person",
"name": "Manu Sporny",
"knows": "https://greggkellogg.net/foaf#me"
}, {
"@id": "https://greggkellogg.net/foaf#me",
"@type": "Person",
"name": "Gregg Kellogg",
"knows": "http://manu.sporny.org/about#manu"
}]
} vs. existing {
"@context": {
"Person": "http://xmlns.com/foaf/0.1/Person",
"name": "http://xmlns.com/foaf/0.1/name",
"knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@id"}
},
"@graph": [{
"@id": "http://manu.sporny.org/about#manu",
"@type": "Person",
"name": "Manu Sporny",
"knows": "https://greggkellogg.net/foaf#me"
}, {
"@id": "https://greggkellogg.net/foaf#me",
"@type": "Person",
"name": "Gregg Kellogg",
"knows": "http://manu.sporny.org/about#manu"
}]
} @gkellogg do these generate the same graph/bush output? |
I think they are the same indeed, and if we have As for using
Using |
I know the second example above is not really valid, though... A better one is to say
The point is: let us not mix up datasets and simple graphs... |
One difference is that |
a:b c:d "something" . becomes {
"@graph": [{"@id": "a:b", "c:d": "something"}]
} And the dataset one... <http://a.b.c.> { a:b c:d "something". } becomes... {
"@id": "http://a.b.c.",
"@graph": [{"@id": "a:b", "c:d": "something"}]
} I really don't see the confusion. A dataset is an |
(I hope this PR for a PR works:-)
I have made a change on the section of
@included
to emphasize the simple bush feature, but also maintaining the original example. I am sure the text needs harmonization as for the style.I was also not sure about the paragraph on the JSON API; I have never used that thing, so I cannot comment on it. I am actually not sure it is worth keeping it here; it is not necessarily relevant imho. (or should be put as a note if we really want to keep to it).
Preview | Diff