I'm trying to make a query to get the predicate or the relation between 2 entities already exist in Arabic DBpedia... I'm trying to do that in Python using the SPARQL Endpoint interface to Python (SPARQLWrapper), so I set the Data Set Name, with the query like that:
sparql = SPARQLWrapper("http://ar.dbpedia.org/sparql")
sparql.setReturnFormat(JSON)
property = []
query = "SELECT ?property WHERE {{ <{}> ?property <{}> }}".format('http://ar.dbpedia.org/resource/فرنسا', 'http://ar.dbpedia.org/resource/باريس')
sparql.setQuery(query)
string_s = sparql.query().convert()
if len(string_s['results']['bindings']) != 0:
bindings = string_s['results']['bindings']
for b in bindings:
property.append(b['property']['value'])
print(property)
The problem is when I specified the Data set name as (http://ar.dbpedia.org/sparql), it gave me an error in connection like that:
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
And when I change it to the Default one (http://dbpedia.org/sparql), it gives me no relation between the 2 entities (and I guess this is because I am making a request on the data set that's not having the two entities!), I test the previous code on English resources by changing the data set name to the default one, and changing the query to this:
query = "SELECT ?property WHERE {{ <{}> ?property <{}> }}".format('http://dbpedia.org/resource/France', 'http://dbpedia.org/resource/Paris')
it worked and gave me the (?property) like this:
['http://dbpedia.org/ontology/wikiPageWikiLink', 'http://dbpedia.org/ontology/capital']
So my question is, How could I do the same request and get the same answer on the Arabic DBpedia? How can I inquire about the property that links between the 2 Arabic resources (Arabic entities) that already exist in Arabic DBpedia?