Commit 747c0a60 authored by delanoe's avatar delanoe

[FEAT] bool2sparql integration.

parent 494598f9
import sparql as s
import subprocess
query = "bourdieu OR habitus"
#def bool2sparql(query, count=False, limit=None):
countCommand = ["./bool2sparql-exe","-q",query,"-c"]
getCommand = ["./bool2sparql-exe","-q",query,"-l", "100"]
process = subprocess.Popen(countCommand, stdout=subprocess.PIPE)
output, error = process.communicate()
sparqlQuery = output.decode("utf-8")
print(sparqlQuery)
c = s.Service("https://www.rechercheisidore.fr/sparql/", "utf-8", "GET")
# count:
count = []
for r in result:
(n,) = r
count.append(n.value)
#print(n.split('\"')[1])
#print(r)
print(count[0])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment