-
Notifications
You must be signed in to change notification settings - Fork 1
/
find_things.rq
45 lines (43 loc) · 1.2 KB
/
find_things.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
36
37
38
39
40
41
42
43
44
45
#+ summary: Find things introduced in nanopublications
#+ method: GET
#+ pagination: 1000
#+ endpoint_in_url: False
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix npx: <http://purl.org/nanopub/x/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix dct: <http://purl.org/dc/terms/>
select ?thing ?label ?description ?np ?date ?pubkey where {
graph npa:graph {
?np npa:hasHeadGraph ?h .
?np npa:creationDay ?__day_iri .
?np npa:creationMonth ?__month_iri .
?np npa:creationYear ?__year_iri .
?np dct:created ?date .
}
graph ?h {
?np np:hasAssertion ?a .
?np np:hasPublicationInfo ?i.
}
graph ?a {
?thing a ?_type_iri .
?thing rdfs:label ?label .
optional {
?thing rdfs:comment ?comment .
}
optional {
?thing dct:description ?dctdesc .
}
}
graph ?i {
?np (npx:introduces|npx:describes) ?thing .
}
optional {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
}
}
bind(coalesce(?comment, ?dctdesc, "") as ?description)
bind(concat(" ",lcase(str(?label))," ",lcase(str(?description))," ") as ?text)
filter( contains(?text, lcase(str(?_searchterm))) )
}