berkeleydb
Classes:
-
BerkeleyDB–A store that allows for on-disk persistent using BerkeleyDB, a fast key/value DB.
__all__
module-attribute
BerkeleyDB
BerkeleyDB(configuration: Optional[str] = None, identifier: Optional[Identifier] = None)
Bases: Store
A store that allows for on-disk persistent using BerkeleyDB, a fast key/value DB.
This store implementation used to be known, previous to rdflib 6.0.0 as ‘Sleepycat’ due to that being the then name of the Python wrapper for BerkeleyDB.
This store allows for quads as well as triples. See examples of use
in both the examples.berkeleydb_example and test/test_store/test_store_berkeleydb.py
files.
NOTE on installation:
To use this store, you must have BerkeleyDB installed on your system
separately to Python (brew install berkeley-db on a Mac) and also have
the BerkeleyDB Python wrapper installed (pip install berkeleydb).
You may need to install BerkeleyDB Python wrapper like this:
YES_I_HAVE_THE_RIGHT_TO_USE_THIS_BERKELEY_DB_VERSION=1 pip install berkeleydb
Methods:
-
__len__– -
add–Add a triple to the store of triples.
-
add_graph– -
bind– -
close– -
contexts– -
is_open– -
namespace– -
namespaces– -
open– -
prefix– -
remove– -
remove_graph– -
sync– -
triples–A generator over all the triples matching
Attributes:
-
context_aware– -
db_env(DBEnv) – -
formula_aware– -
graph_aware– -
identifier– -
transaction_aware–
Source code in rdflib/plugins/stores/berkeleydb.py
__get_identifier
__get_identifier() -> Optional[Identifier]
__len__
Source code in rdflib/plugins/stores/berkeleydb.py
__lookup
__lookup(spo: _TriplePatternType, context: Optional[_ContextType], txn: Optional[Any] = None) -> Tuple[DB, bytes, _FromKeyFunc, _ResultsFromKeyFunc]
Source code in rdflib/plugins/stores/berkeleydb.py
__remove
__remove(spo: Tuple[bytes, bytes, bytes], c: bytes, quoted: bool = False, txn: Optional[Any] = None) -> None
Source code in rdflib/plugins/stores/berkeleydb.py
__sync_run
Source code in rdflib/plugins/stores/berkeleydb.py
add
add(triple: _TripleType, context: _ContextType, quoted: bool = False, txn: Optional[Any] = None) -> None
Add a triple to the store of triples.
Source code in rdflib/plugins/stores/berkeleydb.py
add_graph
add_graph(graph: Graph) -> None
bind
bind(prefix: str, namespace: URIRef, override: bool = True) -> None
Source code in rdflib/plugins/stores/berkeleydb.py
close
Source code in rdflib/plugins/stores/berkeleydb.py
contexts
Source code in rdflib/plugins/stores/berkeleydb.py
is_open
namespace
namespace(prefix: str) -> Optional[URIRef]
Source code in rdflib/plugins/stores/berkeleydb.py
namespaces
namespaces() -> Generator[Tuple[str, URIRef], None, None]
Source code in rdflib/plugins/stores/berkeleydb.py
open
Source code in rdflib/plugins/stores/berkeleydb.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |
prefix
prefix(namespace: URIRef) -> Optional[str]
Source code in rdflib/plugins/stores/berkeleydb.py
remove
Source code in rdflib/plugins/stores/berkeleydb.py
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | |
remove_graph
remove_graph(graph: Graph)
sync
triples
triples(spo: _TriplePatternType, context: Optional[_ContextType] = None, txn: Optional[Any] = None) -> Generator[Tuple[_TripleType, Generator[Optional[_ContextType], None, None]], None, None]
A generator over all the triples matching
Source code in rdflib/plugins/stores/berkeleydb.py
bb
from_key_func
Source code in rdflib/plugins/stores/berkeleydb.py
readable_index
results_from_key_func
results_from_key_func(i: int, from_string: Callable[[bytes], Node]) -> _ResultsFromKeyFunc