Skip to content

show_schema() throws with setReturnFormat(JSON) #1

@fskpf

Description

@fskpf

This does not work

# create a connector
connector = SPARQLWrapper("https://dbpedia.org/sparql")
connector.setReturnFormat(JSON)

# pass it to the SparqlGraphWidget
widget = SparqlGraphWidget(wrapper=connector)

widget.show_schema()

It throws

UnboundLocalError: cannot access local variable 'return_format' where it is not associated with a value

This is due to the connector.setReturnFormat(JSON). Removing it makes it work for the schema, but other queries do not work anymore then.

Can we improve this? Ideally, user's should not need to explicitly set the return format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions