-
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
Define JSON literal and the rdf:JSON
datatype.
#150
Conversation
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.
Two minor typos.
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.
One major and one minor comment, both on the RDF Datatype definition section:
- lexical-to-value mapping: I am not sure about referring to the RFC for the parser. That does not define how the ECMAScript representation is really mapped. On the other hand, the following reference: https://tc39.github.io/ecma262/#sec-json-object looks like a good match: it defines (normatively) not only the JSON grammar but, more importantly, the JSON object of ECMAScript that includes the
parse()
method that does the parsing. I would propose to use that as a reference. - value space: I am a bit bothered by the fact that the specification does not define when two objects in the value space are considered to be equal (although this is not required by the RDF spec). Alas!, however, at the moment there is no standard ways of doing that in the ECMAScript land (afaik). There are some libraries that have such functions (e.g.,
underscore
orlodash
, both widely used) but, of course, we cannot refer to these normatively. (Maybe @dlongley or @davidlehn have more information.)
We could add a note about equality and refer to, e.g., theisEqual
function of these two libraries (they share the same function name), but I am not sure whether that is useful or necessary. Other languages may have similar methods, and JSON-LD is not bound to ECMAScript...
B.t.w., as soon as this is merged, we should notify the swig mailing list about this, emphasizing the intention to add this to the rdf namespace (I presume we would formally do that when the Rec is published).
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.
This is good, apart from a few minor problems.
Shouldn't we also add a note about not abusing the JSON datatype, as suggested by @BigBlueHat during the last telco? By pointing out that such JSON literals might be considered as opaque by other Linked Data consumers, and hence hinder interoperability?
… warning on usage and suggestions by @iherman.
@iherman that's a good match, although the value space includes arrays, numbers, boolean, and null, as well as object.
Yes, indeed. We have some text in the test README that could suffice:
|
@gkellogg the test Readme text if fine, but do you intend to make this normative? |
That is what I was suggesting for a normative description of value equality. I’m certainly open to alternatives. |
@gkellogg I am fine putting that into the doc normatively. We will see what the review will give. |
…ed on the API Data Round Tripping text.
For #4.
Preview | Diff