Commit c1292008 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[TEXT][Parsers][Isidore] fix merge with local changes.

parent 55618541
Pipeline #77 failed with stage
...@@ -16,6 +16,7 @@ import Data.ByteString.Lazy (ByteString) ...@@ -16,6 +16,7 @@ import Data.ByteString.Lazy (ByteString)
import Prelude (String) import Prelude (String)
import Network.Wreq import Network.Wreq
route :: EndPoint
route = "https://isidore.science/sparql/" route = "https://isidore.science/sparql/"
selectQueryRaw' :: String -> String -> IO (Response ByteString) selectQueryRaw' :: String -> String -> IO (Response ByteString)
...@@ -25,8 +26,8 @@ selectQueryRaw' uri q = getWith opts uri ...@@ -25,8 +26,8 @@ selectQueryRaw' uri q = getWith opts uri
& header "User-Agent" .~ ["gargantext-hsparql-client"] & header "User-Agent" .~ ["gargantext-hsparql-client"]
& param "query" .~ [Data.Text.pack q] & param "query" .~ [Data.Text.pack q]
--selectExample :: IO (Maybe [Text]) isidoreGet :: Text -> IO ByteString
isidore q = do isidoreGet q = do
let s = createSelectQuery $ simpleSelect q let s = createSelectQuery $ simpleSelect q
putStrLn s putStrLn s
r <- selectQueryRaw' route s r <- selectQueryRaw' route s
...@@ -44,18 +45,18 @@ simpleSelect q = do ...@@ -44,18 +45,18 @@ simpleSelect q = do
doc <- var doc <- var
title <- var title <- var
date <- var --date <- var
abstract <- var abstract <- var
source <- var --source <- var
triple doc (rdf .:. "type") (isidore .:. "BibliographicalResource") triple_ doc (rdf .:. "type") (isidore .:. "BibliographicalResource")
triple doc (dcterms .:. "title") title triple_ doc (dcterms .:. "title") title
triple doc (dcterms .:. "date") date --triple doc (dcterms .:. "date") date
triple doc (dcterms .:. "source") source --triple doc (dcterms .:. "source") source
triple doc (dc .:. "description") abstract triple doc (dc .:. "description") abstract
filterExpr $ (.||.) (contains title q) (contains abstract q) --filterExpr $ (.||.) (contains title q) (contains abstract q)
groupBy title filterExpr_ (contains title q) -- (contains abstract q)
groupBy source limit_ 3
selectVars [title, date, source, abstract] selectVars [title]
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