There seems some not expected behavior when we want to see the triples of the forms of a property. Please see the following example in the JSON-LD playground and check the N-Quads tab: example.
The triples for the forms are missing such as "htv:method". However, when I change the definition in the context such as here the triples appears as expected.
Any ideas?
It seems to be a jsonld.js problem. @gkellogg's Ruby implementation gives the expected result. @dlongley @dlehn any idea?
@davidlehn -- seems related to: https://github.com/digitalbazaar/jsonld.js/issues/394
@dlongley @davidlehn, this is up for discussion on an upcoming joint meeting at TPAC between WoT and JSON-LD working groups, can we either resolve this or update the status?
looking again at the example on the playground, it seems the problem has changed: statements about the form are now present but IRIs are not correctly resolved. Instead of td:hasForm, we get jsonschema:forms, for instance (the processor ignores individual term definitions and relies on the vocabulary definition instead).
Expected (obtained when including an empty context {}, as pointed out by @sebastiankb):
<urn:dev:ops:32473-WoTLamp-1234> <http://purl.org/dc/terms/title> "MyLampThing" .
<urn:dev:ops:32473-WoTLamp-1234> <https://www.w3.org/2019/wot/td#hasPropertyAffordance> _:b0 .
_:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2019/wot/json-schema#StringSchema> .
_:b0 <https://www.w3.org/2019/wot/json-schema#propertyName> "status" .
_:b0 <https://www.w3.org/2019/wot/td#hasForm> _:b1 .
_:b1 <http://www.w3.org/2011/http#method> "GET" .
_:b1 <https://www.w3.org/2019/wot/hypermedia#hasTarget> <https://mylamp.example.com/status> .
Actual:
<urn:dev:ops:32473-WoTLamp-1234> <http://purl.org/dc/terms/title> "MyLampThing" .
<urn:dev:ops:32473-WoTLamp-1234> <https://www.w3.org/2019/wot/td#hasPropertyAffordance> _:b0 .
_:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/2019/wot/json-schema#StringSchema> .
_:b0 <https://www.w3.org/2019/wot/json-schema#forms> _:b1 .
_:b0 <https://www.w3.org/2019/wot/json-schema#propertyName> "status" .
_:b1 <http://www.w3.org/2011/http#method> "GET" .
_:b1 <https://www.w3.org/2019/wot/json-schema#href> "https://mylamp.example.com/status" .
The fix from https://github.com/digitalbazaar/jsonld.js/issues/394 to handle empty scoped contexts is now live on the playground. I'm not sure how to check if the use case here was addressed by that fix. It does look like at least both examples produce the same output. Are the example links out of date? That "security" property value is expanding with the playground URL prefix.
@vcharpenay: The playground and jsonld.js code hadn't changed in quite a long time, so the behavior wouldn't have changed recently. However, the remote context might have changed causing different output.
The problem has indeed been fixed on the playground. Thanks!
Most helpful comment
@davidlehn -- seems related to: https://github.com/digitalbazaar/jsonld.js/issues/394