diff --git a/odk/odk.py b/odk/odk.py index 261f48f9..3aeb5fbf 100755 --- a/odk/odk.py +++ b/odk/odk.py @@ -318,6 +318,12 @@ class ImportGroup(ProductGroup): directory : Directory = "imports/" """directory where imports are extracted into to""" + + annotate_defined_by : bool = False + """If set to true, the annotation rdfs:definedBy is added for each external class. + In the case of use_base_merging is also true, this will be added to the imports/merged_import.owl file. + When imports are not merged, the annotation is added during the release process to the full release artefact. + """ def _add_stub(self, id : OntologyHandle): if self.products is None: diff --git a/template/src/ontology/Makefile.jinja2 b/template/src/ontology/Makefile.jinja2 index d990caa8..6a47873e 100644 --- a/template/src/ontology/Makefile.jinja2 +++ b/template/src/ontology/Makefile.jinja2 @@ -634,7 +634,7 @@ ALL_MIRRORS = $(patsubst %, $(MIRRORDIR)/%.owl, $(IMPORTS)) MERGE_MIRRORS = true $(MIRRORDIR)/merged.owl: $(ALL_MIRRORS) - if [ $(IMP) = true ] && [ $(MERGE_MIRRORS) = true ]; then $(ROBOT) merge $(patsubst %, -i %, $^) {% if project.import_group.base_merge_drop_equivalent_class_axioms %}remove --axioms equivalent --preserve-structure false {% endif %}-o $@; fi + if [ $(IMP) = true ] && [ $(MERGE_MIRRORS) = true ]; then $(ROBOT) merge $(patsubst %, -i %, $^) {% if project.import_group.annotate_defined_by %}--annotate-defined-by true{% endif %} {% if project.import_group.base_merge_drop_equivalent_class_axioms %}remove --axioms equivalent --preserve-structure false {% endif %}-o $@; fi .PRECIOUS: $(MIRRORDIR)/merged.owl {% endif %} @@ -915,7 +915,7 @@ $(ONT).owl: $(ONT)-{{ project.primary_release }}.owl {% endif -%} # ROBOT pipeline that merges imports, including components. -ROBOT_RELEASE_IMPORT_MODE={% if project.use_edit_file_imports -%}$(ROBOT) merge --input $< {% else -%} +ROBOT_RELEASE_IMPORT_MODE={% if project.use_edit_file_imports -%}$(ROBOT) merge --input $< {% if project.import_group is defined and project.import_group.use_base_merging is false and project.import_group.annotate_defined_by %}--annotate-defined-by true{% endif -%}{% else -%} $(ROBOT) remove --input $< --select imports --trim false {% if project.use_dosdps or project.components is defined -%} merge $(patsubst %, -i %, $(OTHER_SRC)) {% endif %}{% if project.import_group is defined -%} merge $(patsubst %, -i %, $(IMPORT_FILES)){% endif %}{% endif %}