Skip to content

Commit b1d587a

Browse files
Add support for Contextive Glossary files (SchemaStore#4580)
* Add support for Contextive Glossary files * Fix prettier issues
1 parent a3ff09c commit b1d587a

File tree

6 files changed

+153
-0
lines changed

6 files changed

+153
-0
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ src/test/ctfd/* @pandatix @NicoFgrx
3737
src/schemas/json/cargo.json @yassun7010
3838
src/schemas/json/tombi.json @yassun7010
3939
src/schemas/json/pyproject.json @yassun7010
40+
41+
# Managed by Contextive Team:
42+
src/schemas/json/contextive-glossary.json @chrissimon-au

src/api/json/catalog.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7754,6 +7754,12 @@
77547754
"description": "Open Source Hardware project metadata",
77557755
"fileMatch": ["okh.{json,toml,yml,yaml}", "*.okh.{json,toml,yml,yaml}"],
77567756
"url": "https://json.schemastore.org/okh.json"
7757+
},
7758+
{
7759+
"name": "Contextive Glossary",
7760+
"description": "A Contextive Domain Language Glossary",
7761+
"fileMatch": ["**/.contextive/definitions.yml", "*.glossary.yml"],
7762+
"url": "https://json.schemastore.org/contextive-glossary.json"
77577763
}
77587764
]
77597765
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# yaml-language-server: $schema=../../schemas/json/contextive-glossary.json
2+
# Invalid definitions. Context is missing a terms key.
3+
contexts:
4+
- name: Context name
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# yaml-language-server: $schema=../../schemas/json/contextive-glossary.json
2+
# Invalid definitions. Term is missing a `name` key
3+
contexts:
4+
- terms:
5+
- definition: A term with an invalid schema in the definitions.yml
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://json.schemastore.org/contextive.glossary.json",
4+
"additionalProperties": true,
5+
"properties": {
6+
"contexts": {
7+
"description": "A list of contexts - see https://docs.contextive.tech/ide/guides/setting-up-glossaries/.",
8+
"type": "array",
9+
"items": {
10+
"title": "Context",
11+
"description": "A context in the ubiquitous language, consisting of a list of terms.",
12+
"type": "object",
13+
"properties": {
14+
"name": {
15+
"title": "Name",
16+
"description": "The name of the Context.",
17+
"type": "string",
18+
"examples": ["The Context's Name"]
19+
},
20+
"domainVisionStatement": {
21+
"title": "Domain Vision Statement",
22+
"description": "A statement that describes the purpose of the Context.",
23+
"type": "string",
24+
"examples": [
25+
"A statement that describes the purpose of the context."
26+
]
27+
},
28+
"paths": {
29+
"title": "Paths",
30+
"description": "A list of paths that the Context is involved in.",
31+
"type": "array",
32+
"items": {
33+
"title": "Path",
34+
"description": "A path that the Context is involved in.",
35+
"type": "string"
36+
},
37+
"minItems": 1,
38+
"uniqueItems": true
39+
},
40+
"terms": {
41+
"title": "Terms",
42+
"description": "A list of Terms in the Context - see https://docs.contextive.tech/ide/guides/defining-terminology/.",
43+
"type": "array",
44+
"items": {
45+
"title": "Term",
46+
"description": "A Term in the Context.",
47+
"type": "object",
48+
"properties": {
49+
"name": {
50+
"title": "Name",
51+
"description": "The name of the Term.",
52+
"type": "string",
53+
"examples": ["The Term's Name"]
54+
},
55+
"definition": {
56+
"title": "Definition",
57+
"description": "A definition of the Term in this Context.",
58+
"type": "string",
59+
"examples": ["A definition of the Term in this Context."]
60+
},
61+
"examples": {
62+
"title": "Examples",
63+
"description": "A list of example sentences using the Term.",
64+
"type": "array",
65+
"items": {
66+
"title": "Example sentence",
67+
"description": "An example sentence using the Term.",
68+
"type": "string",
69+
"examples": ["An example sentence using the Term."]
70+
},
71+
"minItems": 1,
72+
"uniqueItems": true
73+
},
74+
"aliases": {
75+
"title": "Aliases",
76+
"description": "A list of aliases for the Term.",
77+
"type": "array",
78+
"items": {
79+
"title": "Alias",
80+
"description": "An alias for the Term.",
81+
"type": "string",
82+
"examples": ["An alias for the Term."]
83+
},
84+
"minItems": 1,
85+
"uniqueItems": true
86+
}
87+
},
88+
"required": ["name"]
89+
},
90+
"minItems": 1,
91+
"uniqueItems": true
92+
}
93+
},
94+
"required": ["terms"]
95+
},
96+
"minItems": 1,
97+
"uniqueItems": true
98+
}
99+
},
100+
"required": ["contexts"],
101+
"type": "object"
102+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# yaml-language-server: $schema=../../schemas/json/contextive-glossary.json
2+
contexts:
3+
- name: Demo
4+
domainVisionStatement: To illustrate the usage of the contextive glossary file.
5+
terms:
6+
- name: context
7+
definition: A boundary within which words have specific meanings.
8+
examples:
9+
- In the _Sales_ context, the language focuses on activities associated with selling products.
10+
- Are you sure you're thinking of the definition from the right context?
11+
- name: term
12+
definition: A protected word in a given context.
13+
examples:
14+
- _Order_ is a term that is meaningful in the _Sales_ context.
15+
- What term should we use to describe what happens when a customer buys something from us?
16+
aliases:
17+
- word
18+
- name: alias
19+
definition: >-
20+
An alternative word for the same concept.
21+
22+
It might be a legacy term, or an alternative term that is in common use while the ubiquitous language is still being adopted.
23+
examples:
24+
- _Product_ is an alias of _Item_ in the Sales context.
25+
- name: definition
26+
definition: A short summary defining the meaning of a term in a context.
27+
examples:
28+
- 'The definition of _Order_ in the _Sales_ context is: "The set of _Items_ that are being sold as part of this _Order_".'
29+
- Can you provide a definition of the term _Order_?
30+
- name: example
31+
definition: A sentence illustrating the correct usage of the term in the context.
32+
examples:
33+
- Can you give me an example of how to use the term _Order_ in this context?

0 commit comments

Comments
 (0)