-
Notifications
You must be signed in to change notification settings - Fork 63
Use previously define uri for the td:name
and jsonschema:propertyName
#1169
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
Use previously define uri for the td:name
and jsonschema:propertyName
#1169
Conversation
fixes example 48 and 50
add script function to open tab
first working version of tm schema generation with string addition
Add additionalResponses to Form
TM Schema generation
TD schema restrictions
"jsonschema:propertyName"
td:name
and "jsonschema:propertyName"td:name
and jsonschema:propertyName
It took a change in my generated TD, but this does seem to fix the issue. However, something about this breaks the property affordance "type" key. It is now compacted as a full uri properties generated with proposed PR's context
Properties generated with current (Pre-PR) context:
|
Curiously, the rdf type issue doesnt affect a round trip of the example thing (compaction step), so the issue might be in my expanded form. |
The branch this context is based off of seems seriously out of date with the mainline context. I tried using it directly in testing and it types contentEncoding as an unsigned int, which seems to have been fixed a while ago. The branch reports This also explains why I had to change my expanded thing definition. The old version this is based off of supplied an "@index": "td:name", but the new version does not specify "@index" at all, leaving the expanded form to use the "@index" key instead of "https://www.w3.org/2019/wot/td#name" to index properties. |
Proposal: use version field in schemas
More fixes to canonicalization
add success to addResp and refactor addResp into definitions
move examples form description to skos:examples
Fix ContentEncoding and ContentMediaType
Hmm, I'm not a great git user and I tried a merge so that you would get the final context in this PR. I pasted the new generated context in your previous Playground example (the one with "http://www.w3.org/1999/02/22-rdf-syntax-ns#type") and it seems fine after this merge : |
This PR seems to have redundancies with #1077. I fixed the problem of indexing properties in that other PR. As I commented there, it should be merged soon-ish, because it overlaps with few other issues/PRs and leads to duplicated work... |
We fixed the problem defined here, and we rebase it on your proper PR. That's why there are redundancies. |
OK, I see. What commit da6956a does, however, is to turn full URIs (e.g. The consequence is that properties are not properly resolved in RDF and it doesn't seem to solve @RoboPhred's problem of round-tripping. An example: the following compacted form {
"@context": {
"properties": {
"@id": "https://www.w3.org/2019/wot/json-schema#properties",
"@container": "@index",
"@index": "propertyName"
},
"title": "http://purl.org/dc/terms/title"
},
"properties": {
"p": {
"title": "some test property"
}
}
} doesn't properly round-trip. The expanded, then re-compacted form is: {
"@context": {
"properties": {
"@id": "https://www.w3.org/2019/wot/json-schema#properties",
"@container": "@index",
"@index": "propertyName"
},
"title": "http://purl.org/dc/terms/title"
},
"properties": {
"@none": {
"title": "some test property"
}
}
} ( |
Not exactly, it does two things:
As precised in Murloc's comment, we use the alias as a workaround for an issue of the jsonld.js api (and in the w3c json ld api itself) where In your example, you do not define the alias, therefore, the round tripping does not work. |
Alright, my bad. I missed the part about the alias. The behavior of jsonld.js is beyond logic on that particular point... |
Yes, thank you, there was one td:name remaining, I left you a comment on the given PR. |
This is a temporary fix since there are ongoing issues in jsonld.js (digitalbazaar/jsonld.js#453) and in the api itself (w3c/json-ld-api#514).
The workaround here is to define properties "name" and "propertyName" because it is (for now) necessary for the "@index" property. The prefixed URI leads to an error and the full URI leads to a "@none" index.
c.f. #1161
Preview | Diff