May 02, 2015

rdfextras.sparql.evaluate - SPARQL Evaluate

class rdfextras.sparql.evaluate.Resolver[source]
class rdfextras.sparql.evaluate.BNodeRef[source]

An explicit reference to a persistent BNode in the data set. This use of the syntax “_:x” to reference a named BNode is technically in violation of the SPARQL spec, but is also very useful. If an undistinguished variable is desired, then an actual variable can be used as a trivial workaround.

Support for these can be disabled by disabling the ‘EVAL_OPTION_ALLOW_BNODE_REF’ evaulation option.

Also known as special ‘session’ BNodes. I.e., BNodes at the query side which refer to BNodes in persistence

rdfextras.sparql.evaluate.convertTerm(term, queryProlog)[source]

Utility function for converting parsed Triple components into Unbound

rdfextras.sparql.evaluate.unRollCollection(collection, queryProlog)[source]
rdfextras.sparql.evaluate.unRollRDFTerm(item, queryProlog)[source]
rdfextras.sparql.evaluate.unRollTripleItems(items, queryProlog)[source]

Takes a list of Triples (nested lists or ParsedConstrainedTriples) and (recursively) returns a generator over all the contained triple patterns

rdfextras.sparql.evaluate.mapToOperator(expr, prolog, combinationArg=None, constraint=False)[source]

Reduces certain expressions (operator expressions, function calls, terms, and combinator expressions) into strings of their Python equivalent

rdfextras.sparql.evaluate.createSPARQLPConstraint(filter, prolog)[source]

Takes an instance of either ParsedExpressionFilter or ParsedFunctionFilter and converts it to a sparql-p operator by composing a python string of lambda functions and SPARQL operators. This string is then evaluated to return the actual function for sparql-p


Determines (recursively) if the BasicGraphPattern contains any Triple Patterns returning a boolean flag indicating if it does or not

Previous topic

components - SPARQL components

Next topic

graph - SPARQL Graph