Skip to content

Commit adbfc61

Browse files
committed
Add permutations feature to DOSDP patterns schema
1 parent c933378 commit adbfc61

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

src/schema/dosdp_schema.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ definitions:
9393
leaving this field out.
9494
items: {type: string}
9595
type: array
96+
permutations:
97+
description: >
98+
Optional list of permutation specifications. For each variable specified,
99+
generates additional annotations using the values of the specified annotation
100+
properties from the filler term. The label-based annotation is always generated
101+
in addition to the permutations. If multiple permutation entries exist for
102+
different variables, the cartesian product of all values is generated.
103+
type: array
104+
items: { $ref: '#/definitions/permutation' }
96105
multi_clause:
97106
items: { $ref: '#/definitions/multi_clause_printf' }
98107

@@ -219,6 +228,24 @@ definitions:
219228
type: string
220229
description: perl style regex sub. May include backreferences.
221230

231+
permutation:
232+
type: object
233+
additionalProperties: False
234+
required: [var, annotationProperties]
235+
properties:
236+
var:
237+
description: >
238+
The name of a single variable for which to generate permutations.
239+
Must correspond to a variable specified in the 'vars' field of the pattern.
240+
type: string
241+
annotationProperties:
242+
description: >
243+
A list of annotation property names (as declared in the annotationProperties
244+
dictionary) whose values from the filler term will be used to generate
245+
additional annotations. Each value found generates a separate annotation.
246+
type: array
247+
items: { type: string }
248+
222249
opa:
223250
type: object
224251
additionalProperties: False
@@ -272,6 +299,15 @@ definitions:
272299
used in the substitution.
273300
items: {type: string}
274301
type: array
302+
permutations:
303+
description: >
304+
Optional list of permutation specifications. For each variable specified,
305+
generates additional annotations using the values of the specified annotation
306+
properties from the filler term. The label-based annotation is always generated
307+
in addition to the permutations. If multiple permutation entries exist for
308+
different variables, the cartesian product of all values is generated.
309+
type: array
310+
items: { $ref: '#/definitions/permutation' }
275311
multi_clause:
276312
items: { $ref: '#/definitions/multi_clause_printf' }
277313

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
pattern_name: acute_with_permutations
2+
3+
pattern_iri: http://purl.obolibrary.org/obo/mondo/patterns/acute_with_permutations.yaml
4+
5+
description: 'Test pattern demonstrating the permutations feature for synonym generation.
6+
This pattern generates additional synonyms by permuting over the exact_synonym
7+
values of the disease filler term.'
8+
9+
contributors:
10+
- https://orcid.org/0000-0002-6601-2165
11+
12+
classes:
13+
acute: PATO:0000389
14+
disease: MONDO:0000001
15+
16+
relations:
17+
has modifier: RO:0002573
18+
19+
annotationProperties:
20+
exact_synonym: oio:hasExactSynonym
21+
related_synonym: oio:hasRelatedSynonym
22+
23+
vars:
24+
disease: '''disease'''
25+
26+
name:
27+
text: acute %s
28+
vars:
29+
- disease
30+
31+
annotations:
32+
- annotationProperty: exact_synonym
33+
text: '%s, acute'
34+
permutations:
35+
- var: disease
36+
annotationProperties:
37+
- exact_synonym
38+
vars:
39+
- disease
40+
41+
def:
42+
text: Acute form of %s.
43+
vars:
44+
- disease
45+
46+
equivalentTo:
47+
text: '%s and ''has modifier'' some ''acute'''
48+
vars:
49+
- disease

0 commit comments

Comments
 (0)