Comments (6)
the prefix name should actually be independent. The actual namespace behind the prefix (= http://www.w3.org/2011/http#) is important. We need a generic processing of this.
from node-wot.
The TD (per default) has now htv
bind to http://www.w3.org/2011/http#
.
Hence I think
htv:methodName
can be used without an additional@context
definition- An additional
@context
definition such as"abc": "http://www.w3.org/2011/http#"
should be still possible/allowed and needs to be processed properly by node-wot
from node-wot.
I wonder which is the better solution.
-
the simpler approach of adding a JSON-LD library to node-wot that parses initially the provided TD and rewrites prefixes according to our understanding (e.g.,
http://www.w3.org/2011/http#
to tohtv
).
This means no big change in the rest of the code -
an actual rewrite with passing
"@context"
array or the entire TD everywhere
(makes it also safer/better for possible future updates/changes)
from node-wot.
I am not sure if I understand the first one since how could you know where to look at? What if I have a TD like the following:
{
"@context": [
"https://www.w3.org/2019/wot/td/v1",
{ "wow": http://www.w3.org/2011/http#" }
],
...
"properties": {
"weather": {
"forms": [{
"href" : "http://example.org/weather",
"wow:methodName": "GET"
}]
},
...
},
...
}
I think the reason I am confused is because we don't necessarily need JSON-LD support here since we need to find where we have http://www.w3.org/2011/http#
and replace wow
with htv
no?
from node-wot.
I think the reason I am confused is because we don't necessarily need JSON-LD support here since we need to find where we have
http://www.w3.org/2011/http#
and replacewow
withhtv
no?
You are right. We can walk over all JSON keys and replace any "wow:"
with "htv:"
. I was just thinking that this rewrite is better than with a library. I am not sure if there are (or can be) some corner cases that make it more difficult like
- "https://www.w3.org/2019/wot/td/v1" mapped to "td" and "http://www.w3.org/2011/http#" to default context et cetera
- ...
Shall we go with this simple rewrite solution?
from node-wot.
Currently, in the spec, we force the prefix to be the one specified (e.g. for HTTP is htv
, for modbus modv
). This ensures the support for non-JSON-LD parsers. Closing the issue.
from node-wot.
Related Issues (20)
- Upgrading to ES2021 HOT 2
- allowSelfSigned not working for requestThingDescription HOT 4
- findProtocol SHOULD NOT require base HOT 4
- CI - Add Node.js 22 to CI tests
- CoAP issue on local machine (Windows) - nO HOT 2
- Async actions should not try to validate the value according DataSchema
- action and event affordance do not raise error when data schema does not match HOT 1
- events without subprotocol might be causing unexpected behaviour HOT 3
- Export WoT implementation type
- Modbus Test issue with modv:function HOT 1
- Issue with void-obj of Test Thing HOT 1
- Follow-up on validating output for (async) actions
- Re-creating package-lock.json fails HOT 7
- observe property deserialized value (may) not (be) completely consistent HOT 5
- Deprecating tm-helpers from node-wot HOT 3
- [test] Convert unhandledRejection to uncaughtException
- TODOs after major release
- Re-activate mbus tests on Windows
- two netconf-codec.ts files
- Replacing Protocol and Port Detection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-wot.