/
Feature Plan - Chouette Valid - Ruleset management

Feature Plan - Chouette Valid - Ruleset management

Manage Ruleset via API & Secretary Command Line Client

The user can manage Rulesets via API and Secretary Command Line Client:

secretary-client create ruleset --name="Sample" --slug="sample" rules.json secretary-client get ruleset sample secretary-client patch ruleset sample --definition=rules.json secretary-client delete ruleset sample

Define Rules with a JSON file

The user can define the Rules and their Rule Contexts via a JSON file:

[ { "rule_context": "resource/kind_of", "classes": ["Quay", "StopPlace"], "rules": [ { "rule": "attribute/mandatory", "name": "latitude", "criticity": "error", "code": "latitude-mandatory", "message": "Una parada debe estar ubicada geográficamente. Indicar una latitud" }, { "rule": "attribute/mandatory", "name": "longitude", "criticity": "error", "code": "longitude-mandatory", "message": "Una parada debe estar ubicada geográficamente Indicar una longitud" } ] }, { "rule": "reference/exists", "referenced_classes": ["Quay", "StopPlace", ..., "OperationPeriod"], "criticity": "warning", "code": "unknown-reference" } ]

Available Rule Contexts

  • resource/kind_of

  • attribute/match

  • reduce/elementNEW

  • reduce/collection NEW

Available Rules

  • resource/mandatory

  • resource/class

  • attribute/value

  • attribute/mandatory

  • attribute/match

  • reference/exists

  • reference/version

  • tag/match

 

Related content