-
Notifications
You must be signed in to change notification settings - Fork 0
/
things_by_type.rq
27 lines (25 loc) · 1.07 KB
/
things_by_type.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
#+ summary: Get all things of a given type
#+ endpoint: https://query.knowledgepixels.com/repo/meta
#+ method: GET
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix dct: <http://purl.org/dc/terms/>
prefix fip: <https://w3id.org/fair/fip/terms/>
select distinct ?thing ?label (group_concat(distinct ?type; separator=" ") as ?types) ?np ?date where {
graph npa:graph {
?np npa:hasValidSignatureForPublicKey ?pubkey .
?np rdfs:label ?label .
?np npx:hasNanopubType ?type .
?np npx:hasNanopubType ?_type_iri .
?np np:hasAssertion ?a .
?np dct:created ?date . filter(str(?date) > "2022")
{ ?np npx:introduces ?thing } union { ?np npx:describes ?thing }
filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }
}
}
group by ?thing ?label ?np ?date
order by desc(?date)