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

Suggestion: require definition for schema extension #434

Open
monique2208 opened this issue Apr 28, 2022 · 5 comments
Open

Suggestion: require definition for schema extension #434

monique2208 opened this issue Apr 28, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@monique2208
Copy link

All terms in the HED schema are defined. When a user extends the schema, a definition should also be required. This could also improve HED validation. Currently the HED validator throws a warning when the schema is extended by the user, to check if this was intended. If a definition is required, it can be checked for and there does not need to be an warning in case there is a definition, and unintended extension can be identified better.

@dungscout96
Copy link
Member

Some extensions might be apparently clear, e.g. Vehicle/Motorcycle. For an extension containing non-obvious term maybe we can ask people to group it with a Description/ tag.

@VisLab VisLab added the enhancement New feature or request label Jun 11, 2022
@VisLab
Copy link
Member

VisLab commented Jan 21, 2023

@monique2208
There isn't a convenient place to put a description except by including a Description tag in the overall annotation.
As things have evolved, this is the role of annotation tools not the validator.

We could modify the validator so that the warning message will include an exhortation to please make sure that the overall annotation for this event has a description?

@VisLab
Copy link
Member

VisLab commented Feb 22, 2024

@IanCa @happy5214 what warning is raised when a tag is extended and what message is output in the respective Python and JavaScript validators?

@IanCa
Copy link
Member

IanCa commented Feb 22, 2024

Valid extension warning:
TAG_EXTENDED: "Hed tag is extended. '/WarningExt' in Task-property/WarningExt Problem spans string indexes: 13, 24"(warning)

Invalid extension(reusing term):
TAG_EXTENSION_INVALID: "In 'Experiment-control/Animal-agent', 'Animal-agent' appears as 'Agent/Animal-agent' and cannot be used as an extension. Problem spans string indexes: 19, 31"

(Non extension allowed)
'TAG_EXTENSION_INVALID', 'message': 'Invalid extension on tag - "Event/Nonsense" Problem spans string indexes: 0, 14',

@happy5214
Copy link
Member

Using the three tag examples above:

WARNING: [TAG_EXTENDED] Tag extension found - "Task-property/WarningExt". (For more information on this HED warning, see https://hed-specification.readthedocs.io/en/latest/Appendix_B.html#tag-extended.)

ERROR: [TAG_EXTENSION_INVALID] "Animal-agent" appears as "Agent/Animal-agent" and cannot be used as an extension. Indices (45, 57). (For more information on this HED error, see https://hed-specification.readthedocs.io/en/latest/Appendix_B.html#tag-extension-invalid.)

ERROR: [TAG_INVALID] Invalid tag - "Event/Nonsense". (For more information on this HED error, see https://hed-specification.readthedocs.io/en/latest/Appendix_B.html#tag-invalid.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants