rdflib.plugins package¶
Subpackages¶
- rdflib.plugins.parsers package
- Submodules
- rdflib.plugins.parsers.notation3 module
- rdflib.plugins.parsers.nquads module
- rdflib.plugins.parsers.nt module
- rdflib.plugins.parsers.ntriples module
NTriplesParser
NTriplesParser.__annotations__
NTriplesParser.__dict__
NTriplesParser.__init__()
NTriplesParser.__module__
NTriplesParser.__weakref__
NTriplesParser.eat()
NTriplesParser.literal()
NTriplesParser.nodeid()
NTriplesParser.object()
NTriplesParser.parse()
NTriplesParser.parseline()
NTriplesParser.parsestring()
NTriplesParser.peek()
NTriplesParser.predicate()
NTriplesParser.readline()
NTriplesParser.subject()
NTriplesParser.uriref()
Sink
unquote()
uriquote()
- rdflib.plugins.parsers.rdfxml module
BagID
ElementHandler
ElementHandler.__init__()
ElementHandler.__module__
ElementHandler.__slots__
ElementHandler.base
ElementHandler.char
ElementHandler.data
ElementHandler.datatype
ElementHandler.declared
ElementHandler.end
ElementHandler.id
ElementHandler.language
ElementHandler.li
ElementHandler.list
ElementHandler.next_li()
ElementHandler.object
ElementHandler.predicate
ElementHandler.start
ElementHandler.subject
RDFXMLHandler
RDFXMLHandler.__init__()
RDFXMLHandler.__module__
RDFXMLHandler.absolutize()
RDFXMLHandler.add_reified()
RDFXMLHandler.characters()
RDFXMLHandler.convert()
RDFXMLHandler.current
RDFXMLHandler.document_element_start()
RDFXMLHandler.endElementNS()
RDFXMLHandler.endPrefixMapping()
RDFXMLHandler.error()
RDFXMLHandler.get_current()
RDFXMLHandler.get_next()
RDFXMLHandler.get_parent()
RDFXMLHandler.ignorableWhitespace()
RDFXMLHandler.list_node_element_end()
RDFXMLHandler.literal_element_char()
RDFXMLHandler.literal_element_end()
RDFXMLHandler.literal_element_start()
RDFXMLHandler.next
RDFXMLHandler.node_element_end()
RDFXMLHandler.node_element_start()
RDFXMLHandler.parent
RDFXMLHandler.processingInstruction()
RDFXMLHandler.property_element_char()
RDFXMLHandler.property_element_end()
RDFXMLHandler.property_element_start()
RDFXMLHandler.reset()
RDFXMLHandler.setDocumentLocator()
RDFXMLHandler.startDocument()
RDFXMLHandler.startElementNS()
RDFXMLHandler.startPrefixMapping()
RDFXMLParser
create_parser()
- rdflib.plugins.parsers.trig module
- rdflib.plugins.parsers.trix module
TriXHandler
TriXHandler.__annotations__
TriXHandler.__init__()
TriXHandler.__module__
TriXHandler.characters()
TriXHandler.endElementNS()
TriXHandler.endPrefixMapping()
TriXHandler.error()
TriXHandler.get_bnode()
TriXHandler.ignorableWhitespace()
TriXHandler.processingInstruction()
TriXHandler.reset()
TriXHandler.setDocumentLocator()
TriXHandler.startDocument()
TriXHandler.startElementNS()
TriXHandler.startPrefixMapping()
TriXParser
create_parser()
- Module contents
- rdflib.plugins.serializers package
- Submodules
- rdflib.plugins.serializers.n3 module
N3Serializer
N3Serializer.__annotations__
N3Serializer.__init__()
N3Serializer.__module__
N3Serializer.endDocument()
N3Serializer.getQName()
N3Serializer.indent()
N3Serializer.isDone()
N3Serializer.p_clause()
N3Serializer.path()
N3Serializer.preprocessTriple()
N3Serializer.reset()
N3Serializer.s_clause()
N3Serializer.short_name
N3Serializer.startDocument()
N3Serializer.statement()
N3Serializer.subjectDone()
- rdflib.plugins.serializers.nquads module
- rdflib.plugins.serializers.nt module
- rdflib.plugins.serializers.rdfxml module
- rdflib.plugins.serializers.trig module
- rdflib.plugins.serializers.trix module
- rdflib.plugins.serializers.turtle module
RecursiveSerializer
RecursiveSerializer.__annotations__
RecursiveSerializer.__init__()
RecursiveSerializer.__module__
RecursiveSerializer.addNamespace()
RecursiveSerializer.buildPredicateHash()
RecursiveSerializer.checkSubject()
RecursiveSerializer.indent()
RecursiveSerializer.indentString
RecursiveSerializer.isDone()
RecursiveSerializer.maxDepth
RecursiveSerializer.orderSubjects()
RecursiveSerializer.predicateOrder
RecursiveSerializer.preprocess()
RecursiveSerializer.preprocessTriple()
RecursiveSerializer.reset()
RecursiveSerializer.roundtrip_prefixes
RecursiveSerializer.sortProperties()
RecursiveSerializer.subjectDone()
RecursiveSerializer.topClasses
RecursiveSerializer.write()
TurtleSerializer
TurtleSerializer.__annotations__
TurtleSerializer.__init__()
TurtleSerializer.__module__
TurtleSerializer.addNamespace()
TurtleSerializer.doList()
TurtleSerializer.endDocument()
TurtleSerializer.getQName()
TurtleSerializer.indentString
TurtleSerializer.isValidList()
TurtleSerializer.label()
TurtleSerializer.objectList()
TurtleSerializer.p_default()
TurtleSerializer.p_squared()
TurtleSerializer.path()
TurtleSerializer.predicateList()
TurtleSerializer.preprocessTriple()
TurtleSerializer.reset()
TurtleSerializer.s_default()
TurtleSerializer.s_squared()
TurtleSerializer.serialize()
TurtleSerializer.short_name
TurtleSerializer.startDocument()
TurtleSerializer.statement()
TurtleSerializer.verb()
- rdflib.plugins.serializers.xmlwriter module
- Module contents
- rdflib.plugins.sparql package
- Subpackages
- rdflib.plugins.sparql.results package
- Submodules
- rdflib.plugins.sparql.results.csvresults module
- rdflib.plugins.sparql.results.graph module
- rdflib.plugins.sparql.results.jsonresults module
- rdflib.plugins.sparql.results.rdfresults module
- rdflib.plugins.sparql.results.tsvresults module
- rdflib.plugins.sparql.results.txtresults module
- rdflib.plugins.sparql.results.xmlresults module
- Module contents
- rdflib.plugins.sparql.results package
- Submodules
- rdflib.plugins.sparql.aggregates module
- rdflib.plugins.sparql.algebra module
BGP()
Extend()
Filter()
Graph()
Group()
Join()
LeftJoin()
Minus()
OrderBy()
Project()
StopTraversal
ToMultiSet()
Union()
Values()
analyse()
collectAndRemoveFilters()
pprintAlgebra()
reorderTriples()
simplify()
translate()
translateAggregates()
translateExists()
translateGraphGraphPattern()
translateGroupGraphPattern()
translateGroupOrUnionGraphPattern()
translateInlineData()
translatePName()
translatePath()
translatePrologue()
translateQuads()
translateQuery()
translateUpdate()
translateUpdate1()
translateValues()
traverse()
triples()
- rdflib.plugins.sparql.datatypes module
- rdflib.plugins.sparql.evaluate module
evalAggregateJoin()
evalAskQuery()
evalBGP()
evalConstructQuery()
evalDistinct()
evalExtend()
evalFilter()
evalGraph()
evalGroup()
evalJoin()
evalLazyJoin()
evalLeftJoin()
evalMinus()
evalMultiset()
evalOrderBy()
evalPart()
evalProject()
evalQuery()
evalReduced()
evalSelectQuery()
evalServiceQuery()
evalSlice()
evalUnion()
evalValues()
- rdflib.plugins.sparql.evalutils module
- rdflib.plugins.sparql.operators module
AdditiveExpression()
Builtin_ABS()
Builtin_BNODE()
Builtin_BOUND()
Builtin_CEIL()
Builtin_COALESCE()
Builtin_CONCAT()
Builtin_CONTAINS()
Builtin_DATATYPE()
Builtin_DAY()
Builtin_ENCODE_FOR_URI()
Builtin_EXISTS()
Builtin_FLOOR()
Builtin_HOURS()
Builtin_IF()
Builtin_IRI()
Builtin_LANG()
Builtin_LANGMATCHES()
Builtin_LCASE()
Builtin_MD5()
Builtin_MINUTES()
Builtin_MONTH()
Builtin_NOW()
Builtin_RAND()
Builtin_REGEX()
Builtin_REPLACE()
Builtin_ROUND()
Builtin_SECONDS()
Builtin_SHA1()
Builtin_SHA256()
Builtin_SHA384()
Builtin_SHA512()
Builtin_STR()
Builtin_STRAFTER()
Builtin_STRBEFORE()
Builtin_STRDT()
Builtin_STRENDS()
Builtin_STRLANG()
Builtin_STRLEN()
Builtin_STRSTARTS()
Builtin_STRUUID()
Builtin_SUBSTR()
Builtin_TIMEZONE()
Builtin_TZ()
Builtin_UCASE()
Builtin_UUID()
Builtin_YEAR()
Builtin_isBLANK()
Builtin_isIRI()
Builtin_isLITERAL()
Builtin_isNUMERIC()
Builtin_sameTerm()
ConditionalAndExpression()
ConditionalOrExpression()
EBV()
Function()
MultiplicativeExpression()
RelationalExpression()
UnaryMinus()
UnaryNot()
UnaryPlus()
and_()
custom_function()
datetime()
default_cast()
literal()
not_()
numeric()
register_custom_function()
simplify()
string()
unregister_custom_function()
- rdflib.plugins.sparql.parser module
- rdflib.plugins.sparql.parserutils module
- rdflib.plugins.sparql.processor module
- rdflib.plugins.sparql.sparql module
AlreadyBound
Bindings
FrozenBindings
FrozenBindings.__abstractmethods__
FrozenBindings.__annotations__
FrozenBindings.__getitem__()
FrozenBindings.__init__()
FrozenBindings.__module__
FrozenBindings.bnodes
FrozenBindings.forget()
FrozenBindings.merge()
FrozenBindings.now
FrozenBindings.project()
FrozenBindings.prologue
FrozenBindings.remember()
FrozenDict
FrozenDict.__abstractmethods__
FrozenDict.__annotations__
FrozenDict.__dict__
FrozenDict.__getitem__()
FrozenDict.__hash__()
FrozenDict.__init__()
FrozenDict.__iter__()
FrozenDict.__len__()
FrozenDict.__module__
FrozenDict.__repr__()
FrozenDict.__str__()
FrozenDict.__weakref__
FrozenDict.compatible()
FrozenDict.disjointDomain()
FrozenDict.merge()
FrozenDict.project()
NotBoundError
Prologue
Query
QueryContext
QueryContext.__dict__
QueryContext.__getitem__()
QueryContext.__init__()
QueryContext.__module__
QueryContext.__setitem__()
QueryContext.__weakref__
QueryContext.clean()
QueryContext.clone()
QueryContext.dataset
QueryContext.get()
QueryContext.load()
QueryContext.push()
QueryContext.pushGraph()
QueryContext.solution()
QueryContext.thaw()
SPARQLError
SPARQLTypeError
- rdflib.plugins.sparql.update module
- Module contents
- Subpackages
- rdflib.plugins.stores package
- Submodules
- rdflib.plugins.stores.auditable module
AuditableStore
AuditableStore.__annotations__
AuditableStore.__init__()
AuditableStore.__len__()
AuditableStore.__module__
AuditableStore.add()
AuditableStore.bind()
AuditableStore.close()
AuditableStore.commit()
AuditableStore.contexts()
AuditableStore.destroy()
AuditableStore.namespace()
AuditableStore.namespaces()
AuditableStore.open()
AuditableStore.prefix()
AuditableStore.query()
AuditableStore.remove()
AuditableStore.rollback()
AuditableStore.triples()
- rdflib.plugins.stores.concurrent module
- rdflib.plugins.stores.regexmatching module
REGEXMatching
REGEXMatching.__annotations__
REGEXMatching.__init__()
REGEXMatching.__len__()
REGEXMatching.__module__
REGEXMatching.add()
REGEXMatching.bind()
REGEXMatching.close()
REGEXMatching.commit()
REGEXMatching.contexts()
REGEXMatching.destroy()
REGEXMatching.namespace()
REGEXMatching.namespaces()
REGEXMatching.open()
REGEXMatching.prefix()
REGEXMatching.remove()
REGEXMatching.remove_context()
REGEXMatching.rollback()
REGEXMatching.triples()
REGEXTerm
regexCompareQuad()
- rdflib.plugins.stores.sparqlconnector module
- rdflib.plugins.stores.sparqlstore module
SPARQLStore
SPARQLStore.__annotations__
SPARQLStore.__init__()
SPARQLStore.__len__()
SPARQLStore.__module__
SPARQLStore.add()
SPARQLStore.addN()
SPARQLStore.add_graph()
SPARQLStore.bind()
SPARQLStore.close()
SPARQLStore.commit()
SPARQLStore.contexts()
SPARQLStore.create()
SPARQLStore.destroy()
SPARQLStore.formula_aware
SPARQLStore.graph_aware
SPARQLStore.namespace()
SPARQLStore.namespaces()
SPARQLStore.open()
SPARQLStore.prefix()
SPARQLStore.query()
SPARQLStore.regex_matching
SPARQLStore.remove()
SPARQLStore.remove_graph()
SPARQLStore.rollback()
SPARQLStore.transaction_aware
SPARQLStore.triples()
SPARQLStore.triples_choices()
SPARQLUpdateStore
SPARQLUpdateStore.BLOCK_END
SPARQLUpdateStore.BLOCK_FINDING_PATTERN
SPARQLUpdateStore.BLOCK_START
SPARQLUpdateStore.BlockContent
SPARQLUpdateStore.BlockFinding
SPARQLUpdateStore.COMMENT
SPARQLUpdateStore.ESCAPED
SPARQLUpdateStore.IRIREF
SPARQLUpdateStore.STRING_LITERAL1
SPARQLUpdateStore.STRING_LITERAL2
SPARQLUpdateStore.STRING_LITERAL_LONG1
SPARQLUpdateStore.STRING_LITERAL_LONG2
SPARQLUpdateStore.String
SPARQLUpdateStore.__annotations__
SPARQLUpdateStore.__init__()
SPARQLUpdateStore.__len__()
SPARQLUpdateStore.__module__
SPARQLUpdateStore.add()
SPARQLUpdateStore.addN()
SPARQLUpdateStore.add_graph()
SPARQLUpdateStore.close()
SPARQLUpdateStore.commit()
SPARQLUpdateStore.contexts()
SPARQLUpdateStore.open()
SPARQLUpdateStore.query()
SPARQLUpdateStore.remove()
SPARQLUpdateStore.remove_graph()
SPARQLUpdateStore.rollback()
SPARQLUpdateStore.setTimeout()
SPARQLUpdateStore.triples()
SPARQLUpdateStore.update()
SPARQLUpdateStore.where_pattern
- Module contents
Submodules¶
rdflib.plugins.memory module¶
- class rdflib.plugins.memory.IOMemory(configuration=None, identifier=None)[source]¶
Bases:
Store
An integer-key-optimized context-aware in-memory store.
Uses three dict indices (for subjects, objects and predicates) holding sets of triples. Context information is tracked in a separate dict, with the triple as key and a dict of {context: quoted} items as value. The context information is used to filter triple query results.
Memory usage is low due to several optimizations. RDF nodes are not stored directly in the indices; instead, the indices hold integer keys and the actual nodes are only stored once in int-to-object and object-to-int mapping dictionaries. A default context is determined based on the first triple that is added to the store, and no context information is actually stored for subsequent other triples with the same context information.
Most operations should be quite fast, but a triples() query with two bound parts requires a set intersection operation, which may be slow in some cases. When multiple contexts are used in the same store, filtering based on context has to be done after each query, which may also be slow.
- __annotations__ = {}¶
- __init__(configuration=None, identifier=None)[source]¶
identifier: URIRef of the Store. Defaults to CWD configuration: string containing infomation open can use to connect to datastore.
- __len__(context=None)[source]¶
Number of statements in the store. This should only account for non- quoted (asserted) statements if the context is not specified, otherwise it should return the number of statements in the formula or context given.
- Parameters
context – a graph instance to query or None
- __module__ = 'rdflib.plugins.memory'¶
- add(triple, context, quoted=False)[source]¶
Adds the given statement to a specific context or to the model. The quoted argument is interpreted by formula-aware stores to indicate this statement is quoted/hypothetical It should be an error to not specify a context and have the quoted argument be True. It should also be an error for the quoted argument to be True when the store is not formula-aware.
- add_graph(graph)[source]¶
Add a graph to the store, no effect if the graph already exists. :param graph: a Graph instance
- context_aware = True¶
- contexts(triple=None)[source]¶
Generator over all contexts in the graph. If triple is specified, a generator over all contexts the triple is in.
if store is graph_aware, may also return empty contexts
- Returns
a generator over Nodes
- formula_aware = True¶
- graph_aware = True¶
- remove(triplepat, context=None)[source]¶
Remove the set of triples matching the pattern from the store
- remove_graph(graph)[source]¶
Remove a graph from the store, this shoud also remove all triples in the graph
- Parameters
graphid – a Graph instance
- triples(triplein, context=None)[source]¶
A generator over all the triples matching the pattern. Pattern can include any objects for used for comparing against nodes in the store, for example, REGEXTerm, URIRef, Literal, BNode, Variable, Graph, QuotedGraph, Date? DateRange?
- Parameters
context – A conjunctive query can be indicated by either providing a value of None, or a specific context can be queries by passing a Graph instance (if store is context aware).
- class rdflib.plugins.memory.Memory(configuration=None, identifier=None)[source]¶
Bases:
Store
An 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
- __annotations__ = {}¶
- __init__(configuration=None, identifier=None)[source]¶
identifier: URIRef of the Store. Defaults to CWD configuration: string containing infomation open can use to connect to datastore.
- __len__(context=None)[source]¶
Number of statements in the store. This should only account for non- quoted (asserted) statements if the context is not specified, otherwise it should return the number of statements in the formula or context given.
- Parameters
context – a graph instance to query or None
- __module__ = 'rdflib.plugins.memory'¶
rdflib.plugins.sleepycat module¶
- class rdflib.plugins.sleepycat.Sleepycat(configuration=None, identifier=None)[source]¶
Bases:
Store
- __annotations__ = {}¶
- __init__(configuration=None, identifier=None)[source]¶
identifier: URIRef of the Store. Defaults to CWD configuration: string containing infomation open can use to connect to datastore.
- __len__(context=None)[source]¶
Number of statements in the store. This should only account for non- quoted (asserted) statements if the context is not specified, otherwise it should return the number of statements in the formula or context given.
- Parameters
context – a graph instance to query or None
- __module__ = 'rdflib.plugins.sleepycat'¶
- add_graph(graph)[source]¶
Add a graph to the store, no effect if the graph already exists. :param graph: a Graph instance
- close(commit_pending_transaction=False)[source]¶
This closes the database connection. The commit_pending_transaction parameter specifies whether to commit all pending transactions before closing (if the store is transactional).
- context_aware = True¶
- contexts(triple=None)[source]¶
Generator over all contexts in the graph. If triple is specified, a generator over all contexts the triple is in.
if store is graph_aware, may also return empty contexts
- Returns
a generator over Nodes
- db_env = None¶
- formula_aware = True¶
- graph_aware = True¶
- property identifier¶
- open(path, create=True)[source]¶
Opens the store specified by the configuration string. If create is True a store will be created if it does not already exist. If create is False and a store does not already exist an exception is raised. An exception is also raised if a store exists, but there is insufficient permissions to open the store. This should return one of: VALID_STORE, CORRUPTED_STORE, or NO_STORE
- remove(spo, context, txn=None)[source]¶
Remove the set of triples matching the pattern from the store
- remove_graph(graph)[source]¶
Remove a graph from the store, this shoud also remove all triples in the graph
- Parameters
graphid – a Graph instance
- transaction_aware = False¶
Module contents¶
Default plugins for rdflib.
This is a namespace package and contains the default plugins for rdflib.