berkeleydb_example
BerkeleyDB in use as a persistent Graph store.
Example 1: simple actions
- creating a ConjunctiveGraph using the BerkeleyDB Store
- adding triples to it
- counting them
- closing the store, emptying the graph
- re-opening the store using the same DB files
- getting the same count of triples as before
Example 2: larger data
- loads multiple graphs downloaded from GitHub into a BerkeleyDB-baked graph stored in the folder gsq_vocabs.
- does not delete the DB at the end so you can see it on disk
Functions:
-
example_1–Creates a ConjunctiveGraph and performs some BerkeleyDB tasks with it
-
example_2–Loads a number of SKOS vocabularies from GitHub into a BerkeleyDB-backed graph stored in the local folder
example_1
Creates a ConjunctiveGraph and performs some BerkeleyDB tasks with it
Source code in examples/berkeleydb_example.py
example_2
Loads a number of SKOS vocabularies from GitHub into a BerkeleyDB-backed graph stored in the local folder ‘gsq_vocabs’
Should print out the number of triples after each load, e.g.: 177 248 289 379 421 628 764 813 965 1381 9666 9719 …