Skip to content

SPARQLStore does not support non-XML results #785

@jpmccu

Description

@jpmccu

This is important because some SPARQL stores return IRI-based namespaces, which lxml and etree do not support. Using a JSON result type will circumvent these issues.

There are a number of issues that arise when you attempt this:

foo = SPARQLStore(..., returnFormat=SPARQLWrapper.JSON)

This causes an error because the returnFormat is also hard-coded as a parameter to the SPARQLWrapper function.

Setting the returnFormat (setReturnFormat()) after construction is insufficient because resetQuery() resets it to _defaultReturnFormat. Setting _defaultReturnFormat works for the actual wrapper, but sparqlstore.py:318 does not pass the format on to Result.parse():

    return Result.parse(res)

should be:

    return Result.parse(res, format=self.returnFormat)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions