Commit bb886400 authored by delanoe's avatar delanoe

[FIX] bool2sparql : accents and not query.

parent e3d2a2b0
import subprocess import subprocess
import re
from .sparql import Service from .sparql import Service
#from sparql import Service #from sparql import Service
def bool2sparql(query, count=False, offset=None, limit=None): def bool2sparql(rawQuery, count=False, offset=None, limit=None):
""" """
bool2sparql :: String -> Bool -> Int -> String bool2sparql :: String -> Bool -> Int -> String
Translate a boolean query into a Sparql request Translate a boolean query into a Sparql request
You need to build bool2sparql binaries before You need to build bool2sparql binaries before
See: https://github.com/delanoe/bool2sparql See: https://github.com/delanoe/bool2sparql
""" """
query = re.sub("\"", "\'", rawQuery)
bashCommand = ["/srv/gargantext/gargantext/util/crawlers/sparql/bool2sparql-exe","-q",query] bashCommand = ["/srv/gargantext/gargantext/util/crawlers/sparql/bool2sparql-exe","-q",query]
if count is True : if count is True :
...@@ -32,6 +32,7 @@ def bool2sparql(query, count=False, offset=None, limit=None): ...@@ -32,6 +32,7 @@ def bool2sparql(query, count=False, offset=None, limit=None):
if error is not None : if error is not None :
raise(error) raise(error)
else : else :
print(output)
return(output.decode("utf-8")) return(output.decode("utf-8"))
def isidore(query, count=False, offset=None, limit=None): def isidore(query, count=False, offset=None, limit=None):
......
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