diff --git a/6.1.1 b/6.1.1 new file mode 100644 index 0000000..619ed47 --- /dev/null +++ b/6.1.1 @@ -0,0 +1,9 @@ +Collecting rdflib + Downloading rdflib-6.1.1-py3-none-any.whl (482 kB) +Requirement already satisfied: pyparsing in c:\users\anany\anaconda3\lib\site-packages (from rdflib) (3.0.4) +Collecting isodate + Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB) +Requirement already satisfied: setuptools in c:\users\anany\anaconda3\lib\site-packages (from rdflib) (58.0.4) +Requirement already satisfied: six in c:\users\anany\anaconda3\lib\site-packages (from isodate->rdflib) (1.16.0) +Installing collected packages: isodate, rdflib +Successfully installed isodate-0.6.1 rdflib-6.1.1 diff --git a/SPARQLWrapper/Wrapper.py b/SPARQLWrapper/Wrapper.py index 8464714..4587759 100644 --- a/SPARQLWrapper/Wrapper.py +++ b/SPARQLWrapper/Wrapper.py @@ -1187,7 +1187,6 @@ def _validate_format( # the unexpected N3 requested for a SELECT would return XML if "content-type" in self.info(): ct = self.info()["content-type"] # returned Content-Type value - if _content_type_in_list(ct, _SPARQL_XML): _validate_format("XML", [XML], ct, self.requestedFormat) return self._convertXML() @@ -1197,12 +1196,6 @@ def _validate_format( elif _content_type_in_list(ct, _SPARQL_JSON): _validate_format("JSON", [JSON], ct, self.requestedFormat) return self._convertJSON() - elif _content_type_in_list(ct, _RDF_XML): - #Ananya: This has to be altered - _validate_format( - "RDF/XML", [RDF, XML, RDFXML], ct, self.requestedFormat - ) - return self._convertRDF() elif _content_type_in_list(ct, _RDF_N3): _validate_format("N3", [N3, TURTLE], ct, self.requestedFormat) return self._convertN3() diff --git a/test/test_wrapper.py b/test/test_wrapper.py index a8ccccd..1f3b69b 100644 --- a/test/test_wrapper.py +++ b/test/test_wrapper.py @@ -874,10 +874,6 @@ def _mime_vs_type(mime, requested_type): self.assertEqual(0, _mime_vs_type("application/json", JSON)) self.assertEqual(0, _mime_vs_type("application/ld+json", JSONLD)) - self.assertEqual(0, _mime_vs_type("application/rdf+xml", XML)) - self.assertEqual(0, _mime_vs_type("application/rdf+xml", RDF)) - self.assertEqual(0, _mime_vs_type("application/rdf+xml", RDFXML)) - self.assertEqual(0, _mime_vs_type("text/csv", CSV)) self.assertEqual(0, _mime_vs_type("text/tab-separated-values", TSV)) self.assertEqual(0, _mime_vs_type("application/xml", XML)) @@ -896,6 +892,11 @@ def _mime_vs_type(mime, requested_type): self.assertEqual(1, _mime_vs_type("application/ld+json", N3)) # Warning self.assertEqual(1, _mime_vs_type("application/rdf+xml", JSON)) # Warning self.assertEqual(1, _mime_vs_type("application/rdf+xml", N3)) # Warning + self.assertEqual(1, _mime_vs_type("application/rdf+xml", XML)) # Warning + self.assertEqual(1, _mime_vs_type("application/rdf+xml", RDFXML)) # Warning + + #Invalid return format, RDF (issue 190) + self.assertEqual(1, _mime_vs_type("application/rdf+xml", RDF)) def testPrint_results(self): """