File tree Expand file tree Collapse file tree
ted_sws/data_manager/adapters Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616import rdflib
1717from SPARQLWrapper import SPARQLWrapper , CSV , JSON , RDF
1818
19+ from ted_sws import config
20+
1921DEFAULT_ENCODING = 'utf-8'
2022DEFAULT_RDF_FILE_FORMAT = "n3"
2123
@@ -35,7 +37,12 @@ class SPARQLClientPool(object):
3537 @staticmethod
3638 def create_or_reuse_connection (endpoint_url : str ):
3739 if endpoint_url not in SPARQLClientPool .connection_pool :
38- SPARQLClientPool .connection_pool [endpoint_url ] = SPARQLWrapper (endpoint_url )
40+ sparql_wrapper = SPARQLWrapper (endpoint_url )
41+ sparql_wrapper .setCredentials (
42+ user = config .AGRAPH_SUPER_USER ,
43+ passwd = config .AGRAPH_SUPER_PASSWORD
44+ )
45+ SPARQLClientPool .connection_pool [endpoint_url ] = sparql_wrapper
3946 return SPARQLClientPool .connection_pool [endpoint_url ]
4047
4148
@@ -211,4 +218,4 @@ class SPARQLFileEndpoint(SPARQLStringEndpoint):
211218
212219 def __init__ (self , rdf_file_path : pathlib .Path ):
213220 rdf_content = rdf_file_path .read_text (encoding = "utf-8" )
214- super ().__init__ (rdf_content )
221+ super ().__init__ (rdf_content )
You can’t perform that action at this time.
0 commit comments