equal
deleted
inserted
replaced
75 if acronyms: |
75 if acronyms: |
76 query = query_with_acronym |
76 query = query_with_acronym |
77 else: |
77 else: |
78 query = query_without_acronym |
78 query = query_without_acronym |
79 res_dict = {} |
79 res_dict = {} |
|
80 if not uri_list: |
|
81 return res_dict |
80 # We build the filter string |
82 # We build the filter string |
81 filter_str = "" |
83 filter_str = "" |
82 for i,uri in enumerate(uri_list): |
84 for i,uri in enumerate(uri_list): |
83 res_dict[uri] = "" |
85 res_dict[uri] = "" |
84 if i==0: |
86 filter_str += (" || ?uri = <" + uri + ">") if i else ("?uri = <" + uri + ">") |
85 filter_str = "?uri = <" + uri + ">" |
87 |
86 else: |
|
87 filter_str += " || ?uri = <" + uri + ">" |
|
88 # We request the labels |
88 # We request the labels |
89 res = requests.get( |
89 res = requests.get( |
90 settings.SPARQL_QUERY_ENDPOINT, |
90 settings.SPARQL_QUERY_ENDPOINT, |
91 params={'query':query % (scheme_uri, filter_str), 'timeout':10},#, '$root' : "<"+uri+">"}, |
91 params={'query':query % (scheme_uri, filter_str), 'timeout':10},#, '$root' : "<"+uri+">"}, |
92 headers={'accept':'application/sparql-results+json'}, |
92 headers={'accept':'application/sparql-results+json'}, |