-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy path_dynamic_files.jinja2
1871 lines (1496 loc) · 83.1 KB
/
_dynamic_files.jinja2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{#-
Jinja2 Template for multile dynamic files
See odk.py for how this is processed.
This is first expanded into a single text file;
Each entry starting with ^^^ denotes a single file
-#}
{#-
Ontology source file, e.g. src/ontology/foo-edit.owl
We seed this with basic info such as ontology IRI and
a fake root class (this can be customized).
Note that when running odk.py, you can pass in a --source
argument to substitute this with your own edit file
#}
^^^ src/ontology/{{ project.id }}-edit.{{ project.edit_format }}
{% if project.edit_format == "obo" %}
format-version: 1.2
{% if project.import_group is defined -%}
{% if project.import_group.use_base_merging %}
import: {{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/imports/merged_import.owl
{% else %}
{% for imp in project.import_group.products %}
import: {{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/imports/{{ imp.id }}_import.owl
{% endfor %}
{% endif %}
{% endif %}
{%- if project.use_dosdps %}
import: {{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/patterns/definitions.owl
{%- if project.import_pattern_ontology %}
import: {{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/patterns/pattern.owl
{% endif -%}
{% endif %}
ontology: {{project.id}}
property_value: http://purl.org/dc/terms/description "{{ project.description }}" xsd:string
property_value: http://purl.org/dc/terms/title "{{ project.title }}" xsd:string
property_value: http://purl.org/dc/terms/license {{ project.license }}
[Term]
id: {{ project.id | upper }}:0000000
name: root node
[Typedef]
id: http://purl.org/dc/terms/description
name: description
is_metadata_tag: true
[Typedef]
id: http://purl.org/dc/terms/title
name: title
is_metadata_tag: true
[Typedef]
id: http://purl.org/dc/terms/license
name: license
is_metadata_tag: true
{% else %}
Prefix(:=<{{ project.uribase }}/{{ project.id }}.owl#>)
Prefix(dce:=<http://purl.org/dc/elements/1.1/>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Prefix(dcterms:=<http://purl.org/dc/terms/>)
Ontology(<{{ project.uribase }}/{{ project.id }}.owl>
{% if project.import_group is defined -%}
{% if project.import_group.use_base_merging %}
Import(<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/imports/merged_import.owl>)
{% else %}
{% for imp in project.import_group.products %}
Import(<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/imports/{{ imp.id }}_import.owl>)
{% endfor %}
{% endif %}
{% endif %}
{%- if project.use_dosdps %}
Import(<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/patterns/definitions.owl>)
{%- if project.import_pattern_ontology %}
Import(<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/patterns/pattern.owl>)
{% endif -%}
{% endif %}
Annotation(dcterms:description "{{ project.description }}")
Annotation(dcterms:license <{{ project.license }}>)
Annotation(dcterms:title "{{ project.title }}")
Declaration(Class(<{{ project.uribase }}/{{ project.id | upper }}_0000000>))
Declaration(AnnotationProperty(dcterms:description))
Declaration(AnnotationProperty(dcterms:license))
Declaration(AnnotationProperty(dcterms:title))
############################
# Annotation Properties
############################
AnnotationAssertion(rdfs:label dcterms:description "description")
AnnotationAssertion(rdfs:label dcterms:license "license")
AnnotationAssertion(rdfs:label dcterms:title "title")
############################
# Classes
############################
# Class: <{{ project.uribase }}/{{ project.id | upper }}_0000000> (root node)
AnnotationAssertion(rdfs:label <{{ project.uribase }}/{{ project.id | upper }}_0000000> "root node"@en)
)
{% endif %}
{#-
ID ranges file
#}
^^^ src/ontology/{{ project.id }}-idranges.owl
## ID Ranges File
Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Prefix: idsfor: <http://purl.obolibrary.org/obo/IAO_0000598>
Prefix: dce: <http://purl.org/dc/elements/1.1/>
Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>
Prefix: allocatedto: <http://purl.obolibrary.org/obo/IAO_0000597>
Prefix: xml: <http://www.w3.org/XML/1998/namespace>
Prefix: idprefix: <http://purl.obolibrary.org/obo/IAO_0000599>
Prefix: iddigits: <http://purl.obolibrary.org/obo/IAO_0000596>
Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Prefix: idrange: <http://purl.obolibrary.org/obo/ro/idrange/>
Prefix: owl: <http://www.w3.org/2002/07/owl#>
Ontology: <{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/{{ project.id }}-idranges.owl>
Annotations:
idsfor: "{{ project.id | upper }}",
idprefix: "{{ project.uribase }}/{{ project.id | upper }}_",
iddigits: 7
AnnotationProperty: idprefix:
AnnotationProperty: iddigits:
AnnotationProperty: idsfor:
AnnotationProperty: allocatedto:
Datatype: idrange:1
Annotations:
allocatedto: "ONTOLOGY-CREATOR"
EquivalentTo:
xsd:integer[>= 0 , <= 999999]
Datatype: idrange:2
Annotations:
allocatedto: "ADDITIONAL EDITOR"
EquivalentTo:
xsd:integer[>= 1000000 , <= 1999999]
Datatype: xsd:integer
Datatype: rdf:PlainLiteral
^^^ src/ontology/{{ project.id }}.Makefile
## Customize Makefile settings for {{project.id}}
##
## If you need to customize your Makefile, make
## changes here rather than in the main Makefile
{% if project.import_group is defined -%}
{%- if 'custom' == project.import_group.module_type %}
imports/%_import.owl: mirror/%.owl
echo "ERROR: You have configured your default module type to be custom; this behavior needs to be overwritten in {{ project.id }}.Makefile!" && touch $@
{% endif %}
{%- endif %}
{% if project.import_group.use_base_merging %}
{#-
Single merged import file
#}
^^^ src/ontology/imports/merged_import.owl
Prefix(:=<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/imports/merged_import.owl>)
Prefix(obo:=<http://purl.obolibrary.org/obo/>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Prefix(oboInOwl:=<http://www.geneontology.org/formats/oboInOwl#>)
Ontology(<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/imports/merged_import.owl>
# This is a placeholder, it will be regenerated when makefile is first executed.
)
{% else %}
{#-
Imports files, one per import
#}
{% for imp in project.import_group.products %}
^^^ src/ontology/imports/{{ imp.id }}_import.owl
Prefix(:=<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/imports/{{ imp.id }}_import.owl>)
Prefix(obo:=<http://purl.obolibrary.org/obo/>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Prefix(oboInOwl:=<http://www.geneontology.org/formats/oboInOwl#>)
Ontology(<{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/imports/{{ imp.id }}_import.owl>
# This is a placeholder, it will be regenerated when makefile is first executed.
)
{% endfor %}
{% endif %}
{#-
Import Term files
We seed each of these with some random terms. This is a little unsatisfactory and fragile;
ROBOT extract will fail if it cannot find any of the terms. While this doesn't matter in the long term,
as the ontology maintainer will provide their own lists, but it is problematic for the initial seed.
TODO: Decide if we should either query ontobee for seed terms OR have the seed list provided in the project.yaml
#}
{% for imp in project.import_group.products %}
^^^ src/ontology/imports/{{ imp.id }}_terms.txt
{% endfor %}
{#-
Metadata files.
These are convenient for submission to OBO. Note that OBO maintains two files, a .md and a .yml
TODO: include a script that makes it easy for maintainers to do this.
#}
{%- if project.create_obo_metadata %}
^^^ src/metadata/README.md
Metadata files for the OBO Library
* [{{ project.id }}.yml]({{ project.id }}.yml)
* Determines how your purl.obolibrary.org/obo/{{ project.id }}/ redirects will be handled
* Go here: https://github.com/OBOFoundry/purl.obolibrary.org/tree/master/config
* Click [New File](https://github.com/OBOFoundry/purl.obolibrary.org/new/master/config)
* Paste in the contents of [{{ project.id }}.yml]({{ project.id }}.yml)
* Click "Commit new file"
* IMPORTANT: remember to make a pull request
* An OBO admin will merge your Pull Request *providing it meets the requirements of the OBO library*
* [{{ project.id }}.md]({{ project.id }}.md)
* Determines how your metadata is shown on OBO Library, OLS and AberOWL
* Go here: https://github.com/OBOFoundry/OBOFoundry.github.io/tree/master/ontology
* Click [New File](https://github.com/OBOFoundry/OBOFoundry.github.io/new/master/ontology)
* Paste in the contents of [{{ project.id }}.md]({{ project.id }}.md)
* Click "Commit new file"
* IMPORTANT: remember to make a pull request
* An OBO admin will merge your Pull Request *providing it meets the requirements of the OBO library*
For more background see:
* http://obofoundry.org/
* http://obofoundry.org/faq/how-do-i-edit-metadata.html
^^^ src/metadata/{{ project.id }}.md
---
layout: ontology_detail
id: {{ project.id }}
title: {{ project.title }}
jobs:
- id: https://travis-ci.org/{{ project.github_org }}/{{ project.repo }}
type: travis-ci
build:
checkout: git clone https://github.com/{{ project.github_org }}/{{ project.repo }}.git
system: git
path: "."
contact:
email: {{ project.contact.email }}
label: {{ project.contact.name }}
github: {{ project.contact.github }}
description: {{ project.title }} is an ontology...
domain: stuff
homepage: https://github.com/{{ project.github_org }}/{{ project.repo }}
products:
- id: {{ project.id }}.owl
name: "{{ project.title }} main release in OWL format"
- id: {{ project.id }}.obo
name: "{{ project.title }} additional release in OBO format"
- id: {{ project.id }}.json
name: "{{ project.title }} additional release in OBOJSon format"
- id: {{ project.id }}/{{ project.id }}-base.owl
name: "{{ project.title }} main release in OWL format"
- id: {{ project.id }}/{{ project.id }}-base.obo
name: "{{ project.title }} additional release in OBO format"
- id: {{ project.id }}/{{ project.id }}-base.json
name: "{{ project.title }} additional release in OBOJSon format"
dependencies:
{% for imp in project.import_group.products -%}
- id: {{ imp.id }}
{% endfor %}
tracker: https://github.com/{{ project.github_org }}/{{ project.repo }}/issues
license:
url: http://creativecommons.org/licenses/by/3.0/
label: CC-BY
activity_status: active
---
Enter a detailed description of your ontology here. You can use arbitrary markdown and HTML.
You can also embed images too.
^^^ src/metadata/{{ project.id }}.yml
# PURL configuration for http://purl.obolibrary.org/obo/{{ project.id }}
idspace: {{ project.id|upper }}
base_url: /obo/{{ project.id }}
products:
- {{ project.id }}.owl: https://raw.githubusercontent.com/{{ project.github_org }}/{{ project.repo }}/{{ project.git_main_branch }}/{{ project.id }}.owl
- {{ project.id }}.obo: https://raw.githubusercontent.com/{{ project.github_org }}/{{ project.repo }}/{{ project.git_main_branch }}/{{ project.id }}.obo
term_browser: ontobee
example_terms:
- {{ project.id.upper() }}_0000000
entries:
- prefix: /releases/
replacement: https://raw.githubusercontent.com/{{ project.github_org }}/{{ project.repo }}/v
- prefix: /tracker/
replacement: https://github.com/{{ project.github_org }}/{{ project.repo }}/issues
- prefix: /about/
replacement: http://www.ontobee.org/ontology/{{ project.id|upper }}?iri=http://purl.obolibrary.org/obo/
## generic fall-through, serve direct from github by default
- prefix: /
replacement: https://raw.githubusercontent.com/{{ project.github_org }}/{{ project.repo }}/{{ project.git_main_branch }}/
{%- endif %}
{% if project.use_templates %}
^^^ src/templates/README.md
# ROBOT templates
{%- if project.components is not none %}
{%- for component in project.components.products %}
{%- if component.use_template %}
{%- if component.templates is not none %}{% for template in component.templates %}
^^^ src/templates/{{ template }}
ID LABEL
ID LABEL
{%- endfor %}{% else %}
^^^ src/templates/{{ component.filename.split('.') | first }}.tsv
ID LABEL
ID LABEL
{%- endif %}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endif %}
{%- if project.use_mappings %}
^^^ src/mappings/README.md
# Directory for managing SSSOM mappings files
{%- if project.sssom_mappingset_group is not none %}
{%- for mapping in project.sssom_mappingset_group.products %}
^^^ src/mappings/{{ mapping.id }}.sssom.tsv
# curie_map:
# semapv: https://w3id.org/semapv/
# skos: http://www.w3.org/2004/02/skos/core#
# sssom: https://w3id.org/sssom/
# {{ project.id | upper }}: {{ project.uribase }}/{{ project.id | upper }}_
# license: https://creativecommons.org/publicdomain/zero/1.0/
# mapping_set_id: http://purl.obolibrary.org/obo/{{ project.id }}/mappings/{{ mapping.id }}.sssom.tsv
subject_id predicate_id object_id mapping_justification
{{ project.id | upper }}:0000000 skos:exactMatch sssom:NoTermFound semapv:ManualMappingCuration
{%- endfor %}
{%- endif %}
{%- endif %}
{%- if project.use_translations %}
^^^ src/translations/README.md
# Directory for managing translation files
{%- if project.babelon_translation_group is not none %}
{%- for translation in project.babelon_translation_group.products %}
^^^ src/translations/{{ translation.id }}.babelon.tsv
source_language translation_language subject_id predicate_id source_value translation_value translation_status
{%- if translation.include_robot_template_synonyms %}
^^^ src/translations/{{ translation.id }}.synonyms.tsv
subject_id translation_value comment
ID AL oboInOwl:hasExactSynonym@{{ translation.language }}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- endif %}
{#-
Example pattern implementation TSV
#}
{%- if project.use_dosdps %}
^^^ src/patterns/definitions.owl
Prefix(:=<http://purl.obolibary.org/obo/{{ project.id }}/definitions.owl#>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Ontology(<http://purl.obolibary.org/obo/{{ project.id }}/definitions.owl>
)
^^^ src/patterns/pattern.owl
Prefix(:=<http://purl.obolibary.org/obo/{{ project.id }}/pattern.owl#>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)
Ontology(<http://purl.obolibary.org/obo/{{ project.id }}/pattern.owl>
)
^^^ src/patterns/README.md
# DOSDP patterns - editors docs
^^^ src/patterns/data/default/example.tsv
defined_class example
^^^ src/patterns/dosdp-patterns/example.yaml
pattern_name: example
pattern_iri: {{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/example.yaml
description: "This is a minimal example pattern."
classes:
example: owl:Thing
relations:
part_of: BFO:0000050
vars:
example: "'example'"
name:
text: "Part of %s"
vars:
- example
equivalentTo:
text: "'part_of' some %s"
vars:
- example
^^^ src/patterns/dosdp-patterns/external.txt
^^^ src/patterns/data/default/README.md
Documentation of the Default DOSDP Pipeline
{%- if project.pattern_pipelines_group is defined %}
{%- for pipeline in project.pattern_pipelines_group.products %}
^^^ src/patterns/data/{{ pipeline.id }}/README.md
# Documentation of the {{ pipeline.id }} DOSDP Pipeline
{%- endfor %}
{%- endif %}
{%- endif %}
{%- if project.use_context %}
^^^ src/ontology/config/context.json
{
"@context": {
"obo": "http://purl.obolibrary.org/obo/",
"oboInOwl": "http://www.geneontology.org/formats/oboInOwl#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"rdfa": "http://www.w3.org/ns/rdfa#",
"xml": "http://www.w3.org/XML/1998/namespace",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"owl": "http://www.w3.org/2002/07/owl#",
"dc": "http://purl.org/dc/terms/",
"foaf": "http://xmlns.com/foaf/0.1/",
"prov": "http://www.w3.org/ns/prov#",
"skos": "http://www.w3.org/2004/02/skos/core#",
"void": "http://rdfs.org/ns/void#"
}
}
{%- endif %}
{#-
SPARQL QUERY to collect all terms that belong to an ontology
#}
^^^ src/sparql/{{ project.id }}_terms.sparql
SELECT DISTINCT ?term
WHERE {
{ ?s1 ?p1 ?term . }
UNION
{ ?term ?p2 ?o2 . }
FILTER(isIRI(?term) && ({% if project.namespaces %}{% for ns in project.namespaces %}STRSTARTS(str(?term), "{{ ns }}"){% if not loop.last %} || {% endif %}{% endfor %}{% else %}STRSTARTS(str(?term), "{{ project.uribase }}/{{ project.id.upper() }}_"){% endif %}))
}
{#-
SPARQL QUERY QC checks
#}
{%- if project.robot_report.custom_sparql_checks is not defined or 'owldef-self-reference' in project.robot_report.custom_sparql_checks %}
^^^ src/sparql/owldef-self-reference-violation.sparql
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX oio: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?term WHERE {
{ ?term owl:equivalentClass [ owl:intersectionOf [ rdf:rest*/rdf:first ?term ] ] }
UNION
{ ?term owl:equivalentClass [ owl:intersectionOf [ rdf:rest*/rdf:first [ owl:someValuesFrom ?term ] ] ] }
FILTER(isIRI(?term) && ({% if project.namespaces %}{% for ns in project.namespaces %}STRSTARTS(str(?term), "{{ ns }}"){% if not loop.last %} || {% endif %}{% endfor %}{% else %}STRSTARTS(str(?term), "{{ project.uribase }}/{{ project.id.upper() }}_"){% endif %}))
}
{% endif %}
{%- if project.robot_report.custom_sparql_checks is not defined or 'redundant-subClassOf' in project.robot_report.custom_sparql_checks %}
^^^ src/sparql/redundant-subClassOf-violation.sparql
PREFIX oio: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?term ?xl ?y ?yl ?z ?zl WHERE {
?term rdfs:subClassOf ?y ;
rdfs:label ?xl .
?y rdfs:subClassOf+ ?z ;
rdfs:label ?yl .
?term rdfs:subClassOf ?z .
?z rdfs:label ?zl .
FILTER(isIRI(?term) && ({% if project.namespaces %}{% for ns in project.namespaces %}STRSTARTS(str(?term), "{{ ns }}"){% if not loop.last %} || {% endif %}{% endfor %}{% else %}STRSTARTS(str(?term), "{{ project.uribase }}/{{ project.id.upper() }}_"){% endif %}))
}
{% endif %}
{%- if project.robot_report.custom_sparql_checks is not defined or 'taxon-range' in project.robot_report.custom_sparql_checks %}
^^^ src/sparql/taxon-range-violation.sparql
PREFIX never_in_taxon: <http://purl.obolibrary.org/obo/RO_0002161>
PREFIX present_in_taxon: <http://purl.obolibrary.org/obo/RO_0002175>
SELECT ?term ?property ?taxon
WHERE {
VALUES ?property { never_in_taxon: present_in_taxon: }
?term ?property ?taxon .
FILTER (!isIRI(?taxon) || !STRSTARTS(STR(?taxon), "http://purl.obolibrary.org/obo/NCBITaxon_"))
FILTER(isIRI(?term) && ({% if project.namespaces %}{% for ns in project.namespaces %}STRSTARTS(str(?term), "{{ ns }}"){% if not loop.last %} || {% endif %}{% endfor %}{% else %}STRSTARTS(str(?term), "{{ project.uribase }}/{{ project.id.upper() }}_"){% endif %}))
}
{% endif %}
{%- if project.robot_report.custom_sparql_checks is not defined or 'iri-range' in project.robot_report.custom_sparql_checks %}
^^^ src/sparql/iri-range-violation.sparql
PREFIX never_in_taxon: <http://purl.obolibrary.org/obo/RO_0002161>
PREFIX present_in_taxon: <http://purl.obolibrary.org/obo/RO_0002175>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?term ?property ?value
WHERE {
VALUES ?property {
never_in_taxon:
present_in_taxon:
foaf:depicted_by
oboInOwl:inSubset
dcterms:contributor }
?term ?property ?value .
FILTER(isIRI(?term) && ({% if project.namespaces %}{% for ns in project.namespaces %}STRSTARTS(str(?term), "{{ ns }}"){% if not loop.last %} || {% endif %}{% endfor %}{% else %}STRSTARTS(str(?term), "{{ project.uribase }}/{{ project.id.upper() }}_"){% endif %}))
FILTER (!isIRI(?value))
}
{% endif %}
{%- if project.robot_report.custom_sparql_checks is not defined or 'iri-range-advanced' in project.robot_report.custom_sparql_checks %}
^^^ src/sparql/iri-range-advanced-violation.sparql
PREFIX never_in_taxon: <http://purl.obolibrary.org/obo/RO_0002161>
PREFIX present_in_taxon: <http://purl.obolibrary.org/obo/RO_0002175>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?term ?property ?value
WHERE {
VALUES ?property {
never_in_taxon:
present_in_taxon:
rdfs:seeAlso
foaf:depicted_by
oboInOwl:inSubset
dcterms:contributor }
?term ?property ?value .
FILTER(isIRI(?term) && ({% if project.namespaces %}{% for ns in project.namespaces %}STRSTARTS(str(?term), "{{ ns }}"){% if not loop.last %} || {% endif %}{% endfor %}{% else %}STRSTARTS(str(?term), "{{ project.uribase }}/{{ project.id.upper() }}_"){% endif %}))
FILTER (!isIRI(?value))
}
{% endif %}
{%- if project.robot_report.custom_sparql_checks is not defined or 'label-with-iri' in project.robot_report.custom_sparql_checks %}
^^^ src/sparql/label-with-iri-violation.sparql
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?term ?value
WHERE {
?term rdfs:label ?value .
FILTER (REGEX(?value, "http[s]?[:]"))
FILTER(isIRI(?term) && ({% if project.namespaces %}{% for ns in project.namespaces %}STRSTARTS(str(?term), "{{ ns }}"){% if not loop.last %} || {% endif %}{% endfor %}{% else %}STRSTARTS(str(?term), "{{ project.uribase }}/{{ project.id.upper() }}_"){% endif %}))
}
{% endif %}
{%- if project.robot_report.custom_sparql_checks is not defined or 'multiple-replaced_by' in project.robot_report.custom_sparql_checks %}
^^^ src/sparql/multiple-replaced_by-violation.sparql
PREFIX replaced_by: <http://purl.obolibrary.org/obo/IAO_0100001>
SELECT DISTINCT ?entity ?property ?value WHERE {
VALUES ?property {
replaced_by:
}
?entity ?property ?value1 .
?entity ?property ?value2 .
FILTER(?value1!=?value2)
BIND(CONCAT(str(?value1), CONCAT("|", str(?value2))) as ?value)
}
{% endif %}
{%- if project.robot_report.custom_sparql_checks is not defined or 'term-tracker-uri' in project.robot_report.custom_sparql_checks %}
^^^ src/sparql/term-tracker-uri-violation.sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX term_tracker_item: <http://purl.obolibrary.org/obo/IAO_0000233>
SELECT ?term ?term_tracker ?term_tracker_type WHERE {
?term term_tracker_item: ?term_tracker .
FILTER(DATATYPE(?term_tracker) != xsd:anyURI)
BIND(DATATYPE(?term_tracker) as ?term_tracker_type)
}
{% endif %}
{%- if project.robot_report.custom_sparql_checks is not defined or 'illegal-date' in project.robot_report.custom_sparql_checks %}
^^^ src/sparql/illegal-date-violation.sparql
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
SELECT DISTINCT ?term ?property ?value WHERE
{
VALUES ?property {dct:date dct:issued dct:created oboInOwl:creation_date}
?term ?property ?value .
FILTER (datatype(?value) != xsd:date || !regex(str(?value), '^\\d{4}-\\d\\d-\\d\\d$'))
FILTER (datatype(?value) != xsd:dateTime || !regex(str(?value), '^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z'))
}
{% endif %}
{%- if project.robot_report.custom_sparql_checks is not defined or 'dc-properties' in project.robot_report.custom_sparql_checks %}
^^^ src/sparql/dc-properties-violation.sparql
# The purpose of this violation is to make sure people update
# from using the deprecated DC Elements 1.1 namespace (http://purl.org/dc/elements/1.1/)
# to using the recommended DC Terms namespace (http://purl.org/dc/terms/)
# See also discussion on https://github.com/oborel/obo-relations/pull/692
SELECT ?term ?predicate WHERE {
?term ?predicate ?value .
FILTER(STRSTARTS(STR(?predicate), "http://purl.org/dc/elements/1.1/"))
FILTER(isIRI(?term) && ({% if project.namespaces %}{% for ns in project.namespaces %}STRSTARTS(str(?term), "{{ ns }}"){% if not loop.last %} || {% endif %}{% endfor %}{% else %}STRSTARTS(str(?term), "{{ project.uribase }}/{{ project.id.upper() }}_"){% endif %}))
}
{% endif %}
{%- if project.components is defined %}
{%- for component in project.components.products %}
^^^ src/ontology/components/{{ component.filename }}
<?xml version="1.0"?>
<rdf:RDF
xml:base="{{ project.uribase }}/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:oboInOwl="http://www.geneontology.org/formats/oboInOwl#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:obo="http://purl.obolibrary.org/obo/">
<owl:Ontology rdf:about="{{ project.uribase }}/{% if project.uribase_suffix is not none %}{{ project.uribase_suffix }}{% else %}{{ project.id }}{% endif %}/components/{{ component.filename }}"/>
<!-- This is a placeholder, it will be regenerated when makefile is first executed -->
</rdf:RDF>
{%- endfor %}
{%- endif %}
{%- if project.robot_report.custom_profile %}
^^^ src/ontology/profile.txt
WARN annotation_whitespace
ERROR deprecated_boolean_datatype
ERROR deprecated_class_reference
ERROR deprecated_property_reference
ERROR duplicate_definition
WARN duplicate_exact_synonym
WARN duplicate_label_synonym
ERROR duplicate_label
WARN duplicate_scoped_synonym
WARN equivalent_pair
WARN equivalent_class_axiom_no_genus
ERROR illegal_use_of_built_in_vocabulary
WARN invalid_xref
ERROR label_formatting
ERROR label_whitespace
INFO lowercase_definition
WARN missing_definition
ERROR missing_label
WARN missing_obsolete_label
ERROR missing_ontology_description
ERROR missing_ontology_license
ERROR missing_ontology_title
WARN missing_subset_declaration
INFO missing_superclass
WARN missing_synonymtype_declaration
ERROR misused_obsolete_label
ERROR misused_replaced_by
ERROR multiple_definitions
ERROR multiple_equivalent_classes
ERROR multiple_equivalent_class_definitions
ERROR multiple_labels
WARN invalid_entity_uri
{%- endif %}
{%- if 'basic' in project.release_artefacts or project.primary_release == 'basic' %}
^^^ src/ontology/keeprelations.txt
BFO:0000050
{% endif -%}
{% if project.ci is defined -%}{% if 'travis' in project.ci %}
^^^ .travis.yml
## REMEMBER TO SET UP YOUR GIT REPO FOR TRAVIS
## Go to: https://travis-ci.org/{{ project.github_org }} for details
sudo: required
services:
- docker
before_install:
- docker pull obolibrary/odkfull
# command to run tests
script: cd src/ontology && sh run.sh make test
#after_success:
# coveralls
# whitelist
branches:
only:
- {{ project.git_main_branch }}
- test-travis
### Add your own lists here
### See https://github.com/INCATools/ontology-development-kit/issues/35
notifications:
email:
{% endif -%}{% if (('github_actions' in project.ci) and ('qc' in project.workflows)) %}
^^^ .github/workflows/qc.yml
# Basic ODK workflow
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the {{ project.git_main_branch }} branch
push:
branches: [ {{ project.git_main_branch }} ]
pull_request:
branches: [ {{ project.git_main_branch }} ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "ontology_qc"
ontology_qc:
# The type of runner that the job will run on
runs-on: ubuntu-latest
container: obolibrary/odkfull:{% if env is defined -%}{{env['ODK_VERSION'] or "latest" }}{%- else %}latest{% endif %}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Run ontology QC checks
env:
DEFAULT_BRANCH: {{ project.git_main_branch }}
run: cd src/ontology && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false MIR=false
{% endif -%}{% if 'gitlab-ci' in project.ci %}
^^^ .gitlab-ci.yml
# Basic ODK workflow to run ontology QC checks
ontology_qc:
stage: test
image: obolibrary/odkfull:{% if env is defined -%}{{env['ODK_VERSION'] or "latest" }}{%- else %}latest{% endif %}
# Controls when the job will run.
rules:
# Run on merge request pipelines when a merge request is open for the branch.
# Run on branch pipelines for main when a merge request is not open for the branch.
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Script defines a sequence of tasks that will be executed as part of the job
script:
- cd src/ontology
- make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' test IMP=false PAT=false
{% endif -%}
{% endif -%}
{% if (('github_actions' in project.ci) and ('diff' in project.workflows)) %}
^^^ .github/workflows/diff.yml
name: 'Create ROBOT diffs on Pull requests'
on:
# Triggers the workflow on pull request events for the master branch
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
edit_file:
runs-on: ubuntu-latest
container: obolibrary/odklite:{% if env is defined -%}{{env['ODK_VERSION'] or "latest" }}{%- else %}latest{% endif %}
steps:
- uses: actions/checkout@v4
# Checks-out main branch under "main" directory
- uses: actions/checkout@v4
with:
ref: master
path: master
- name: Diff classification
run: export ROBOT_JAVA_ARGS=-Xmx6G; robot diff --labels True --left master/src/ontology/{{ project.id }}-edit.{{ project.edit_format }} --left-catalog master/src/ontology/catalog-v001.xml --right src/ontology/{{ project.id }}-edit.{{ project.edit_format }} --right-catalog src/ontology/catalog-v001.xml -f markdown -o edit-diff.md
- name: Upload diff
uses: actions/upload-artifact@v4
with:
name: edit-diff.md
path: edit-diff.md
classify_branch:
runs-on: ubuntu-latest
container: obolibrary/odklite:{% if env is defined -%}{{env['ODK_VERSION'] or "latest" }}{%- else %}latest{% endif %}
steps:
- uses: actions/checkout@v4
- name: Classify ontology
run: cd src/ontology; make IMP=FALSE PAT=FALSE MIR=FALSE {{ project.id }}.owl
- name: Upload PR {{ project.id }}.owl
uses: actions/upload-artifact@v4
with:
name: {{ project.id }}-pr.owl
path: src/ontology/{{ project.id }}.owl
retention-days: 1
classify_main:
runs-on: ubuntu-latest
container: obolibrary/odklite:{% if env is defined -%}{{env['ODK_VERSION'] or "latest" }}{%- else %}latest{% endif %}
steps:
- uses: actions/checkout@v4
with:
ref: master
- name: Classify ontology
run: cd src/ontology; make IMP=FALSE PAT=FALSE MIR=FALSE {{ project.id }}.owl
- name: Upload master {{ project.id }}.owl
uses: actions/upload-artifact@v4
with:
name: {{ project.id }}-master.owl
path: src/ontology/{{ project.id }}.owl
retention-days: 1
diff_classification:
needs:
- classify_branch
- classify_main
runs-on: ubuntu-latest
container: obolibrary/odklite:{% if env is defined -%}{{env['ODK_VERSION'] or "latest" }}{%- else %}latest{% endif %}
steps:
- uses: actions/checkout@v4
- name: Download master classification
uses: actions/download-artifact@v4
with:
name: {{ project.id }}-master.owl
path: src/ontology/{{ project.id }}-master.owl
- name: Download PR classification
uses: actions/download-artifact@v4
with:
name: {{ project.id }}-pr.owl
path: src/ontology/{{ project.id }}-pr.owl
- name: Diff classification
run: export ROBOT_JAVA_ARGS=-Xmx6G; cd src/ontology; robot diff --labels True --left {{ project.id }}-master.owl/{{ project.id }}.owl --left-catalog catalog-v001.xml --right {{ project.id }}-pr.owl/{{ project.id }}.owl --right-catalog catalog-v001.xml -f markdown -o classification-diff.md
- name: Upload diff
uses: actions/upload-artifact@v4
with:
name: classification-diff.md
path: src/ontology/classification-diff.md
post_comment:
needs: [diff_classification, edit_file]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download reasoned diff
uses: actions/download-artifact@v4
with:
name: classification-diff.md
path: classification-diff.md
- name: Prepare reasoned comment
run: "echo \"<details>\n <summary> Here's a diff of how these changes impact the classified ontology: </summary> \n\" >comment.md; cat classification-diff.md/classification-diff.md >>comment.md"
- name: Post reasoned comment
env:
GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
uses: NejcZdovc/[email protected]
with:
file: "../../comment.md"
identifier: "REASONED"
- uses: actions/checkout@v4
- name: Download edit diff
uses: actions/download-artifact@v4
with:
name: edit-diff.md
path: edit-diff.md
- name: Prepare edit file comment
run: "echo \"<details>\n <summary> Here's a diff of your edit file (unreasoned) </summary> \n\" >edit-comment.md; cat edit-diff.md/edit-diff.md >>edit-comment.md"
- name: Post comment
env:
GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
uses: NejcZdovc/[email protected]
with:
file: "../../edit-comment.md"
identifier: "UNREASONED"
{% endif -%}
{% if (('github_actions' in project.ci) and ('release-diff' in project.workflows)) %}
^^^ .github/workflows/release-diff.yml
name: Post release diff
on:
# Triggers the workflow on pull request events for the {{ project.git_main_branch }} branch
pull_request:
branches: [ {{ project.git_main_branch }} ]
paths:
- 'src/ontology/reports/release-diff.md'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
post_diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare release comment
env:
GITHUB_SHA: {% raw %}${{ github.sha }}{% endraw %}
run: "echo \"[Here's a diff of how this release impacts {{ project.id }}.owl](https://github.com/obophenotype/{{ project.repo }}/blob/${% raw %}${{ env.GITHUB_SHA }}{% endraw %}/src/ontology/reports/release-diff.md)\" >comment.md"
- name: Post reasoned comment
env:
GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
uses: NejcZdovc/[email protected]
with:
github_token: {% raw %}${{ env.GITHUB_TOKEN }}{% endraw %}
file: "../../comment.md"
identifier: "RELEASE-DIFF"
{% endif -%}
{% if project.use_custom_import_module %}
^^^ src/templates/external_import.tsv
ID Entity Type
ID TYPE
owl:Thing owl:Class
{% endif -%}
{% if project.documentation is not none %}
^^^ docs/index.md
# {{ project.id.upper() }} Ontology Documentation
[//]: # "This file is meant to be edited by the ontology maintainer."
Welcome to the {{ project.id.upper() }} documentation!
You can find descriptions of the standard ontology engineering workflows [here](odk-workflows/index.md).
^^^ docs/cite.md
# How to cite {{ project.id.upper() }}
^^^ docs/contributing.md
# How to contribute to {{ project.id.upper() }}
^^^ docs/odk-workflows/index.md
# Default ODK Workflows
- [Daily Editors Workflow](EditorsWorkflow.md)
- [Release Workflow](ReleaseWorkflow.md)
- [Manage your ODK Repository](RepoManagement.md)
- [Setting up Docker for ODK](SettingUpDockerForODK.md)
- [Imports management](UpdateImports.md)
- [Managing the documentation](ManageDocumentation.md)
- [Managing your Automated Testing](ManageAutomatedTest.md)
^^^ docs/odk-workflows/ContinuousIntegration.md
# Introduction to Continuous Integration Workflows with ODK