From 126ff0881c1721429d90888e1059f4d1a067ac70 Mon Sep 17 00:00:00 2001 From: Joern Hees Date: Wed, 30 Oct 2019 17:34:19 +0100 Subject: [PATCH] make SPARQLconnector work with DBpedia also unskips an old test on travis tha otherwise failed locally due to now unresolved SPARQLWrapper exception ref --- rdflib/plugin.py | 3 +++ test/test_sparqlstore.py | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rdflib/plugin.py b/rdflib/plugin.py index 33d6ae7a8..051b73a38 100644 --- a/rdflib/plugin.py +++ b/rdflib/plugin.py @@ -286,6 +286,9 @@ def plugins(name=None, kind=None): register( 'application/sparql-results+xml', ResultParser, 'rdflib.plugins.sparql.results.xmlresults', 'XMLResultParser') +register( + 'application/sparql-results+xml; charset=UTF-8', ResultParser, + 'rdflib.plugins.sparql.results.xmlresults', 'XMLResultParser') register( 'application/rdf+xml', ResultParser, diff --git a/test/test_sparqlstore.py b/test/test_sparqlstore.py index 2d7c1b487..26a694603 100644 --- a/test/test_sparqlstore.py +++ b/test/test_sparqlstore.py @@ -3,9 +3,8 @@ import os import unittest from nose import SkipTest +from requests import HTTPError -if os.getenv("TRAVIS"): - raise SkipTest("Doesn't work in travis") try: assert len(urlopen("http://dbpedia.org/sparql").read()) > 0 @@ -51,7 +50,7 @@ def test_noinitNs(self): { ?s a xyzzy:Concept ; xyzzy:prefLabel ?label . } LIMIT 10 """ self.assertRaises( - SPARQLWrapper.Wrapper.QueryBadFormed, + HTTPError, self.graph.query, query)