Home | Trees | Index | Help |
---|
Package rdflib :: Package sparql :: Module sparql |
|
SPARQL implementation on top of RDFLib Implementation of the <a
href="http://www.w3.org/TR/rdf-sparql-query/">W3C
SPARQL</a> language (version April 2005). The basic class here is
supposed to be a superclass of rdflibUtils.myTripleStore
; it
has been separated only for a better maintainability.
Classes | |
---|---|
Query |
Result of a SPARQL query. |
SPARQL |
A wrapper class around the RDFLib triple store implementing the Sparql utilities. |
_SPARQLNode |
The SPARQL implementation is based on the creation of a tree, each level for each statement in the 'where' clause of SPARQL. |
Exceptions | |
---|---|
SPARQLError |
Am SPARQL error has been detected |
Function Summary | |
---|---|
The following remark in the SPARQL document is important: | |
Creates an initial binding directory for the Graph Pattern by putting a None as a value for each query variable. | |
Create an RDFLib Literal instance with the corresponding XML Schema datatype set. | |
Boolean |
Is 'r' a request string (ie, of the form "?XXX")? |
The result in an expansion node is in the form of an array of binding dictionaries. | |
string |
Return an XML Schema type starting from a Python variable. |
To unfold nested lists of the sort = [t,[t1,t2],tt,ttt] into [t,t1,tt,ttt] and [t,t2,tt,ttt]. |
Variable Summary | |
---|---|
bool |
Debug = False
|
URIRef |
JunkResource = u'http://www.ivan-herman.net/SPARQLJunk'
|
str |
type_date = 'http://www.w3.org/2001/XMLSchema#date'
|
str |
type_dateTime = 'http://www.w3.org/2001/XMLSchema#dateTi...
|
str |
type_decimal = 'http://www.w3.org/2001/XMLSchema#decimal...
|
str |
type_double = 'http://www.w3.org/2001/XMLSchema#double'
|
str |
type_float = 'http://www.w3.org/2001/XMLSchema#float'
|
str |
type_integer = 'http://www.w3.org/2001/XMLSchema#integer...
|
str |
type_long = 'http://www.w3.org/2001/XMLSchema#long'
|
str |
type_string = 'http://www.w3.org/2001/XMLSchema#string'
|
str |
type_time = 'http://www.w3.org/2001/XMLSchema#time'
|
dict |
_basicTypes = {<type 'int'>: 'http://www.w3.org/2001/XML...
|
dict |
_extraTypes = {<type 'datetime.datetime'>: 'http://www.w...
|
str |
_graphKey = '$$GRAPH$$'
|
str |
_questChar = '?'
|
Function Details |
---|
_checkOptionals(pattern, optionals)The following remark in the SPARQL document is important: "If a new variable is mentioned in an optional block (as mbox and hpage are mentioned in the previous example), that variable can be mentioned in that block and can not be mentioned in a subsequent block." What this means is that the various optional blocks do not interefere at this level and there is no need for a check whether a binding in a subsequent block clashes with an earlier optional block. This method checks whether this requirement is fulfilled. Raises a SPARQLError exception if it is not (the rest of the algorithm relies on this, so checking it is a good idea...)
|
_createInitialBindings(pattern)Creates an initial binding directory for the Graph Pattern by putting a None as a value for each query variable.
|
_createResource(v)Create an RDFLib Literal instance with the corresponding XML Schema datatype set. If the variable is already an RDFLib resource, it simply returns the resource; otherwise the corresponding Literal. A SPARQLError Exception is raised if the type is not implemented. The Literal contains the string representation of the variable (as Python does it by default) with the corresponding XML Schema URI set.
|
_isResQuest(r)Is 'r' a request string (ie, of the form "?XXX")?
|
_processResults(select, arr)The result in an expansion node is in the form of an array of binding dictionaries. The caller should receive an array of tuples, each tuple representing the final binding (or None) in the order of the original select. This method is the last step of processing by processing these values to produce the right result.
|
_schemaType(v)Return an XML Schema type starting from a Python variable. An exception is raised if the variable does not corresponds to any of the schema types that are allowed by this implementation. A SPARQLError Exception is raised if the type represents a non-implemented type.
|
_unfoldNestedLists(args)To unfold nested lists of the sort = [t,[t1,t2],tt,ttt] into [t,t1,tt,ttt] and [t,t2,tt,ttt]. Returns the list of lists. This utility is necessary to maintain the deprecated interfaces. When those disappear, this utility can be deleted, too
|
Variable Details |
---|
Debug
|
JunkResource
|
type_date
|
type_dateTime
|
type_decimal
|
type_double
|
type_float
|
type_integer
|
type_long
|
type_string
|
type_time
|
_extraTypes
|
_graphKey
|
_questChar
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Wed Jun 29 09:50:16 2005 | http://epydoc.sf.net |