get_identifier_index

get_identifier_index(mappings: Iterable[Mapping], *, show_progress: bool = True, predicates: Collection[NormalizedNamableReference] | None = None, directed: bool = False) dict[tuple[str, str], set[str]][source]

Index which entities in each vocabulary have been mapped.

Parameters:
  • mappings – An iterable of mappings to be indexed

  • predicates – If given, filter to mappings with these predicates

Returns:

A directed index

For example, if we have the triples P1:1 skos:exactMatch P2:A and P1:1 skos:exactMatch P3:X, we would have the following index:

{
    ("P1", "P2"): {"1"},
    ("P2", "P1"): {"A"},
    ("P1", "P3"): {"1"},
    ("P3", "P1"): {"X"},
}