Application for knowledge graph enrichment through linking with DBpedia.
pip install requirements.txtor
python -m pip install requirements.txtFor enriching the ontology, first specify all the properties in the options.json file:
| Name | Description | Example |
|---|---|---|
| input_file | Path to the ontology in .ttl fromat | "ttl/sto.ttl" |
| whitelist | List of predicates to fetch from DBpedia while enriching | [ "<http://purl.org/dc/terms/subject>" ] |
| blacklist | List of predicates to exclude from enrichment process | [ "http://purl.org/voc/vrank#hasRank" ] |
| prefixes | List of prefixes to assign to the resulting ontology | [ { "prfx": "deo", "uri": "http://purl.org/spar/deo/" } ] |
Next, execute enrich.py with options.json as a parameter:
python enrich.py options.jsonUsing a Turtle format of the Standard Ontology (STO) as an input without specifying whitelist and blacklist in the options.json, i.e., fetching all reachable data from DBpedia, the following results can be achieved:
| # of DBpedia links | # of added triples |
|---|---|
| 78 | 8268 |
You can check out the input and the resulting file here.
MIT License. Copyright (c) 2018 Maxim Maltsev.