-
Notifications
You must be signed in to change notification settings - Fork 157
Support for controlled probing of unlinked objects #84
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
Comments
This looks very interesting. A couple of questions:
|
Thanks!
|
Just to make sure we are on the same page. The Turtle output of the document above would be
Right? So the second part is basically just a disjoint graph.. I'm not sure I understand your argument against |
It also seems to me that this could be achieved with a @graph alias. |
It would almost work, but doesn't really because using Also, the graph is not disjoint – the two resources described are linked together using |
It would also be good to know if others see value in the notion of an inverse (for e.g. framing purposes). We might be able to work more on that if so (there have been at least two of us who want something like |
Niklas, I think currently you could solve this in two ways. Either
or
But I agree, both look quite ugly. But on the other hand you also have no way of expressing something like that in plain JSON without minting a dedicated rev-relation. |
Niklas, I don't think that the use of @graph is strictly for disjoint graphs. It just provides a way to describe disjoint graphs that share a context that wouldn't otherwise be possible. You could use @graph to list subjects that are all interconnected instead of embedding them; this is just a more flattened form of JSON-LD. |
Absolutely, that's how The point of this is to make a useful shape of the data, with the root being one single resource (the one which this JSON represents or describes), where things linking to it are also present via "reverse" links. Hence the flattened form won't do. The idea here is that by allowing for probing of null-terms where explicitly allowed, all of the data is also interpretable as RDF; nothing is pruned. |
Niklas, do you have a specific idea how that should work in detail? Should it be possible to re-activate parsing at any level or do you see it more as "don't disable parsing for this term (and it child nodes) but don't interpret it as a property since there's no IRI available"? |
I think the latter is best, i.e. "parse the value for this term, but don't interpret it as a property since there's no IRI available". It makes things fully controllable and avoids any "active-null-term" from triggering parsing within opaque non-linked JSON. And I think it'd make the algorithm for this fairly simple. Note that I'm not wedded to using My ideal would actually be to introduce |
I would be fine with that behavior. It would be a trivial algorithm change IMO. So maybe let me try to formulate a PROPOSAL: If a JSON-LD processor encounters a property for which there exists a term definition but no IRI-mapping. The processing (expansion/compaction/to RDF) algorithms won't change the property but restart the processing at the property's value. Quite a clunky sentence - maybe you can come up with a better wording. While I do see a value of rev, I don't think we should introduce it in this version of JSON-LD. There are different options to express such data and I think we should first get a feeling at how people will use JSON-LD before adding more features to it. |
RESOLVED: Do not support controlled probing of unlinked objects for this version of JSON-LD. |
Currently, JSON-LD allows for undefined or null-bound terms, to make it possible to mix in plain old JSON in documents. This is to support e.g. legacy, annotation or application-specific purposes. We have looked into the possibility to "probe" values for such terms for more JSON-LD, but concluded that it would be to uncontrollable, given that data in such values may have entirely local meaning. Trying to parse that could result in unintentional gleaning of unexpected or strange data.
However, there is an opportunity here to let contexts declare that certain null-bound terms must be probed. Specifically, we could use
@container
for this purpose. Consider a term declaration like:This would instruct a parser both to not intrepret
isReferencedBy
as a property (and thus not link from the current resource to the value), and to parse the value as if it was JSON-LD.The specific value for
@container
must be decided of course. Here I use@set
, which is under discussion and not currently part of JSON-LD. We could imagine@object
here as well (or perhaps justtrue
), to state that the value should be one specific object (and even@list
to create a disconnected rdf:List).A real use case where this might be applied is to allow for application-specific encoding of reverse relations (i.e. "things which links to this resource"). Here is an example of that:
Notice that if
isReferencedBy
is probed, the related object would be parsed, along with its link to the top-level resource. In other words, this makes for very usable JSON as well as a formal representation of the relevant underlying graph. (The_inverseOf
is an example of how a non-standard, application-specific serializer extension which triggers this special representation form may look. That's really orthogonal to this issue though.)The text was updated successfully, but these errors were encountered: