-
Notifications
You must be signed in to change notification settings - Fork 23
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
TriG graphs in JSON-LD #128
Comments
This expresses the above using a single context: {
"@context" : {
"a": "http://example.org/a",
"b": "http://example.org/b",
"c": "http://example.org/c",
"b:predicate" : { "@type" : "@id" }
},
"@graph": [{
"@id": "http://example.org/gr1",
"@graph": {
"@id": "a:something",
"a:predicate": "value1",
"b:predicate": "c:something1"
}
}, {
"@id": "http://example.org/gr2",
"@graph": {
"@id": "a:something",
"a:predicate": "value2",
"b:predicate": "c:something2"
}
}]
} |
... which unfortunately gives the wrong impression that there are three graphs in this dataset. And I'm assuming this is why Ivan didn't naturally came up with this solution. Wouldn't the following also work? {
"@context" : {
"a": "http://example.org/a",
"b": "http://example.org/b",
"c": "http://example.org/c",
"b:predicate" : { "@type" : "@id" },
"graphs": {
"@id": "@nest",
"@container": ["@graph", "@id"]
}
},
"graphs": {
"http://example.org/gr1": {
"@id": "a:something",
"a:predicate": "value1",
"b:predicate": "c:something1"
},
"http://example.org/gr2": {
"@id": "a:something",
"a:predicate": "value2",
"b:predicate": "c:something2"
}
}
} (the dev playground refuses it, but I'm assuming this is a missing implementations of the If so, it might be worthwhile to document this "pattern", which might be more natural for some people? |
@dlongley indeed, #128 (comment) also works but, just @pchampin remarks, it did not come naturally. The point is a very long time grudge I have against the current syntax, namely the conflation of the term There is still an open issue (#30) but I do realize this is a battle I am loosing. I was already messed up by the duality of the @pchampin your example probably works, but shouldn't it be a |
Yeah, I've never been a fan of overloading |
One thought that came up some time ago as to allow {
“@context”: {
“@container”: [“@graph”, “@id”]
}
} |
I like that, but would it generalize to any kind of container? If not, wouldn't it be more confusing than helpful? |
Yes, it would generalize, but note that it may be more confusing than its worth, as every value which is an object would then be interpreted as a graph map, unless each term redefined it, or another context changed it. |
This issue was discussed in a meeting.
View the transcriptTriG graphs in JSON-LDRob Sanderson: ref: #128 Gregg Kellogg: The concern is that TRiG does not use the value, insomuch as it’s just a set of graphs, names, etc, where JSON-LD has the object being the name of something in the default graph. Ivan Herman: that’s what the issues says. What dave put in is a solution that technically works. It’s awful, and you can put in a fig leaf by aliasing @graph, but… … what did come up is that Pierre Antoine put in a proposal for a solution and the syntax was wrong, but the way that it is now after our discussion this morning it probably works, but it is consistent. … what he has here will work once we’ve done the cognates. … that’s the figleaf Gregg Kellogg: I like that more than one problem is solved with a single solution Rob Sanderson: should we validate that it expands correctly one the fixes are in? Gregg Kellogg: something might expand oddly… Ivan Herman: expanding is for machines. I don’t care. But for humans, what P.A. has put in is fine. Proposed resolution: Verify that @nest solution for #19 solves issue in #128 and defer until then (Rob Sanderson) David Newbury: +1 Jeff Mixter: +1 Rob Sanderson: +1 Gregg Kellogg: +1 Ivan Herman: +1 Rob Sanderson: we should make sure it’s solved before closing Harold Solbrig: +1 David I. Lehn: +1 Resolution #14: Verify that @nest solution for #19 solves issue in #128 and defer until then {: #resolution14 .resolution} Adam Soroka: +1 |
Closing 141 as duplicate. |
Is converting TriG Graphs to JSON-LD supported? I couldn't find any documentation for this yet and ended up at this issue 😅 |
JSON-LD supports conversion to and from RDF datasets, as does TriG. This is the same for all RDF formats, either converting to graphs or datasets. The Playground doesn’t directly support it (PR to do so would be great), but you can try it on my distiller. The key is they express the same abstract data model. In the algorithm, this is described using quads, so turn TriG into quads and use as input to JSON-LD fromRdf or do the opposite. |
This issue was discussed in a meeting.
View the transcriptTriG graphs in JSON-LDRob Sanderson: link: #128 Simon Steyskal: [ivan contemplating about issue 128] Ivan Herman: there was some activity on this issue in February … there is a comment on it from pchampin providing a solution and asking whether that’s valid … idk though Gregg Kellogg: I think I had an action on looking into interaction with nest/container stuff … we def. need a dedicated section on graphs/trig etc. in the bpr document Ivan Herman: then let’s leave it open for now Proposed resolution: Leave #128 open until we can determine the effects of @container / @nest (Rob Sanderson) Ruben Taelman: +1 Rob Sanderson: +1 Pierre-Antoine Champin: +1 Gregg Kellogg: +1 Tim Cole: +1 Simon Steyskal: +1 Ivan Herman: +1 Dave Longley: +0 Adam Soroka: +1 David Newbury: +1 David I. Lehn: +1 Resolution #6: Leave #128 open until we can determine the effects of @container / @nest |
Note that #19 may help resolve this. |
@dlongley I am not sure I see how... |
Were you looking for something like this to resolve your issue? {
"@context" : {
"a": "http://example.org/a",
"b": "http://example.org/b",
"c": "http://example.org/c",
"b:predicate" : { "@type" : "@id" }
},
"@included": [{
"@id" : "http://example.org/gr1",
"@graph" : {
"@id" : "a:something",
"a:predicate" : "value1",
"b:predicate" : "c:something1"
}
}, {
"@id" : "http://example.org/gr2",
"@graph" : {
"@id" : "a:something",
"a:predicate" : "value2",
"b:predicate" : "c:something2"
}
}]
} Supposing, of course, that the above resolves to the same quads as the TriG. |
@gkellogg a stupid question: could you explain the difference? |
As with other dataset formats, such as TriG, you may not actually use named graphs, in chich case the JSON-LD is used as a graph format. If you use it to describe datasets, it’s a dataset format. TriG is the same, as it’s a superset of Turtle. The new included feature, as @dlongley shows, can make it easier to express datasets sharing a common context. |
This issue was discussed in a meeting.
View the transcriptConfirm state of@import usageBenjamin Young: -> #108 Issue 108 Benjamin Young: Request by Rob to state to ourselves to not quickly add more features to @import. Ivan Herman: +1 Benjamin Young: This import issue is closable, as it is in the spec Gregg Kellogg: +1 Gregg Kellogg: This also puts the nail in for SRI? Benjamin Young: Yes … We would defer and close the SRI issue Proposed resolution: close 108 with statement that potentially related SRI issues will be closed as differed (Benjamin Young) Ivan Herman: +1 Gregg Kellogg: Can we close the issue on trig graphs? Ruben Taelman: +1 Benjamin Young: +1 Tim Cole: +1 Gregg Kellogg: +1 Resolution #4: close 108 with statement that potentially related SRI issues will be closed as differed Proposed resolution: close 128 (Ivan Herman) Tim Cole: +1 Ruben Taelman: +1 Ivan Herman: +1 Benjamin Young: +1 Gregg Kellogg: +1 Resolution #5: close 128 |
I just try to test my understanding...
Consider the following TriG dataset:
The only way to express this in JSON-LD to repeat a
@context
, i.e.,I.e., the context must be repeated.; there is no way of using a "global" context. I am not sure whether this is a problem in practice, but it may become one if JSON-ID is used for large datasets. In any case, this may have to be documented somewhere because it may not be 100% obvious for a first-time reader (best practices document?).
That being said: one way of handling that over the Web is if the server returns
and the
@context
is returned via an HTTP Link. According to section 6, the processor is supposed to repeat the context for each element of the array...The text was updated successfully, but these errors were encountered: