You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ pipx run --spec git https://github.com/RDFLib/rdflib.git@master#egg=rdflib rdfpipe -i json-ld -o turtle test/data/variants/forward_slash.jsonld
⚠️ rdfpipe is already on your PATH and installed at /home/iwana/.local/bin/rdfpipe. Downloading and running anyway.
@prefix kb: <http://example.org/kb/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
kb:individual-a a <http://example.org/ontology/core/MyClassA> .
<http://example.org/ontology/core/MyClassA> a owl:Class .
riot and jsonld-cli however both reject the above:
$ riot --syntax JSONLD --output NTRIPLES test/data/variants/forward_slash.jsonld11:54:56 ERROR riot :: invalid type value: @type value must be a string or array of strings
$ npx jsonld expand test/data/variants/forward_slash.jsonldjsonld.SyntaxError: Invalid JSON-LD syntax; "@type" value must a string, an array of strings, or an empty object. at api.validateTypeValue (/home/iwana/.npm-packages/lib/node_modules/jsonld-cli/node_modules/jsonld/lib/util.js:189:11) at _expandObject (/home/iwana/.npm-packages/lib/node_modules/jsonld-cli/node_modules/jsonld/lib/expand.js:481:7) at Object.api.expand (/home/iwana/.npm-packages/lib/node_modules/jsonld-cli/node_modules/jsonld/lib/expand.js:227:3) at _expandObject (/home/iwana/.npm-packages/lib/node_modules/jsonld-cli/node_modules/jsonld/lib/expand.js:675:29) at api.expand (/home/iwana/.npm-packages/lib/node_modules/jsonld-cli/node_modules/jsonld/lib/expand.js:227:3) at /home/iwana/.npm-packages/lib/node_modules/jsonld-cli/node_modules/jsonld/lib/jsonld.js:332:18 at async Function.expand (/home/iwana/.npm-packages/lib/node_modules/jsonld-cli/node_modules/jsonld/lib/util.js:460:16)Error: { "name": "jsonld.SyntaxError", "details": { "code": "invalid type value", "value": { "@id": "http://example.org/ontology/core/MyClassA", "@type": "owl:Class" } }}
And from the JSON-LD spec I can't see anything that indicates this should be allowed.
On the one hand we can say this is not a bug, because according to IETF RFC 1958
Be strict when sending and tolerant when receiving.
Implementations must follow specifications precisely when sending to
the network, and tolerate faulty input from the network. When in
doubt, discard faulty input silently, without returning an error
message unless this is required by the specification.
However, to me this is a bug, it is pushing the principle too far and more details of the potential harms that will (and possibly already has) result from this can be seen in The Harmful Consequences of the Robustness Principle
There is however the possibility that I misread the JSON-LD spec, and that it should be allowed, and that riot and jsonld-cli is wrong.
The text was updated successfully, but these errors were encountered:
More info about the processing algorithm for JSON LD is defined in https://www.w3.org/TR/json-ld-api/ and I also cant see anything that would suggests that @type can have an object as a value.
Ah, dear. This was me making a stylistic guess between OWL's inlined anonymous classes (e.g. as frequently occurs with owl:Restrictions) and JSON-LD Framing, which I hadn't reviewed in depth yet. I'm fine with avoiding adding buggy data.
Given the following JSON-LD content in a file
cat test/data/variants/forward_slash.jsonld
RDFLib loads it and converts it:
riot and jsonld-cli however both reject the above:
And from the JSON-LD spec I can't see anything that indicates this should be allowed.
On the one hand we can say this is not a bug, because according to IETF RFC 1958
However, to me this is a bug, it is pushing the principle too far and more details of the potential harms that will (and possibly already has) result from this can be seen in The Harmful Consequences of the Robustness Principle
There is however the possibility that I misread the JSON-LD spec, and that it should be allowed, and that riot and jsonld-cli is wrong.
The text was updated successfully, but these errors were encountered: