Home | Trees | Indices | Help |
|
---|
|
object --+ | SPARQLWrapper
Wrapper around an online access to a SPARQL Web entry point.
The same class instance can be reused for subsequent queries. The values of the base Graph URI, return formats, etc, are retained from one query to the next (in other words, only the query string changes). The instance can also be reset to its initial values using the resetQuery method.
|
|||
|
|||
|
|||
|
|||
|
|||
string |
|
||
|
|||
bool |
|
||
|
|||
|
|||
|
|||
bool |
|
||
bool |
|
||
|
|||
|
|||
QueryResult instance |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
compiled regular expression (see the re module of
Python)
|
pattern = re.compile(r' regular expression used to determine whether a query is of type CONSTRUCT, SELECT, ASK, or DESCRIBE. |
|
|||
baseURI the URI of the SPARQL service |
|
|||
Inherited from |
|
Class encapsulating a full SPARQL call.
|
Internal method to create request according a HTTP method. Returns a
|
Parse the SPARQL query and return its type (ie, SELECT, ASK, etc). Note that the method returns SELECT if nothing is specified. This is just to get all other methods running; in fact, this means that the query is erronous, because the query must be, according to the SPARQL specification, one of Select, Ask, Describe, or Construct. The SPARQL endpoint should raise an exception (via urllib) for such syntax error.
|
Internal method to execute the query. Returns the output of the
|
Method is kept for backwards compatibility. Historically, it "replaces" parameters instead of adding
Deprecated: use addParameter(name, value) instead of this method |
Add a default graph URI.
Deprecated: use addParameter("default-graph-uri", uri) instead of this method |
Some SPARQL endpoints require extra key value pairs. E.g., in
virtuoso, one would add
Deprecated: use addParameter(key, value) instead of this method |
Add a named graph URI.
Deprecated: use addParameter("named-graph-uri", uri) instead of this method |
Some SPARQL endpoints allow extra key value pairs. E.g., in virtuoso,
one would add
|
Clear the values ofd a concrete parameter.
|
Returns TRUE if SPARQLWrapper is configured for executing SPARQL Query request
|
Returns TRUE if SPARQLWrapper is configured for executing SPARQL Update request
|
Execute the query. Exceptions can be raised if either the URI is wrong or the HTTP sends back an error (this is also the case when the query is syntactically incorrect, leading to an HTTP error sent back by the SPARQL endpoint). The usual urllib2 exceptions are raised, which therefore cover possible SPARQL errors, too. Note that some combinations of return formats and query types may not make sense. For example, a SELECT query with Turtle response is meaningless (the output of a SELECT is not a Graph), or a CONSTRUCT query with JSON output may be a problem because, at the moment, there is no accepted JSON serialization of RDF (let alone one implemented by SPARQL endpoints). In such cases the returned media type of the result is unpredictable and may differ from one SPARQL endpoint implementation to the other. (Endpoints usually fall back to one of the "meaningful" formats, but it is up to the specific implementation to choose which one that is.)
|
Macro like method: issue a query and return the converted results.
|
Set the credentials for querying the current endpoint
|
Set the HTTP Authentication type (Basic or Digest)
|
Set the invocation method. By default, this is GET, but can be set to POST. |
Set the SPARQL query text. Note: no check is done on the validity of the query (syntax or otherwise) by this module, except for testing the query type (SELECT, ASK, etc). Syntax and validity checking is done by the SPARQL service itself.
Bug: #2320024 |
Set the internal method to use to perform the request for query or
update operations, either URL-encoded
(
|
Set the return format. If not an allowed value, the setting is ignored. |
Set the timeout (in seconds) to use for querying the endpoint.
|
Make urllib2 use keep-alive.
|
Check if a return format is supported. |
|
patternregular expression used to determine whether a query is of type CONSTRUCT, SELECT, ASK, or DESCRIBE.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Feb 14 12:30:08 2016 | http://epydoc.sourceforge.net |