Skip to content

Commit c97f1a5

Browse files
committed
change request method to POST to fix too long URLs in ubergraph requests
1 parent a8df91c commit c97f1a5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/uberongraph_tools.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
class UberonGraph():
66
def __init__(self):
77
self.sparql = SPARQLWrapper('https://ubergraph.apps.renci.org/sparql')
8+
self.sparql.setMethod('POST')
89
self.select_po = """
910
PREFIX part_of: <http://purl.obolibrary.org/obo/BFO_0000050>
1011
PREFIX UBERON: <http://purl.obolibrary.org/obo/UBERON_>
@@ -313,6 +314,8 @@ def query_uberon(self, terms, query):
313314
query = query % terms
314315
self.sparql.setReturnFormat(JSON)
315316
self.sparql.setQuery(query)
317+
318+
print(query)
316319

317320
results = self.sparql.query().convert()
318321
if results["results"]["bindings"]:
@@ -499,4 +502,4 @@ def get_annotations(self, terms):
499502
terms = "\n".join(terms)
500503
annotations = self.construct_annotation(terms)
501504

502-
return annotations
505+
return annotations

0 commit comments

Comments
 (0)