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

[TEXT][Parsers][Isidore] working query.

parent c1292008
Pipeline #78 canceled with stage
......@@ -38,25 +38,47 @@ isidoreGet q = do
simpleSelect :: Text -> Query SelectQuery
simpleSelect q = do
isidore <- prefix "isidore" (iriRef "http://www.rechercheisidore.fr/class")
-- See Predefined Namespace Prefixes:
-- https://isidore.science/sparql?nsdecl
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")
dcterms <- prefix "dcterms" (iriRef "http://purl.org/dc/terms/")
dc <- prefix "dc" (iriRef "http://purl.org/dc/elements/1.1/")
ore <- prefix "ore" (iriRef "http://www.openarchives.org/ore/terms/")
bif <- prefix "bif" (iriRef "bif:")
doc <- var
link <- var
title <- var
--date <- var
date <- var
abstract <- var
--source <- var
authors <- var
source <- var
lang <- var
publisher <- var
agg <- var
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
indexT <- var
triple_ link (rdf .:. "type") (isidore .:. "BibliographicalResource")
triple_ link (dcterms .:. "title") title
triple_ link (dcterms .:. "date") date
triple_ link (dcterms .:. "creator") authors
triple_ link (dcterms .:. "language") lang
triple_ link (dcterms .:. "source") source
triple_ link (ore .:. "isAggregatedBy") agg
--triple_ agg (dcterms .:. "title") title
optional $ triple_ link (dcterms .:. "publisher") publisher
optional $ triple_ link (dc .:. "description") abstract
--filterExpr $ (.||.) (contains title q) (contains abstract q)
filterExpr_ (contains title q) -- (contains abstract q)
limit_ 3
selectVars [title]
--triple_ indexT (bif .:. "contains") title
--filterExpr_ (contains indexT q) -- (contains abstract q)
orderNextDesc date
limit_ 10
distinct_
selectVars [link, date, authors, source, title, lang, publisher, 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