shexSpec / shexTest

ShEx test suite
https://shexspec.github.io/shexTest/
Other
3 stars 4 forks source link

Discriminate IRIREF from BNODE #50

Closed ericprud closed 2 years ago

ericprud commented 2 years ago

I'm not sure what the JSON-LD rules are for recognizing a BNode. The playground suggests that it's [anything starting with ":"](https://json-ld.org/playground/#startTab=tab-nquads&json-ld=%7B%22%40context%22%3A%7B%22p1%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fa.example%2Fp1%22%2C%22%40type%22%3A%22%40id%22%7D%2C%22p2%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fa.example%2Fp2%22%2C%22%40type%22%3A%22%40id%22%7D%7D%2C%22%40id%22%3A%22%3A!%40%23%24%25%5E%26()%3C%3E%7B%7D~%60%3B'%20asdf%22%2C%22p1%22%3A%22_%3A!%40%23%24%25%5E%26()%3C%3E%7B%7D~%60%3B'%20asdf%22%2C%22p2%22%3A%22_%3A!%40%23%24%25%5E%26*()%3C%3E%7B%7D~%60%3B%20asdf%22%7D):

{ "@context": {
    "p1": { "@id": "http://a.example/p1", "@type": "@id"},
    "p2": { "@id": "http://a.example/p2", "@type": "@id"} },
  "@id": "_:!@#$%^&*()<>{}~`;' asdf",
  "p1": "_:!@#$%^&*()<>{}~`;' asdf",
  "p2": "_:!@#$%^&*()<>{}~`; asdf"
}
_:b0 <http://a.example/p1> _:b0 .
_:b0 <http://a.example/p2> _:b0 .

In this PR, I tweaked the JSG to ensure that IRIREF and BNODE are disjoint.

tagging @afs as he may be interested in the JSON-LD aspects