memory
Classes:
-
Memory–An in memory implementation of a triple store.
-
SimpleMemory–A fast naive in memory implementation of a triple store.
Memory
Memory(configuration: Optional[str] = None, identifier: Optional[Identifier] = None)
Bases: Store
An in memory implementation of a triple store.
Same as SimpleMemory above, but is Context-aware, Graph-aware, and Formula-aware Authors: Ashley Sommer
Methods:
-
__len__– -
add–Add a triple to the store of triples.
-
add_graph– -
bind– -
contexts– -
namespace– -
namespaces– -
prefix– -
query– -
remove– -
remove_graph– -
triples–A generator over all the triples matching
-
update–
Attributes:
Source code in rdflib/plugins/stores/memory.py
__contextTriples
instance-attribute
__osp
instance-attribute
__pos
instance-attribute
__spo
instance-attribute
__tripleContexts
instance-attribute
__add_triple_context
__add_triple_context(triple: _TripleType, triple_exists: bool, context: Optional[_ContextType], quoted: bool) -> None
add the given context to the set of contexts for the triple
Source code in rdflib/plugins/stores/memory.py
__contexts
return a generator for all the non-quoted contexts (dereferenced) the encoded triple appears in
Source code in rdflib/plugins/stores/memory.py
__ctx_to_str
Source code in rdflib/plugins/stores/memory.py
__get_context_for_triple
__get_context_for_triple(triple: _TripleType, skipQuoted: bool = False) -> Collection[Optional[str]]
return a list of contexts (str) for the triple, skipping quoted contexts if skipQuoted==True
Source code in rdflib/plugins/stores/memory.py
__len__
__remove_triple_context
remove the context from the triple
Source code in rdflib/plugins/stores/memory.py
__triple_has_context
return True if the triple exists in the given context
Source code in rdflib/plugins/stores/memory.py
add
Add a triple to the store of triples.
Source code in rdflib/plugins/stores/memory.py
add_graph
add_graph(graph: Graph) -> None
bind
bind(prefix: str, namespace: URIRef, override: bool = True) -> None
Source code in rdflib/plugins/stores/memory.py
contexts
Source code in rdflib/plugins/stores/memory.py
namespace
namespace(prefix: str) -> Optional[URIRef]
namespaces
namespaces() -> Iterator[Tuple[str, URIRef]]
prefix
prefix(namespace: URIRef) -> Optional[str]
query
query(query: Union[Query, str], initNs: Mapping[str, Any], initBindings: Mapping[str, Identifier], queryGraph: str, **kwargs) -> Result
Source code in rdflib/plugins/stores/memory.py
remove
Source code in rdflib/plugins/stores/memory.py
triples
triples(triple_pattern: _TriplePatternType, context: Optional[_ContextType] = None) -> Generator[Tuple[_TripleType, Generator[Optional[_ContextType], None, None]], None, None]
A generator over all the triples matching
Source code in rdflib/plugins/stores/memory.py
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 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 | |
update
update(update: Union[Update, Any], initNs: Mapping[str, Any], initBindings: Mapping[str, Identifier], queryGraph: str, **kwargs) -> None
Source code in rdflib/plugins/stores/memory.py
SimpleMemory
SimpleMemory(configuration: Optional[str] = None, identifier: Optional[Identifier] = None)
Bases: Store
A fast naive in memory implementation of a triple store.
This triple store uses nested dictionaries to store triples. Each
triple is stored in two such indices as follows spo[s][p][o] = 1 and
pos[p][o][s] = 1.
Authors: Michel Pelletier, Daniel Krech, Stefan Niederhauser
Methods:
-
__len__– -
add–Add a triple to the store of triples.
-
bind– -
namespace– -
namespaces– -
prefix– -
query– -
remove– -
triples–A generator over all the triples matching
-
update–
Attributes:
Source code in rdflib/plugins/stores/memory.py
__osp
instance-attribute
__pos
instance-attribute
__spo
instance-attribute
__contexts
__len__
add
Add a triple to the store of triples.
Source code in rdflib/plugins/stores/memory.py
bind
bind(prefix: str, namespace: URIRef, override: bool = True) -> None
Source code in rdflib/plugins/stores/memory.py
namespace
namespace(prefix: str) -> Optional[URIRef]
namespaces
namespaces() -> Iterator[Tuple[str, URIRef]]
prefix
prefix(namespace: URIRef) -> Optional[str]
query
query(query: Union[Query, str], initNs: Mapping[str, Any], initBindings: Mapping[str, Identifier], queryGraph: str, **kwargs: Any) -> Result
Source code in rdflib/plugins/stores/memory.py
remove
Source code in rdflib/plugins/stores/memory.py
triples
triples(triple_pattern: _TriplePatternType, context: Optional[_ContextType] = None) -> Iterator[Tuple[_TripleType, Iterator[Optional[_ContextType]]]]
A generator over all the triples matching
Source code in rdflib/plugins/stores/memory.py
update
update(update: Union[Update, str], initNs: Mapping[str, Any], initBindings: Mapping[str, Identifier], queryGraph: str, **kwargs: Any) -> None