-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-declarations.rq
40 lines (38 loc) · 1.67 KB
/
get-declarations.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
#+ summary: Get list of FAIR Implementation Profile 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#>
select distinct ?community ?communityLabel ?question ?questionLabel ?sort ?resource ?resourceLabel ?rel ?resourcetype ?np ?npLabel 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_iri .
bind(?__community_iri as ?community)
bind(?__resource_iri as ?resource)
filter (strstarts(str(?question), str(fip:)))
}
?community fip:has-research-domain ?__domain_iri .
bind(replace(str(?np), '^.*(RA[a-zA-Z0-9-_]{4})[a-zA-Z0-9-_]{39}$', '$1') as ?npLabel)
values ?rel {
fip:declares-current-use-of fip:declares-planned-use-of fip:declares-planned-replacement-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 (replace(str(?community), ".*#", "") as ?communityLabel)
bind (replace(str(?question), "^.*-([^-MD]+(-[MD]+)?)$", "$1") as ?questionLabel)
bind (concat(replace(?questionLabel, "F|M", "0"), "x") as ?sort)
} order by ?sort ?communityLabel