-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-resources.rq
43 lines (39 loc) · 1.73 KB
/
get-resources.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
#+ summary: Get list of resources that occur in FIP declarations
#+ method: GET
#+ pagination: 1000
#+ endpoint_in_url: False
prefix fip: <https://w3id.org/fair/fip/terms/>
prefix dct: <http://purl.org/dc/terms/>
prefix dce: <http://purl.org/dc/elements/1.1/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix np: <http://www.nanopub.org/nschema#>
prefix showdeclarations: <?api=peta-pico/fip-api&op=/get-declarations&autosubmit=on¶m_resource=>
select distinct ?resource ?resourceLabel ?resourcetype (count(distinct ?community) as ?community_count) ?show_declarations ?show_declarationsLabel where {
?np np:hasAssertion ?assertion .
graph npa:graph { ?np dct:created ?date . }
graph ?assertion {
?decl a fip:FIP-Declaration ;
fip:refers-to-question ?question ;
fip:declared-by ?__community_iri ;
?rel ?resource .
filter (strstarts(str(?question), str(fip:)))
}
bind(?__community_iri as ?community)
?community fip:has-research-domain ?__domain_iri .
bind(?__domain_iri as ?domain)
values ?rel {
fip:declares-current-use-of fip:declares-planned-use-of fip:declares-planned-replacement-of fip:declares-planned-development-of
# unofficial:
fip:declares-replacement-from fip:declares-replacement-to
}
optional {?resource rdfs:label ?resourceLabel}
optional {
values ?resourcetype { fip:Available-FAIR-Enabling-Resource fip:FAIR-Enabling-Resource-to-be-Developed }
?resource a ?resourcetype
}
bind(uri(concat(showdeclarations:, encode_for_uri(?resource))) as ?show_declarations)
bind('show declarations' as ?show_declarationsLabel)
}
group by ?resource ?resourceLabel ?resourcetype ?show_declarations ?show_declarationsLabel
order by ?resourceLabel