diff --git a/tdd/common.py b/tdd/common.py index c4b6ef5..63a4356 100644 --- a/tdd/common.py +++ b/tdd/common.py @@ -56,14 +56,11 @@ def json_ld_to_ntriples(ld_content): input_data = json.dumps(ld_content) + "\n" with resources.path("tdd.lib", "transform-to-nt.js") as transform_lib_path: p = subprocess.Popen( - [ - "node", - transform_lib_path - ], + ["node", transform_lib_path], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=True + universal_newlines=True, ) p.stdin.write(input_data) p.stdin.flush() @@ -111,14 +108,11 @@ def frame_nt_content(nt_content, frame): input_data = json.dumps([ntriples, frame]) + "\n" with resources.path("tdd.lib", "frame-jsonld.js") as frame_lib_path: p = subprocess.Popen( - [ - "node", - frame_lib_path - ], + ["node", frame_lib_path], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=True + universal_newlines=True, ) p.stdin.write(input_data) p.stdin.flush() @@ -136,6 +130,6 @@ def get_id_description(uri, content_type, ontology): if not resp.text.strip() or not ( re.search(r"^[^\#]", resp.text, re.MULTILINE) ): # because some SPARQL endpoint may send "# Empty file" as response - #raise IDNotFound() + # raise IDNotFound() abort(404) return resp.text diff --git a/tdd/sparql.py b/tdd/sparql.py index 2945142..934a5e0 100644 --- a/tdd/sparql.py +++ b/tdd/sparql.py @@ -212,7 +212,7 @@ def query( sparqlendpoint, data={"update": querystring}, ) - + if resp.status_code not in status_codes: raise FusekiError(resp) return resp