Conditions | 9 |
Total Lines | 18 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | """Support for exclude/include rules for subject vocabularies""" |
||
21 | def kwargs_to_exclude_uris(graph: Graph, kwargs: dict[str, str]) -> set[str]: |
||
22 | exclude_uris = set() |
||
23 | for key, value in kwargs.items(): |
||
24 | vals = value.split("|") |
||
25 | if key == "exclude": |
||
26 | exclude_uris.update(vals) |
||
27 | elif key == "exclude_type": |
||
28 | for val in vals: |
||
29 | exclude_uris.update(uris_by_type(graph, val)) |
||
30 | elif key == "exclude_scheme": |
||
31 | for val in vals: |
||
32 | exclude_uris.update(uris_by_scheme(graph, val)) |
||
33 | elif key == "exclude_collection": |
||
34 | for val in vals: |
||
35 | exclude_uris.update(uris_by_collection(graph, val)) |
||
36 | else: |
||
37 | raise ConfigurationException(f"unknown vocab keyword argument {key}") |
||
38 | return exclude_uris |
||
39 |