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

JSON Schema VersionInfo #2045

Open
mahdanoura opened this issue Sep 13, 2024 · 6 comments
Open

JSON Schema VersionInfo #2045

mahdanoura opened this issue Sep 13, 2024 · 6 comments
Labels
Data Schema Official Editorial Errata TD1.1 Confirmed An editorial errata has been confirmed by the TF or delegation

Comments

@mahdanoura
Copy link
Contributor

mahdanoura commented Sep 13, 2024

According to the specification, the version must have an instance and can have an optional model keyword. This is not fully reflected in the current JSON schema.

@github-actions github-actions bot added the needs-triage Automatically added to new issues. TF should triage them with proper labels label Sep 13, 2024
@egekorkan egekorkan removed the needs-triage Automatically added to new issues. TF should triage them with proper labels label Sep 16, 2024
@egekorkan
Copy link
Contributor

Even though the table says that, the model keyword is restricted to TMs only. That is why, the TM JSON Schema contains it at https://github.com/w3c/wot-thing-description/blob/main/validation/tm-json-schema-validation.json#L1914 . It would also not make sense to have the TM version in a TD since linking to a TM should be enough.

As a separate point, assuming that this is a real mistake, we would mark this as errata since this fix would need to be applied to TD 1.1 schemas. Furthermore, this gives a nice example on how we would need to version our JSON Schemas. There was a discussion before whether this would be a breaking change or not since this adds a new restriction. We agreed that it is not a breaking change.

@JKRhb
Copy link
Member

JKRhb commented Sep 16, 2024

Even though the table says that, the model keyword is restricted to TMs only. That is why, the TM JSON Schema contains it at https://github.com/w3c/wot-thing-description/blob/main/validation/tm-json-schema-validation.json#L1914 . It would also not make sense to have the TM version in a TD since linking to a TM should be enough.

If I am not mistaken, this is partly related to the fact that you need to take over all the fields of a TM (except for affordances including in tm:optional) into the resulting TD – so if there is a model version present in the TM, it will also end up in the TD. So for that case, it might make sense to include it in the JSON Schema until TD 2.0 (also see #2042 for a potential fix).

@relu91
Copy link
Member

relu91 commented Sep 16, 2024

I found the description a little bit confusing too, but then I realized @JKRhb's point so that's why I think that in the end adding to TD 1.1 JSON schema would be correct even if not perfect.

@mahdanoura
Copy link
Contributor Author

The TD generated in Example 65 from TM composition process provides both model and instance.

@egekorkan egekorkan added the Official Editorial Errata TD1.1 Confirmed An editorial errata has been confirmed by the TF or delegation label Sep 16, 2024
@egekorkan
Copy link
Contributor

egekorkan commented Sep 16, 2024

Ok, you are all correct. Given that the example shows that and the spec does not say it must be removed, it should be fixed in the schema.

I am adding erratum raised label (its temporary version, a PR for errata management is coming soon).

@egekorkan
Copy link
Contributor

TD Call: The model keyword is defined twice in the ontologies. @mahdanoura will check that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Schema Official Editorial Errata TD1.1 Confirmed An editorial errata has been confirmed by the TF or delegation
Projects
None yet
Development

No branches or pull requests

4 participants