Skip to content

Raise ValueError when user selects incopatable formats #190

@nicholascar

Description

@nicholascar

This code fails because RDF is not a valid response format for a SELECT query:

from SPARQLWrapper import SPARQLWrapper, RDF, JSON, XML
sparql = SPARQLWrapper('http://ja.dbpedia.org/sparql')
sparql.setQuery('select * where { ?x ?y ?z. } limit 1')
sparql.setReturnFormat(RDF)
results = sparql.query().convert()

The code should not fail but should raise a ValueError Exception and explain why.

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