diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 15d9bf9f891..c0a50ee5c75 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -37,3 +37,6 @@ src/test/ctfd/* @pandatix @NicoFgrx src/schemas/json/cargo.json @yassun7010 src/schemas/json/tombi.json @yassun7010 src/schemas/json/pyproject.json @yassun7010 + +# Managed by Contextive Team: +src/schemas/json/contextive-glossary.json @chrissimon-au \ No newline at end of file diff --git a/src/api/json/catalog.json b/src/api/json/catalog.json index 50bc4fbca20..14a10110d01 100644 --- a/src/api/json/catalog.json +++ b/src/api/json/catalog.json @@ -7754,6 +7754,12 @@ "description": "Open Source Hardware project metadata", "fileMatch": ["okh.{json,toml,yml,yaml}", "*.okh.{json,toml,yml,yaml}"], "url": "https://json.schemastore.org/okh.json" + }, + { + "name": "Contextive Glossary", + "description": "A Contextive Domain Language Glossary", + "fileMatch": ["**/.contextive/definitions.yml", "*.glossary.yml"], + "url": "https://json.schemastore.org/contextive-glossary.json" } ] } diff --git a/src/negative_test/contextive-glossary/missing-context-terms.yml b/src/negative_test/contextive-glossary/missing-context-terms.yml new file mode 100644 index 00000000000..26e8aeabca5 --- /dev/null +++ b/src/negative_test/contextive-glossary/missing-context-terms.yml @@ -0,0 +1,4 @@ +# yaml-language-server: $schema=../../schemas/json/contextive-glossary.json +# Invalid definitions. Context is missing a terms key. +contexts: + - name: Context name diff --git a/src/negative_test/contextive-glossary/missing-term-name.yml b/src/negative_test/contextive-glossary/missing-term-name.yml new file mode 100644 index 00000000000..6b613321fcf --- /dev/null +++ b/src/negative_test/contextive-glossary/missing-term-name.yml @@ -0,0 +1,5 @@ +# yaml-language-server: $schema=../../schemas/json/contextive-glossary.json +# Invalid definitions. Term is missing a `name` key +contexts: + - terms: + - definition: A term with an invalid schema in the definitions.yml diff --git a/src/schemas/json/contextive-glossary.json b/src/schemas/json/contextive-glossary.json new file mode 100644 index 00000000000..cab466b430a --- /dev/null +++ b/src/schemas/json/contextive-glossary.json @@ -0,0 +1,102 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://json.schemastore.org/contextive.glossary.json", + "additionalProperties": true, + "properties": { + "contexts": { + "description": "A list of contexts - see https://docs.contextive.tech/ide/guides/setting-up-glossaries/.", + "type": "array", + "items": { + "title": "Context", + "description": "A context in the ubiquitous language, consisting of a list of terms.", + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "The name of the Context.", + "type": "string", + "examples": ["The Context's Name"] + }, + "domainVisionStatement": { + "title": "Domain Vision Statement", + "description": "A statement that describes the purpose of the Context.", + "type": "string", + "examples": [ + "A statement that describes the purpose of the context." + ] + }, + "paths": { + "title": "Paths", + "description": "A list of paths that the Context is involved in.", + "type": "array", + "items": { + "title": "Path", + "description": "A path that the Context is involved in.", + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + }, + "terms": { + "title": "Terms", + "description": "A list of Terms in the Context - see https://docs.contextive.tech/ide/guides/defining-terminology/.", + "type": "array", + "items": { + "title": "Term", + "description": "A Term in the Context.", + "type": "object", + "properties": { + "name": { + "title": "Name", + "description": "The name of the Term.", + "type": "string", + "examples": ["The Term's Name"] + }, + "definition": { + "title": "Definition", + "description": "A definition of the Term in this Context.", + "type": "string", + "examples": ["A definition of the Term in this Context."] + }, + "examples": { + "title": "Examples", + "description": "A list of example sentences using the Term.", + "type": "array", + "items": { + "title": "Example sentence", + "description": "An example sentence using the Term.", + "type": "string", + "examples": ["An example sentence using the Term."] + }, + "minItems": 1, + "uniqueItems": true + }, + "aliases": { + "title": "Aliases", + "description": "A list of aliases for the Term.", + "type": "array", + "items": { + "title": "Alias", + "description": "An alias for the Term.", + "type": "string", + "examples": ["An alias for the Term."] + }, + "minItems": 1, + "uniqueItems": true + } + }, + "required": ["name"] + }, + "minItems": 1, + "uniqueItems": true + } + }, + "required": ["terms"] + }, + "minItems": 1, + "uniqueItems": true + } + }, + "required": ["contexts"], + "type": "object" +} diff --git a/src/test/contextive-glossary/contextive-glossary.yml b/src/test/contextive-glossary/contextive-glossary.yml new file mode 100644 index 00000000000..85219b592f6 --- /dev/null +++ b/src/test/contextive-glossary/contextive-glossary.yml @@ -0,0 +1,33 @@ +# yaml-language-server: $schema=../../schemas/json/contextive-glossary.json +contexts: + - name: Demo + domainVisionStatement: To illustrate the usage of the contextive glossary file. + terms: + - name: context + definition: A boundary within which words have specific meanings. + examples: + - In the _Sales_ context, the language focuses on activities associated with selling products. + - Are you sure you're thinking of the definition from the right context? + - name: term + definition: A protected word in a given context. + examples: + - _Order_ is a term that is meaningful in the _Sales_ context. + - What term should we use to describe what happens when a customer buys something from us? + aliases: + - word + - name: alias + definition: >- + An alternative word for the same concept. + + It might be a legacy term, or an alternative term that is in common use while the ubiquitous language is still being adopted. + examples: + - _Product_ is an alias of _Item_ in the Sales context. + - name: definition + definition: A short summary defining the meaning of a term in a context. + examples: + - 'The definition of _Order_ in the _Sales_ context is: "The set of _Items_ that are being sold as part of this _Order_".' + - Can you provide a definition of the term _Order_? + - name: example + definition: A sentence illustrating the correct usage of the term in the context. + examples: + - Can you give me an example of how to use the term _Order_ in this context?