Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
bb886400
Commit
bb886400
authored
Jun 09, 2017
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] bool2sparql : accents and not query.
parent
e3d2a2b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
bool2sparql-exe
gargantext/util/crawlers/sparql/bool2sparql-exe
+0
-0
bool2sparql.py
gargantext/util/crawlers/sparql/bool2sparql.py
+4
-3
No files found.
gargantext/util/crawlers/sparql/bool2sparql-exe
View file @
bb886400
No preview for this file type
gargantext/util/crawlers/sparql/bool2sparql.py
View file @
bb886400
import
subprocess
import
subprocess
import
re
from
.sparql
import
Service
from
.sparql
import
Service
#from sparql import Service
#from sparql import Service
def
bool2sparql
(
q
uery
,
count
=
False
,
offset
=
None
,
limit
=
None
):
def
bool2sparql
(
rawQ
uery
,
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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment