-
Notifications
You must be signed in to change notification settings - Fork 19
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
Dealing with prefixed JSON-LD Files #1
Comments
First of all, this TD mixes up two things:
A context is a JSON object that simply defines mapping between strings and URIs. In the reference TD context, strings are mapped to fragments of the OWL ontology, e.g. http://w3c.github.io/wot/w3c-wot-td-ontology.owl#Thing. (See also 3.2.2.1 TD Context - Current Practices.) An OWL ontology contains logical statements (or axioms) to characterize Things and their Interactions. The TD ontology states for instance that the concept http://w3c.github.io/wot/w3c-wot-td-ontology.owl#Thing must have an associated Web resource (the TD itself) and some interactions available. Here, Thus, this TD cannot be valid. |
But... Even if we corrected these mistakes, and submitted the following TD to the validation tool, it would be rejected: var myTD = {
"@context": {
"wot":"http://w3c.github.io/wot/w3c-wot-td-ontology.owl",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"sch": "http://schema.org"
},
"@type": "wot:Thing",
"wot:name":"echonet",
"wot:isAssociatedTo": [
{
"@type": "wot:Property",
"wot:name": "operationStatus",
"wot:hasOutput": { "valueType": { "type": "boolean" }},
"wot:isWritable": true
}
]
} Why is that? The approved WG charter states that:
To me, validating this TD would require processing the local context and expanding CURIs, then comparing with the mappings provided in the standard TD context. This can already be thought of as "semantic" processing (or at least RDF processing), which means that some constrained clients could reject this TD if they did not support RDF. So the playground rejects it as well. On the other hand, as this TD has the same semantics as what one would expect, it can easily be pre-processed. Using some library complying to the JSON-LD API specification, e,g, jsonld.js, one simply needs to run the following to get a valid TD: jsonld.compact(myTD, "http://w3c.github.io/wot/w3c-wot-td-context.jsonld"); This transformation can also be done online, using the JSON-LD playground. |
What would be a good way forward?
|
Is this issue still relevant? @danielpeintner @vcharpenay |
I would say yes. It should not matter whether a tagname uses the default prefix (which may be null) pointing to a context or any other prefix pointing to the same context. |
Dec 2018 testfest
add expected behavior tests and comments
My assumption is that prefixed JSON-LD examples like the following should be valid.
see https://github.com/w3c/wot/blob/master/proposals/td-lifecycle/Echonet_def0.jsonld
It seems the tool expects
"wot:name":"echonet"
to be
"name":"echonet"
et cetera...
The text was updated successfully, but these errors were encountered: