sparql
SPARQL implementation for RDFLib
New in version 4.0
Modules:
-
aggregates–Aggregation functions
-
algebra–Converting the ‘parse-tree’ output of pyparsing to a SPARQL Algebra expression
-
datatypes–Utility functions for supporting the XML Schema Datatypes hierarchy
-
evaluate–These method recursively evaluate the SPARQL Algebra
-
evalutils– -
operators–This contains evaluation functions for expressions
-
parser–SPARQL 1.1 Parser
-
parserutils–NOTE: PyParsing setResultName/call provides a very similar solution to this
-
processor–Code for tying SPARQL Engine into RDFLib
-
results–Parsers and serializers for SPARQL Result formats
-
sparql– -
update–Code for carrying out Update Operations
Functions:
-
prepareQuery–Parse and translate a SPARQL Query
-
prepareUpdate–Parse and translate a SPARQL Update
-
processUpdate–Process a SPARQL Update Request
Attributes:
-
CUSTOM_EVALS–Custom evaluation functions
CUSTOM_EVALS
module-attribute
Custom evaluation functions
These must be functions taking (ctx, part) and raise NotImplementedError if they cannot handle a certain part
SPARQL_DEFAULT_GRAPH_UNION
module-attribute
If True - the default graph in the RDF Dataset is the union of all named graphs (like RDFLib’s ConjunctiveGraph)
SPARQL_LOAD_GRAPHS
module-attribute
If True, using FROM
__all__
module-attribute
__all__ = ['prepareQuery', 'prepareUpdate', 'processUpdate', 'operators', 'parser', 'parserutils', 'CUSTOM_EVALS']
prepareQuery
prepareQuery(queryString: str, initNs: Optional[Mapping[str, Any]] = None, base: Optional[str] = None) -> Query
Parse and translate a SPARQL Query
Source code in rdflib/plugins/sparql/processor.py
prepareUpdate
prepareUpdate(updateString: str, initNs: Optional[Mapping[str, Any]] = None, base: Optional[str] = None) -> Update
Parse and translate a SPARQL Update
Source code in rdflib/plugins/sparql/processor.py
processUpdate
processUpdate(graph: Graph, updateString: str, initBindings: Optional[Mapping[str, Identifier]] = None, initNs: Optional[Mapping[str, Any]] = None, base: Optional[str] = None) -> None
Process a SPARQL Update Request returns Nothing on success or raises Exceptions on error