-
Notifications
You must be signed in to change notification settings - Fork 56
Description
I am reviewing the the way the standard Makefile works regarding the import modules, and something puzzles me.
The type of import modules (e.g. slme, minimal, mirror, etc.) can be declared both at the level of the entire import_group and at the level of each individual module, as in:
import_group:
module_type: slme # <- default module type for all modules that do not have an explicit type
products:
- id: ro
- id: pato
- id: fbbt
module_type: minimalThis will produce, in the standard Makefile, the following rules:
# Default rule, using the group-level module type;
# that rule will be used to produce ro_import.owl and pato_import.owl.
$(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms_combined.txt
$(ROBOT) ... # ROBOT pipeline to produce a SLME module
# Specific rule for the FBbt import module
$(IMPORTDIR)/fbbt_import.owl: $(MIRRORDIR)/fbbt.owl $(IMPORTDIR)/fbbt_terms_combined.txt
$(ROBOT) ... # ROBOT pipeline to produce a minimal moduleSo far, so good.
But now let’s use base merging:
import_group:
use_base_merging: True
module_type: slme
products:
- id: ro
- id: pato
- id: fbbt
module_type: minimalThis generates three rules:
# The rule that creates the (SLME) merged import module
$(IMPORTDIR)/merged_import.owl: $(MIRROR)/merged.owl $(IMPORTDIR)/merged_terms_combined.txt
$(ROBOT) ... # ROBOT pipeline to produce a SLME module
# A generic rule to produce a SLME module
$(IMPORTDIR)/%_import.owl: $(MIRRORDIR)/%.owl $(IMPORTDIR)/%_terms_combined.txt
$(ROBOT) ... # ROBOT pipeline to produce a SLME module
# A specific rule for the FBbt minimal import module
$(IMPORTDIR)/fbbt_import.owl: $(MIRRORDIR)/fbbt.owl $(IMPORTDIR)/fbbt_terms_combined.txt
$(ROBOT) ... # ROBOT pipeline to produce a minimal moduleQuestion is: what is even the point of the last two rules? They are not used anywhere. Under use_base_merging=True the only import module that matters is the merged_import.owl. In the example above, imported FBbt terms would end up in the merged import module, extracted using the SLME method, regardless of the module_type: minimal parameter declared in the ODK configuration file.
In fact, as soon as use_base_merging is used, I don’t think it even makes sense to have a per-module module type. How would that even work?
And if mixing the use of use_base_merging with per-module module types is not supposed to be supported, then I think we should document that, and maybe even add a check in odk.py to detect this kind of thing and warn the users that they are using a configuration that makes no sense.