From aff5eb9437eb3bfda5a9e0de77ba3ffca5561a4d Mon Sep 17 00:00:00 2001 From: Anthony Buonomo Date: Thu, 13 Jun 2019 12:05:24 -0400 Subject: [PATCH 1/3] add cafile option --- SPARQLWrapper/Wrapper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SPARQLWrapper/Wrapper.py b/SPARQLWrapper/Wrapper.py index 89282e2..13d03d4 100644 --- a/SPARQLWrapper/Wrapper.py +++ b/SPARQLWrapper/Wrapper.py @@ -367,7 +367,7 @@ class SPARQLWrapper(object): pattern = re.compile(r"(?P(CONSTRUCT|SELECT|ASK|DESCRIBE|INSERT|DELETE|CREATE|CLEAR|DROP|LOAD|COPY|MOVE|ADD))", re.VERBOSE | re.IGNORECASE) comments_pattern = re.compile(r"(^|\n)\s*#.*?\n") - def __init__(self, endpoint, updateEndpoint=None, returnFormat=XML, defaultGraph=None, agent=__agent__): + def __init__(self, endpoint, updateEndpoint=None, returnFormat=XML, defaultGraph=None, agent=__agent__, cafile=None): """ Class encapsulating a full SPARQL call. @param endpoint: string of the SPARQL endpoint's URI @@ -399,6 +399,7 @@ def __init__(self, endpoint, updateEndpoint=None, returnFormat=XML, defaultGraph self._defaultGraph = defaultGraph self.onlyConneg = False # Only Content Negotiation self.customHttpHeaders = {} + self.cafile = cafile if returnFormat in _allowedFormats: self._defaultReturnFormat = returnFormat @@ -888,9 +889,9 @@ def _query(self): try: if self.timeout: - response = urlopener(request, timeout=self.timeout) + response = urlopener(request, timeout=self.timeout, cafile=self.cafile) else: - response = urlopener(request) + response = urlopener(request, cafile=self.cafile) return response, self.returnFormat except urllib2.HTTPError, e: if e.code == 400: From d033a5a05db5ca796b94e776d20c82511d9aa80e Mon Sep 17 00:00:00 2001 From: Anthony Buonomo Date: Thu, 13 Jun 2019 12:06:23 -0400 Subject: [PATCH 2/3] add new location on github --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c6e958e..da2463c 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ From PyPi: From GitHub:: - $ pip install git+https://github.com/rdflib/sparqlwrapper#egg=sparqlwrapper + $ pip install git+https://github.com/abuonomo/sparqlwrapper#egg=sparqlwrapper From Debian From 2664aa23d420a8d83f64098ce43379385729cd7b Mon Sep 17 00:00:00 2001 From: Anthony Buonomo Date: Thu, 13 Jun 2019 12:10:22 -0400 Subject: [PATCH 3/3] change back to appropriate location --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index da2463c..c6e958e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ From PyPi: From GitHub:: - $ pip install git+https://github.com/abuonomo/sparqlwrapper#egg=sparqlwrapper + $ pip install git+https://github.com/rdflib/sparqlwrapper#egg=sparqlwrapper From Debian