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

[TEXT][PARSERS] Isidore update query.

parent 3e1081f6
Pipeline #75 failed with stage
...@@ -9,37 +9,37 @@ import Database.HSparql.Connection ...@@ -9,37 +9,37 @@ import Database.HSparql.Connection
import Database.HSparql.QueryGenerator import Database.HSparql.QueryGenerator
-- import Data.RDF hiding (triple) -- import Data.RDF hiding (triple)
import Data.Text import Data.Text hiding (groupBy)
route = "http://isidore.science/sparql/" route = "http://isidore.science/sparql/"
--selectExample :: IO (Maybe [Text]) --selectExample :: IO (Maybe [Text])
selectIsidore = do isidore q = do
res <- selectQuery route simpleSelect res <- selectQuery route $ simpleSelect q
pure res pure res
simpleSelect :: Query SelectQuery simpleSelect :: Text -> Query SelectQuery
simpleSelect = do simpleSelect q = do
isidore <- prefix "isidore" (iriRef "http://www.rechercheisidore.fr/class") isidore <- prefix "isidore" (iriRef "http://www.rechercheisidore.fr/class")
rdf <- prefix "rdf" (iriRef "http://www.w3.org/1999/02/22-rdf-syntax-ns#") rdf <- prefix "rdf" (iriRef "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
dcterms <- prefix "dcterms" (iriRef "http://purl.org/dc/terms") dcterms <- prefix "dcterms" (iriRef "http://purl.org/dc/terms")
dc <- prefix "dc" (iriRef "http://purl.org/dc") dc <- prefix "dc" (iriRef "http://purl.org/dc")
doc <- var doc <- var
resource <- var
title <- var title <- var
date <- var date <- var
abstract <- var abstract <- var
source <- var source <- var
triple resource (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 ("ville" :: Text) filterExpr $ (.||.) (contains title q) (contains abstract q)
groupBy title
groupBy source
selectVars [title] selectVars [title, date, source, abstract]
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