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

Validation of OGC requirements as standalone YAML #242

Open
opoudjis opened this issue Aug 17, 2021 · 8 comments
Open

Validation of OGC requirements as standalone YAML #242

opoudjis opened this issue Aug 17, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@opoudjis
Copy link
Contributor

opoudjis commented Aug 17, 2021

metanorma/ogcapi-processes#2 has resulted in the addition of OGC requirements, properly specified, to metanorma-ogc, as documented in https://www.metanorma.org/author/ogc/topics/requirements/

The Modular Specification, https://www.ogc.org/standards/modularspec, has a grammar of OGC requirements, setting out the cardinalities and attributes of different types of requirement; see Appendix C of that document, which is also represented in https://github.com/opengeospatial/NamingAuthority/blob/master/definitions/models/modspec.ttl and in metanorma/metanorma-requirements-models#11 (which resulted in a LutaML encoding of the UML in ModSpec Appendix C).

It is desirable to validate requirements entered for OGC against this model. This validation could be done within metanorma, but it makes more sense to validate OGC requirements as standalone YAML files, to be included into OGC Metanorma documents via a lutaml plugin.

So

[recommendation,label=/ogc/recommendation/wfs/2,obligation=permission,subject=user,inherit=/ss/584/2015/level/1,classification="control-class:Technical;priority:P0"]
.Widgets
====
[.component,class=conditions]
---
. Candidate test subject is a witch
. Widget has been suitably calibrated for aerodynamics
---

[.component,class=part]
---
Determine travel distance by flight path
---

[[a2]]
[.component,class=part]
---
Independently verify flight path
---

Widgets are tested for aerodynamic flight potential in partnership with witches.
Consult local coven for more information.
====

would be sourced as a standalone YAML file looking like:

class: recommendation
type: requirement_class
obligation: permission
label: /ogc/recommendation/wfs/2
subject: user
inherit: /ss/584/2015/level/1
classification:
  control-class: technical
  priority: p0
caption: Widgets
component:
  conditions:
    - Candidate test subject is a witch
    - Widget has been suitably calibrated for aerodynamics
  part:
    - Determine travel distance by flight path
    - Independently verify flight path

text: |
  Widgets are tested for aerodynamic flight potential in partnership with witches.
  Consult local coven for more information.

And the file would be validated by lutaml for conformance to the UML grammar according to its type.

@ghobona
Copy link

ghobona commented Nov 6, 2023

Discussed with OGC staff on 2023-11-06.

Agreement to leave this Issue open until a resource becomes available to work on it.

The resource would be a ruby developer that understands the ModSpec.

@opoudjis opoudjis assigned ronaldtse and unassigned w00lf Dec 10, 2023
@opoudjis opoudjis added the enhancement New feature or request label Dec 10, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Dec 10, 2023
@ghobona
Copy link

ghobona commented Feb 15, 2024

Discussed 2024-02-15

Ribose will provide a prototype for showing to the OAB.

@ghobona
Copy link

ghobona commented Mar 19, 2024

@opoudjis to look into whether there is a schema validation tool/language for YAML (e.g. similar to JSON Schema or XSD).

@opoudjis
Copy link
Contributor Author

opoudjis commented Mar 19, 2024

Done in #493 (comment) . There are lots of ad hoc schemas specific to implementations, and done as YAML objects themselves. But the standard way of doing it is JSON Schema, since JSON and YAML are both just serialisations of objects; and there is a well-used Ruby implementation of JSON Schema. JSON Schema is kind of clumsy, but I would recommend its use as a recognised standard.

@ronaldtse
Copy link
Contributor

Validation implementation:

@ronaldtse
Copy link
Contributor

This is done in:

@opoudjis opoudjis self-assigned this Sep 9, 2024
@opoudjis
Copy link
Contributor Author

opoudjis commented Sep 9, 2024

Review and confirm

@opoudjis opoudjis moved this from 🆕 New to 👀 In review in Metanorma Sep 11, 2024
@opoudjis opoudjis moved this from 👀 In review to 🏗 In progress in Metanorma Oct 16, 2024
@opoudjis
Copy link
Contributor Author

opoudjis commented Oct 16, 2024

This ticket did ask for schema validation, but the deserialisation is strongly bound to the schema, so it's not clear there is much point in doing so.

metanorma/mn-requirements#30 will make it possible to swap between validating a Modspec YAML suite, and validating Modspec in the context of a document: both will be validated as a suite of Modspec objects. This ticket will then refactor mn-requirements so that it uses the validation methods ported to modspec-ruby, and so that it does validation of Modspec extracted out of a Metanorma document. It will also do schema validation, if we have a schema worth validating against.

@opoudjis opoudjis moved this from 🏗 In progress to On hold in Metanorma Oct 16, 2024
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
Status: On hold
Development

No branches or pull requests

4 participants