Skip to content

Commit eabe44e

Browse files
committed
Use odk:normalize --add-source instead of annotate --interpolate.
To inject a `dc:source` annotation into import modules, use the `--add-source` option of the `odk:normalize` command (in the ODK plugin), rather than the built-in interpolation feature of the `annotate` command. The problem with `annotate --interpolate --link-annotation dc:source "%{version_iri}" is that it does _not_ check whether the ontology has a version IRI at all, and will inject a _literal_ "%{version_iri}" string in the absence of a version IRI. closes #1266
1 parent 1ec874c commit eabe44e

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

template/src/ontology/Makefile.jinja2

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@ $(IMPORTDIR)/merged_import.owl: $(MIRRORDIR)/merged.owl $(ALL_TERMS) \
581581
{% if 'slme' == project.import_group.module_type -%}
582582
$(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms.txt \
583583
$(IMPORTSEED) | all_robot_plugins
584-
$(ROBOT) annotate --input $< --remove-annotations --interpolate true \
585-
--link-annotation dc:source "%{version_iri}" \
584+
$(ROBOT) annotate --input $< --remove-annotations \
585+
odk:normalize --add-source true \
586586
extract --term-file $(IMPORTDIR)/$*_terms.txt $(T_IMPORTSEED) \
587587
--force true --copy-ontology-annotations true \
588588
--individuals {{ project.import_group.slme_individuals }} \
@@ -598,8 +598,8 @@ $(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms.txt \
598598
{% elif 'minimal' == project.import_group.module_type -%}
599599
$(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms.txt \
600600
$(IMPORTSEED) | all_robot_plugins
601-
$(ROBOT) annotate --input $< --remove-annotations --interpolate true \
602-
--link-annotation dc:source "%{version_iri}" \
601+
$(ROBOT) annotate --input $< --remove-annotations \
602+
odk:normalize --add-source true \
603603
extract --term-file $(IMPORTDIR)/$*_terms.txt $(T_IMPORTSEED) \
604604
--force true --copy-ontology-annotations true \
605605
--method BOT \
@@ -617,19 +617,19 @@ $(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms.txt \
617617

618618
{% elif 'mirror' == project.import_group.module_type -%}
619619
$(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl | all_robot_plugins
620-
$(ROBOT) annotate --input $< --remove-annotations --interpolate true \
621-
--link-annotation dc:source "%{version_iri}" \
620+
$(ROBOT) annotate --input $< --remove-annotations \
622621
odk:normalize --base-iri {{ project.uribase }} \
623622
--subset-decls true --synonym-decls true \
623+
--add-source true \
624624
repair --merge-axiom-annotations true \
625625
$(ANNOTATE_CONVERT_FILE)
626626

627627
{% elif 'filter' == project.import_group.module_type -%}
628628
$(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms.txt \
629629
$(IMPORTSEED) | all_robot_plugins
630630
$(ROBOT) merge --input $< \
631-
annotate --remove-annotations --interpolate true \
632-
--link-annotation dc:source "%{version_iri}" \
631+
annotate --remove-annotations \
632+
odk:normalize --add-source true \
633633
remove --base-iri $(OBOBASE)"/$(shell echo $* | tr a-z A-Z)_" \
634634
--axioms external \
635635
--preserve-structure false --trim false \
@@ -665,8 +665,8 @@ ifeq ($(IMP_LARGE),true)
665665
{% endif -%}
666666
{% if 'slme' == ont.module_type -%}
667667
$(IMPORTDIR)/{{ ont.id }}_import.owl: $(MIRRORDIR)/{{ ont.id }}.owl $(IMPORTDIR)/{{ ont.id }}_terms.txt $(IMPORTSEED) | all_robot_plugins
668-
$(ROBOT) annotate --input $< --remove-annotations --interpolate true \
669-
--link-annotation dc:source "%{version_iri}" \
668+
$(ROBOT) annotate --input $< --remove-annotations \
669+
odk:normalize --add-source true \
670670
extract --term-file $(IMPORTDIR)/{{ ont.id }}_terms.txt $(T_IMPORTSEED) \
671671
--copy-ontology-annotations true --force true \
672672
--individuals {{ ont.slme_individuals }} \
@@ -681,8 +681,8 @@ $(IMPORTDIR)/{{ ont.id }}_import.owl: $(MIRRORDIR)/{{ ont.id }}.owl $(IMPORTDIR)
681681
$(ANNOTATE_CONVERT_FILE)
682682
{% elif 'filter' == ont.module_type -%}
683683
$(IMPORTDIR)/{{ ont.id }}_import.owl: $(MIRRORDIR)/{{ ont.id }}.owl $(IMPORTDIR)/{{ ont.id }}_terms.txt $(IMPORTSEED) | all_robot_plugins
684-
$(ROBOT) annotate --input $< --remove-annotations --interpolate true \
685-
--link-annotation dc:source "%{version_iri}" \
684+
$(ROBOT) annotate --input $< --remove-annotations \
685+
odk:normalize --add-source true \
686686
extract --term-file $(IMPORTDIR)/{{ ont.id }}_terms.txt $(T_IMPORTSEED) \
687687
--copy-ontology-annotations true --force true --method BOT \
688688
remove --axioms external --preserve-structure false --trim false \{% for iri in ont.base_iris %}
@@ -697,16 +697,16 @@ $(IMPORTDIR)/{{ ont.id }}_import.owl: $(MIRRORDIR)/{{ ont.id }}.owl $(IMPORTDIR)
697697
$(ANNOTATE_CONVERT_FILE)
698698
{% elif 'mirror' == ont.module_type -%}
699699
$(IMPORTDIR)/{{ ont.id }}_import.owl: $(MIRRORDIR)/{{ ont.id }}.owl | all_robot_plugins
700-
$(ROBOT) annotate --input $< --remove-annotations --interpolate true \
701-
--link-annotation dc:source "%{version_iri}" \
700+
$(ROBOT) annotate --input $< --remove-annotations \
702701
odk:normalize --base-iri {{ project.uribase }} \
703702
--subset-decls true --synonym-decls true \
703+
--add-source true \
704704
repair --merge-axiom-annotations true \
705705
$(ANNOTATE_CONVERT_FILE)
706706
{% elif 'minimal' == ont.module_type -%}
707707
$(IMPORTDIR)/{{ ont.id }}_import.owl: $(MIRRORDIR)/{{ ont.id }}.owl $(IMPORTDIR)/{{ ont.id }}_terms.txt $(IMPORTSEED) | all_robot_plugins
708-
$(ROBOT) annotate --input $< --remove-annotations --interpolate true \
709-
--link-annotation dc:source "%{version_iri}" \
708+
$(ROBOT) annotate --input $< --remove-annotations \
709+
odk:normalize --add-source true \
710710
extract --term-file $(IMPORTDIR)/{{ ont.id }}_terms.txt $(T_IMPORTSEED) \
711711
--copy-ontology-annotations true --force true --method BOT \
712712
remove --axioms external --preserve-structure false --trim false \{% for iri in ont.base_iris %}

0 commit comments

Comments
 (0)