-
Notifications
You must be signed in to change notification settings - Fork 63
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
Simplified TD: schema #107
Comments
Please read the text. JSON Schema syntax is not compatible with JSON-LD, and hence a Linked Data representation. Using it would break the TD model and exclude data schemas from reasoning/machine-handling, which is bad. Furthermore, until now we (WoT WG and JSON Schema authors) could not find a good solution to integrate semantic annotations in JSON Schema to go the other direction. Thus, we are only using the JSON Schema vocabulary and use the TD syntax, resulting in a "Linked Data Schema". The syntax given in Example 1 is correct, it is WoT TD syntax. Note: We are still very interested in finding a solution that would work across all these standards! So far, our requirement for JSON-LD was higher, hence we followed that alignment. With JSON-LD 1.1 now having a working group charter, it is becoming an option to move it toward JSON Schema, which at a first glance (see #102) looks possible. Units are not syntactic information, but semantic information. As far as I know, they are hence not part of JSON Schema. @handrews please correct or add your view on this. Thus units would go into the semantic annotations or LD metadata (additional key-value pairs in the elements). We had them once as part of the common TD vocabulary, but then postponed as it was a rather trivial brush-up that can be done toward the end, when the big questions are finished. A main question is, which of the many unit ontologies to pick... |
In w3c/wot#393 @benfrancis wrote:
|
NOTE: I'm going to say "schema vocabulary" for the JSON Schema concept of vocabularies to keep it separate from the more well established JSON-D vocabulary concept. Let's assume that plain vocabulary means a JSON-LD vocabulary
Is there a concise definition of the incompatibility that I can read up on? Just a link to the appropriate part of the JSON-LD spec that conflicts would suffice. @mkovatsc I clicked on your "text" link above but it seems to just say that it generally "breaks paradigms". Aside from that, I particularly do not understand this comment:
I had thought that JSON-LD was quite flexible about mapping some terms to other terms, so is there a reason that The JSON-LD JSON-LD-only meta-schema: {
"$id": "https://json-schema.org/draft-08/vocabularies/json-ld",
"$schema": "http://json-schema.org/draft-08/schema#",
"patternProperties": {
"^@": true
}
} Meta-schema for use with the TD: {
"$id": "https://example.org/wot/schemas/td",
"$schema": "http://json-schema.org/draft-08/schema#",
"$vocabularies": [
"http://json-schema.org/draft-08/vocabularies/core-applicators",
"http://json-schema.org/draft-08/vocabularies/validation-assertions",
"http://json-schema.org/draft-08/vocabularies/json-ld"
],
"allOf": [
{"$ref": "http://json-schema.org/draft-08/vocabularies/core-applicators"},
{"$ref": "http://json-schema.org/draft-08/vocabularies/validation-assertions"},
{"$ref": "http://json-schema.org/draft-08/vocabularies/json-ld"}
],
"$comment": "plus any custom properties specific to the TD would be defined here"
} I apologize if I'm asking for things that were well covered elsewhere, but as we seem to be re-focusing the discussions, having all of the problems with JSON Schema laid out clearly in one place would be helpful. |
The main incompatibility is that with JSON-LD 1.0, we cannot use objects, but always must use arrays for correctly modeling complex types. Yet JSON Schema makes extensive use of objects, as it is much nicer. For the sake of a single solution, we now look into options to base the TD on JSON-LD 1.1, which is work-in-progress, and hence problematic as normative dependency. Let's discuss this issue and why now elsewhere. Anyhow, the great news is that with JSON-LD 1.1, we can use object notation and derive the correct triples describing the schema in Linked Data. In #102 you already saw that it could work out, but let's wait for @vcharpenay to confirm the underlying OWL model. One issue still is how to deal with
When using a single entry point When going back to three entry points However: I experimented with the concept of @draggett 's proposal, where Properties can be recursive, however, I kept the ability to identify and address individual Properties through a URI -- in particular the top-level one. This makes TD @handrews I think we need to check if that matches your concept of assigning |
@mkovatsc I have filed json-ld/json-ld.org#612 to sort out questions regarding JSON-LD's JSON Schema, to see how to fit it into the schema vocabulary concept we have filed as json-schema-org/json-schema-spec#561
That sounds at least plausibly similar to attaching links to a sub-property in JSON Hyper-Schema. There are three contact points to a JSON Hyper-Schema link:
The target is always URI-identified. The context should be URI-identified, but if the link is attached to some place other than the root of a document, and the document's media type does not define a suitable fragment syntax, then a JSON Pointer may be needed to fully identify the context (need to think on how that fits with RFC 8288). The attachment point is literally the location in the instance to which the link is attached. So given a collection of elements. a link with A {
"type": "object",
"links": [{
"rel": "self",
"href": "/things",
"targetSchema": {"$ref": "#"}
}],
"properties": {
"elements": {
"type": "array",
"items": {
"properties": {"id": {"type": "integer", "minimum": 1}},
"links": [{
"rel": "item",
"anchor": "/things",
"href": "/things/{id}",
},{
"rel": "self",
"href": "/things/{id}",
},{
"rel": "collection",
"href": "/things",
"targetSchema": {"$ref": "#"}
}]
}
}
}
} For the two element links that do not set
which merging rules do you have in mind? There have been several "merge" proposals in JSON Schema, most of which have been rejected in favor of several other features and approaches. |
Since w3c/wot#393 is closed and schema is now part of the TD we can close this issue. |
Moderated focused discussion on the Simplified TD proposal and
schema
. Please stay on topic and use w3c/wot#393 for any general remarks.In w3c/wot#393 @benfrancis wrote:
The text was updated successfully, but these errors were encountered: