Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
145
Issues
145
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
55618541
Unverified
Commit
55618541
authored
Jan 02, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Isidore: make the sparql request using Wreq because httpS is required
parent
a785f474
Pipeline
#76
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
package.yaml
package.yaml
+1
-0
Isidore.hs
src/Gargantext/Text/Parsers/Isidore.hs
+19
-3
No files found.
package.yaml
View file @
55618541
...
...
@@ -163,6 +163,7 @@ library:
-
wai-cors
-
wai-extra
-
warp
-
wreq
-
xml-conduit
-
xml-types
-
yaml
...
...
src/Gargantext/Text/Parsers/Isidore.hs
View file @
55618541
...
...
@@ -11,13 +11,29 @@ import Database.HSparql.QueryGenerator
-- import Data.RDF hiding (triple)
import
Data.Text
hiding
(
groupBy
)
route
=
"http://isidore.science/sparql/"
import
Control.Lens
hiding
(
contains
)
import
Data.ByteString.Lazy
(
ByteString
)
import
Prelude
(
String
)
import
Network.Wreq
route
=
"https://isidore.science/sparql/"
selectQueryRaw'
::
String
->
String
->
IO
(
Response
ByteString
)
selectQueryRaw'
uri
q
=
getWith
opts
uri
where
opts
=
defaults
&
header
"Accept"
.~
[
"application/sparql-results+xml"
]
&
header
"User-Agent"
.~
[
"gargantext-hsparql-client"
]
&
param
"query"
.~
[
Data
.
Text
.
pack
q
]
--selectExample :: IO (Maybe [Text])
isidore
q
=
do
res
<-
selectQuery
route
$
simpleSelect
q
pure
res
let
s
=
createSelectQuery
$
simpleSelect
q
putStrLn
s
r
<-
selectQueryRaw'
route
s
putStrLn
$
show
$
r
^.
responseStatus
pure
$
r
^.
responseBody
-- res <- selectQuery route $ simpleSelect q
-- pure res
simpleSelect
::
Text
->
Query
SelectQuery
simpleSelect
q
=
do
...
...
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