-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGeneral Queries
49 lines (36 loc) · 1.79 KB
/
General Queries
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#Keyword search for "place" return any pictorial record with an image.
PREFIX ecrm:<http://erlangen-crm.org/current#>
PREFIX am: <http://rdf.aucklandmuseum.com/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT * WHERE {
?subject dc:title/rdf:value ?title. #select the value in the title field for searching.
FILTER(REGEX(?title, "parnell", "i")) #within the title look for the word "parnell", the "i" = case insensitive
?subject ecrm:P50_has_current_keeper/rdf:value "photographs". #searches the photography department
?subject ecrm:P138_has_representation ?photo. #only show records with images.
}
Show all objects on display ordered by gallery
PREFIX ecrm:<http://erlangen-crm.org/current#>
PREFIX am: <http://rdf.aucklandmuseum.com/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT * WHERE {
?subject am:onDisplayFlag ?display. #is item on display
?subject am:nameTitle/rdf:value ?title. #what is title of object
?subject ecrm:P50_has_current_keeper/rdf:value ?dept. # what is department of object
}
ORDER BY ?display ?dept
Accession date by year.
PREFIX am: <http://collections.aucklandmuseum.com/ontology/core/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?year (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a am:accessionDateEarliest ?date.
BIND(year(?date) AS ?year)
} GROUP BY ?year ORDER BY ?year
Field Collection By Date
PREFIX am: <http://collections.aucklandmuseum.com/ontology/core/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX ecrm: <http://erlangen-crm.org/current/>
SELECT ?year (COUNT (DISTINCT ?a) AS ?count) WHERE {
?a ecrm:P24i_changed_ownership_through/ecrm:P4_has_time_span/am:fieldCollectionDateEarliest ?date.
BIND(year(?date) AS ?year)
} GROUP BY ?year ORDER BY ?year