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

[TEXT][PARSERS] Isidore update query.

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