/
select-books-by-author.rq
36 lines (33 loc) · 1.46 KB
/
select-books-by-author.rq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Find books by a specific author
#
# The query finds books by a specific author and extracts their title and year of publication.
# Most recently published books are returned first.
PREFIX bio: <http://purl.org/vocab/bio/0.1/>
PREFIX bibo: <http://purl.org/ontology/bibo/>
PREFIX blterms: <http://www.bl.uk/schemas/bibliographic/blterms#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX event: <http://purl.org/NET/c4dm/event.owl#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX isbd: <http://iflastandards.info/ns/isbd/elements/>
PREFIX org: <http://www.w3.org/ns/org#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rda: <http://RDVocab.info/ElementsGr2/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?book ?isbn ?title ?year WHERE {
#Match all books with Lewis as an author
?book dct:creator <http://bnb.data.bl.uk/id/person/LewisCS%28CliveStaples%291898-1963>;
bibo:isbn10 ?isbn;
dct:title ?title;
#match the publication event
blterms:publication ?publication.
#match the time of the publication event
?publication event:time ?time.
#match the label of the year
?time rdfs:label ?year
}
#order by descending year, after casting year as an integer
ORDER BY DESC( xsd:int(?year) )