Skip to content
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

Dynamic Things and semantic vocabularies (@context) #84

Closed
mkovatsc opened this issue Jan 17, 2018 · 3 comments
Closed

Dynamic Things and semantic vocabularies (@context) #84

mkovatsc opened this issue Jan 17, 2018 · 3 comments

Comments

@mkovatsc
Copy link
Contributor

Thinking a bit more about implementation aspects for handling semantics, I came to the following conclusions (for now):

  • The API for semantic annotations it quite clumsy at the moment
  • Dynamically changing the vocabulary of a TD introduces a lot of complexity for handling Things (i.e., is bad) -- often WoT Client must rely on a fixed set of vocabularies that are implemented (no dynamic loading and reasoning)
  • Might be best to limit declaration of @context entries, and hence prefixes and possible annotations to the WoT.expose() function
  • Using a different set of @context entries would need the creation of a new ExposedThing object -- as it is also a fundamental change in the Thing
@zolkis
Copy link
Contributor

zolkis commented Jan 17, 2018

I definitely agree with this thinking. Any change proposals in the API itself, or the changes should apply to the algorithm definitions?

I would offload the scripting API from semantics, TD vocabularies etc. My current understanding is that the scripting use cases are doable with TD related data regarded as opaque strings from scripts.

That is, we can expose a thing if a TD is provided to the script (as an opaque string) - the implementation will know how to parse, identify versions, map to protocol bindings, etc.

Some things we could change from scripts - the question is what is the minimum amount for our use cases.

@mkovatsc
Copy link
Contributor Author

mkovatsc commented Jan 17, 2018

Well, not fully decoupled, which would void the programmatic approach to Things and their TDs.

In the current proposal, see

dictionary SemanticType {
    DOMString name;
    USVString context;
    DOMString prefix;
};

and

...
sequence<SemanticType>? semanticTypes = [];
...

in the Thing*Init dictionaries.

The complex SemanticType declaration should be moved to expose(). The Thing*Inits then could rely on simple string, as prefix and context are nailed down. Yet here it could be left for the implementation whether it checks the string against the declaration and throws an error as support, or does not and simply serializes -- in the end, the script author is responsible that the Thing/TD makes sense...

@zolkis
Copy link
Contributor

zolkis commented Jun 8, 2018

Should be fixed by #113.

@zolkis zolkis closed this as completed Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants