Home | Trees | Indices | Help |
|
---|
|
object --+ | QueryResult
Wrapper around an a query result. Users should not create instances of this class, it is generated by a SPARQLWrapper.query call. The results can be converted to various formats, or used directly.
If used directly: the class gives access to the direct http request
results self.response: it is a file-like object with two
additional methods: geturl()
to return the URL of the
resource retrieved and info()
that returns the
meta-information of the HTTP result as a dictionary-like object (see the
urllib2 standard library module of Python).
For convenience, these methods are also available on the instance. The
__iter__
and next
methods are also implemented
(by mapping them to self.response). This means that the common idiom:
for l in obj : do_something_with_line(l)
would work, too.
|
|||
|
|||
string |
|
||
dict |
|
||
|
|||
|
|||
dict |
|
||
PyXlib DOM node |
|
||
RDFLib Graph
|
|
||
string |
|
||
string |
|
||
string |
|
||
RDFLib Graph |
|
||
|
|||
string |
|
||
|
|||
|
|||
|
|||
string |
|
||
Inherited from |
|
|||
string |
requestedFormat The requested format. |
||
response the direct HTTP response; a file-like object, as return by the urllib2.urlopen library call.
|
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Return the URL of the original call.
|
Return the meta-information of the HTTP result.
|
Return an iterator object. This method is expected for the inclusion
of the object in a standard |
Convert a JSON result into a Python dict. This method can be overwritten in a subclass for a different conversion method.
|
Convert an XML result into a Python dom tree. This method can be overwritten in a subclass for a different conversion method.
|
Convert a RDF/XML result into an RDFLib triple store. This method can be overwritten in a subclass for a different conversion method.
|
Convert a RDF Turtle/N3 result into a string. This method can be overwritten in a subclass for a different conversion method.
|
Convert a CSV result into a string. This method can be overwritten in a subclass for a different conversion method.
|
Convert a TSV result into a string. This method can be overwritten in a subclass for a different conversion method.
|
Convert a RDF JSON-LD result into an RDFLib triple store. This method can be overwritten in a subclass for a different conversion method.
|
Encode the return value depending on the return format:
In all other cases the input simply returned.
|
Get the response (return) format. The possible values are: JSON, XML, RDFXML,
TURTLE, N3, CSV, TSV, JSONLD. In case there is no Content-Type,
Since: 1.8.3 |
This method prints a representation of a QueryResult object that MUST has as response format JSON.
|
This method returns the string representation of a QueryResult object.
Since: 1.8.3 |
|
requestedFormatThe requested format. The possible values are: JSON, XML, RDFXML, TURTLE, N3, RDF, CSV, TSV, JSONLD.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Apr 18 09:55:02 2019 | http://epydoc.sourceforge.net |