Skip to content

Commit c0355c7

Browse files
feat(contextive): add support for imports key and yaml extension in filematch (SchemaStore#4711)
1 parent 3491ad8 commit c0355c7

File tree

7 files changed

+161
-91
lines changed

7 files changed

+161
-91
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ src/schemas/json/pyproject.json @yassun7010
4040

4141
# Managed by Contextive Team:
4242
src/schemas/json/contextive-glossary.json @chrissimon-au
43+
src/test/contextive-glossary/ @chrissimon-au
44+
src/negative_test/contextive-glossary/ @chrissimon-au
4345

4446
# pnpm Schemas:
4547
src/schemas/json/pnpm-workspace.json @danielbayley @btea

src/api/json/catalog.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8020,7 +8020,11 @@
80208020
{
80218021
"name": "Contextive Glossary",
80228022
"description": "A Contextive Domain Language Glossary",
8023-
"fileMatch": ["**/.contextive/definitions.yml", "*.glossary.yml"],
8023+
"fileMatch": [
8024+
"**/.contextive/definitions.yml",
8025+
"*.glossary.yml",
8026+
"*.glossary.yaml"
8027+
],
80248028
"url": "https://json.schemastore.org/contextive-glossary.json"
80258029
},
80268030
{
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# yaml-language-server: $schema=../../schemas/json/contextive-glossary.json
2+
# Invalid definitions. No contexts or imports keys.
3+
imports:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# yaml-language-server: $schema=../../schemas/json/contextive-glossary.json
2+
# Invalid definitions. No contexts or imports keys.
Lines changed: 109 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,121 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://json.schemastore.org/contextive.glossary.json",
3+
"$id": "https://json.schemastore.org/contextive-glossary.json",
44
"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"]
5+
"description": "https://docs.contextive.tech/community/guides/setting-up-glossaries/",
6+
"anyOf": [
7+
{
8+
"properties": {
9+
"imports": {
10+
"description": "A list of urls, paths or relative paths to be imported into the current glossary scope. See https://docs.contextive.tech/community/guides/setting-up-glossaries/#terms-defined-in-an-external-data-source.",
11+
"type": "array",
12+
"items": {
13+
"type": "string"
1914
},
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."]
15+
"minItems": 1,
16+
"uniqueItems": true
17+
}
18+
},
19+
"required": ["imports"]
20+
},
21+
{
22+
"properties": {
23+
"contexts": {
24+
"description": "A list of contexts. See https://docs.contextive.tech/community/guides/setting-up-glossaries/#bounded-contexts.",
25+
"type": "array",
26+
"items": {
27+
"title": "Context",
28+
"description": "A context in the ubiquitous language, consisting of a list of terms.",
29+
"type": "object",
30+
"properties": {
31+
"name": {
32+
"title": "Name",
33+
"description": "The name of the Context.",
34+
"type": "string",
35+
"examples": ["The Context's Name"]
36+
},
37+
"domainVisionStatement": {
38+
"title": "Domain Vision Statement",
39+
"description": "A statement that describes the purpose of the Context.",
40+
"type": "string",
41+
"examples": [
42+
"A statement that describes the purpose of the context."
43+
]
44+
},
45+
"paths": {
46+
"title": "Paths",
47+
"description": "A list of paths that the Context is involved in.",
48+
"type": "array",
49+
"items": {
50+
"title": "Path",
51+
"description": "A path that the Context is involved in.",
52+
"type": "string"
6053
},
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."]
54+
"minItems": 1,
55+
"uniqueItems": true
56+
},
57+
"terms": {
58+
"title": "Terms",
59+
"description": "A list of Terms in the Context - see https://docs.contextive.tech/ide/guides/defining-terminology/.",
60+
"type": "array",
61+
"items": {
62+
"title": "Term",
63+
"description": "A Term in the Context.",
64+
"type": "object",
65+
"properties": {
66+
"name": {
67+
"title": "Name",
68+
"description": "The name of the Term.",
69+
"type": "string",
70+
"examples": ["The Term's Name"]
71+
},
72+
"definition": {
73+
"title": "Definition",
74+
"description": "A definition of the Term in this Context.",
75+
"type": "string",
76+
"examples": ["A definition of the Term in this Context."]
77+
},
78+
"examples": {
79+
"title": "Examples",
80+
"description": "A list of example sentences using the Term.",
81+
"type": "array",
82+
"items": {
83+
"title": "Example sentence",
84+
"description": "An example sentence using the Term.",
85+
"type": "string",
86+
"examples": ["An example sentence using the Term."]
87+
},
88+
"minItems": 1,
89+
"uniqueItems": true
90+
},
91+
"aliases": {
92+
"title": "Aliases",
93+
"description": "A list of aliases for the Term.",
94+
"type": "array",
95+
"items": {
96+
"title": "Alias",
97+
"description": "An alias for the Term.",
98+
"type": "string",
99+
"examples": ["An alias for the Term."]
100+
},
101+
"minItems": 1,
102+
"uniqueItems": true
103+
}
70104
},
71-
"minItems": 1,
72-
"uniqueItems": true
105+
"required": ["name"]
73106
},
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"]
107+
"minItems": 1,
108+
"uniqueItems": true
109+
}
89110
},
90-
"minItems": 1,
91-
"uniqueItems": true
92-
}
93-
},
94-
"required": ["terms"]
111+
"required": ["terms"]
112+
},
113+
"minItems": 1,
114+
"uniqueItems": true
115+
}
95116
},
96-
"minItems": 1,
97-
"uniqueItems": true
117+
"required": ["contexts"]
98118
}
99-
},
100-
"required": ["contexts"],
119+
],
101120
"type": "object"
102121
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# yaml-language-server: $schema=../../schemas/json/contextive-glossary.json
2+
imports:
3+
- https://contextive.tech/path/to/demo
4+
- './contextive-glossary.yml'
5+
contexts:
6+
- name: Demo
7+
domainVisionStatement: To illustrate the usage of the contextive glossary file.
8+
terms:
9+
- name: context
10+
definition: A boundary within which words have specific meanings.
11+
examples:
12+
- In the _Sales_ context, the language focuses on activities associated with selling products.
13+
- Are you sure you're thinking of the definition from the right context?
14+
- name: term
15+
definition: A protected word in a given context.
16+
examples:
17+
- _Order_ is a term that is meaningful in the _Sales_ context.
18+
- What term should we use to describe what happens when a customer buys something from us?
19+
aliases:
20+
- word
21+
- name: alias
22+
definition: >-
23+
An alternative word for the same concept.
24+
25+
It might be a legacy term, or an alternative term that is in common use while the ubiquitous language is still being adopted.
26+
examples:
27+
- _Product_ is an alias of _Item_ in the Sales context.
28+
- name: definition
29+
definition: A short summary defining the meaning of a term in a context.
30+
examples:
31+
- 'The definition of _Order_ in the _Sales_ context is: "The set of _Items_ that are being sold as part of this _Order_".'
32+
- Can you provide a definition of the term _Order_?
33+
- name: example
34+
definition: A sentence illustrating the correct usage of the term in the context.
35+
examples:
36+
- Can you give me an example of how to use the term _Order_ in this context?
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+
imports:
3+
- https://contextive.tech/path/to/demo
4+
- './contextive-glossary.yml'

0 commit comments

Comments
 (0)