Package: nomenklatura
nomenklaturaNomenklatura de-duplicates and integrates differentFollow the Moneyentities. It serves to clean up messy data and to find links between different datasets.UsageYou can installnomenklaturavia PyPI:$pipinstallnomenklaturaCommand-line usageMuch of the functionality ofnomenklaturacan be used as a command-line tool. In the following example, we'll assume that you have a file containingFollow the Moneyentities in your local directory, namedentities.ijson. If you just want try it out, you can use the filetests/fixtures/donations.ijsonin this repository for testing (it contains German campaign finance data).With the file in place, you will cross-reference the entities to generate de-duplication candidates, then run the interactive de-duplication UI in your console, and eventually apply the judgements to generate a new file with merged entities:# generate merge candidates using an in-memory index:$nomenklaturaxref-rresolver.jsonentities.ijson# note there is now a new file, `resolver.json` that contains de-duplication info.$nomenklaturadedupe-rresolver.jsonentites.ijson# will pop up a user interface.$nomenklaturaapplyentities.ijson-omerged.ijson-rresolver.json# de-duplicated data goes into `merged.ijson`:$catentities.ijson|wc-l474$catmerged.ijson|wc-l468Programmatic usageThe command-line use ofnomenklaturais targeted at small datasets which need to be de-duplicated. For more involved scenarios, the package also offers a Python API which can be used to control the semantics of de-duplication.nomenklatura.Dataset- implements a basic dataset for describing a set of entities.nomenklatura.Store- a general purpose access mechanism for entities. By default, a store is used to access entity data stored in files as an in-memory cache, but the store can be subclassed to work with entities from a database system.nomenklatura.Index- a full-text in-memory search index for FtM entities. In the application, this is used to block de-duplication candidates, but the index can also be used to drive an API etc.nomenklatura.Resolver- the core of the de-duplication process, the resolver is essentially a graph with edges made out of entity judgements. The resolver can be used to store judgements or get the canonical ID for a given entity.All of the API classes have extensive type annotations, which should make their integration in any modern Python API simpler.DesignThis package offers an implementation of an in-memory data deduplication framework centered around the FtM data model. The idea is the following workflow:Accept FtM-shaped entities from a given loader (e.g. a JSON file, or a database)Build an in-memory inverted index of the entities for dedupe blockingGenerate merge candidates using the blocking index and FtM compareProvide a file-based storage format for merge challenges and decisionsProvide a text-based user interface to let users make merge decisionsLater on, the following might be added:A web application to let users make merge decisions on the webResolver graphThe key implementation detail of nomenklatura is theResolver, a graph structure that
manages user decisions regarding entity identity. Edges areJudgementsof whether
two entity IDs are the same, not the same, or undecided. The resolver implements an
algorithm for computing connected components, which can the be used to find the best
available ID for a cluster of entities. It can also be used to evaluate transitive
judgements, e.g. if A <> B, and B = C, then we don't need to ask if A = C.Readinghttps://dedupe.readthedocs.org/en/latest/https://github.com/OpenRefine/OpenRefine/wiki/Reconcilable-Data-Sourceshttps://github.com/OpenRefine/OpenRefine/wiki/Clustering-In-Depthhttps://github.com/OpenRefine/OpenRefine/wiki/Reconciliation-Service-APIContact, contributions etc.This codebase is licensed under the terms of an MIT license (see LICENSE).We're keen for any contributions, bug fixes and feature suggestions, please use the GitHub issue tracker for this repository.Nomenklatura is currently developed thanks to a Prototypefund grant forOpenSanctions. Previous iterations of the package were developed with support fromKnight-Mozilla OpenNewsand theOpen Knowledge Foundation Labs.