Skip to content

Commit f66b115

Browse files
committed
Remove the possibility of filtering on mapping objects.
Since it is very likely that the default SSSOM/T-OWL ruleset will have to be customized by users anyway, it's reasonable _not_ to provide a way to enable object filtering at the level of the ODK configuration. If a project needs object filtering, they can simply add the proper filter(s) directly into the SSSOM/T-OWL ruleset.
1 parent 25ce686 commit f66b115

3 files changed

Lines changed: 2 additions & 34 deletions

File tree

odk/odk.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,6 @@ class BridgeProduct(Product):
214214
ruleset: str = "default"
215215
"""The SSSOM/T-OWL ruleset to use to derive the bridge."""
216216

217-
objects: Optional[List[str]] = None
218-
"""If set, the input mapping set(s) will be filtered to only contain mappings with an object in one of the listed namespaces."""
219-
220217
@dataclass_json
221218
@dataclass
222219
class BabelonTranslationProduct(Product):
@@ -579,33 +576,12 @@ def _add_stub(self, id):
579576

580577
def _derive_fields(self, project):
581578
for product in [p for p in self.products if p.bridge_type == "sssom"]:
582-
product.extra_prefixes = []
583-
product.filter = None
584-
585579
if product.sources is None:
586580
# Default source is a mapping set with the same name as
587581
# the bridge itself
588582
# FIXME: we do not check that such a mapping set exists!
589583
product.sources = [product.id]
590584

591-
if product.objects is not None:
592-
# Object filtering implies the use of a specific ruleset
593-
# instead of the default ruleset, even if no custom
594-
# ruleset name has been provided
595-
if product.ruleset == "default":
596-
product.ruleset = product.id
597-
598-
# For every targeted object namespace, we inject a
599-
# prefix name Px and a filter "object==Px:*"
600-
filters = []
601-
for i, obj in enumerate(product.objects):
602-
product.extra_prefixes.append((f"P{i}", obj))
603-
filters.append(f"object==P{i}:*")
604-
if len(filters) > 1:
605-
product.filter = "(" + " || ".join(filters) + ")"
606-
else:
607-
product.filter = " || ".join(filters)
608-
609585
@dataclass_json
610586
@dataclass
611587
class BabelonTranslationSetGroup(JsonSchemaMixin):

template/_dynamic_files.jinja2

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -402,20 +402,13 @@ subject_id predicate_id object_id mapping_justification
402402
{% for bridge in project.bridge_group.products -%}
403403
^^^ src/scripts/bridge-{{ bridge.ruleset }}.sssomt
404404
prefix {{ project.id | upper }}: <{{ project.uribase }}/{{ project.id | upper }}_>
405-
{% for pfx in bridge.extra_prefixes -%}
406-
prefix {{ pfx[0] }}: <{{ pfx[1] }}>
407-
{% endfor %}
405+
408406
# Make sure {{ project.id | upper }} entities are on the subject side
409407
object=={{ project.id | upper }}:* -> invert();
410408

411409
# Ignore any mapping to something else than {{ project.id | upper }}
412410
!subject=={{ project.id | upper }}:* -> stop();
413411

414-
{% if bridge.filter is not none -%}
415-
# Ignore any mapping with an irrelevant object
416-
!{{ bridge.filter }} -> stop();
417-
418-
{% endif -%}
419412
predicate==skos:exactMatch -> create_axiom("%subject_id EquivalentTo: %object_id");
420413
predicate==skos:broadMatch -> create_axiom("%subject_id SubClassOf: %object_id");
421414
predicate==skos:narrowMatch -> create_axiom("%object_id SubClassOf: %subject_id");

tests/test-bridges.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ bridge_group:
2121
- modmini-onta
2222
- modmini-ontb
2323
- id: modmini-ontc
24-
objects:
25-
- https://w3id.org/sssom/
24+
ruleset: modmini-ontc

0 commit comments

Comments
 (0)