Expand description
Logseq is a knowledge graph that uses Markdown files to store notes. This module provides a middleware for creating a Thesaurus from a Logseq haystack.
Example:
If we parse a file named path/to/concept.md with the following content:
synonyms:: foo, bar, bazThen the thesaurus will contain the following entries:
use terraphim_types::{Thesaurus, Concept, NormalizedTerm};
let concept = Concept::new("concept".into());
let nterm = NormalizedTerm::new(concept.id, concept.value.clone());
let mut thesaurus = Thesaurus::new("Engineer".to_string());
thesaurus.insert(concept.value.clone(), nterm.clone());
thesaurus.insert("foo".to_string().into(),nterm.clone());
thesaurus.insert("bar".to_string().to_string().into(), nterm.clone());
thesaurus.insert("baz".to_string().into(), nterm.clone());The logic as follows: if you ask for concept by name you get concept, if you ask (get) for any of the synonyms you will get concept with id, its pre-computed reverse tree traversal - any of the synonyms (leaf) maps into the concepts (root)
Structs§
Traits§
- Thesaurus
Builder - A ThesaurusBuilder receives a path containing
resources (e.g. files) with key-value pairs and returns a
Thesaurus(a dictionary with synonyms which map to higher-level concepts)