kazu.database.in_memory_db¶
Classes
Singleton of Ontology metadata database. |
|
Singleton of a database of synonyms. |
- class kazu.database.in_memory_db.MetadataDatabase[source]¶
Bases:
object
Singleton of Ontology metadata database.
Purpose: metadata needs to be looked up in different linking processes, and this singleton allows us to load it once/reduce memory usage
- add_parser(name, entity_class, metadata)[source]¶
Add metadata to the ontology. Note, metadata is assumed to be static, and global. Calling this function will override any existing entries with associated with the keys in the metadata dict.
- class kazu.database.in_memory_db.SynonymDatabase[source]¶
Bases:
object
Singleton of a database of synonyms.
- add_parser(name, synonyms)[source]¶
Add synonyms to the database.
- Parameters:
name (str) – name of ontology to add to
synonyms (Iterable[LinkingCandidate]) – iterable of LinkingCandidates to add
- Returns:
- Return type:
None
- get(name, synonym)[source]¶
Get a set of EquivalentIdSets associated with an ontology and synonym string.
- Parameters:
- Returns:
- Return type: