-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-communities.rq
65 lines (59 loc) · 2.09 KB
/
get-communities.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#+ summary: Get list of FAIR Implementation Communities
#+ method: GET
#+ pagination: 1000
#+ endpoint_in_url: False
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/>
prefix showdeclarations: <?api=peta-pico/fip-api&op=/get-declarations&autosubmit=on¶m_community=>
prefix showresources: <?api=peta-pico/fip-api&op=/get-resources&autosubmit=on¶m_community=>
select distinct ?community ?communityLabel ?name ?np ?npLabel ?date ?show_declarations ?show_declarationsLabel ?show_resources ?show_resourcesLabel where {
graph npa:graph {
?np npa:hasHeadGraph ?h .
?np dct:created ?date .
?np npa:hasValidSignatureForPublicKey ?pubkey .
}
graph ?h {
?np np:hasAssertion ?a .
?np np:hasPublicationInfo ?i.
}
graph ?a {
?community a fip:FAIR-Implementation-Community .
?community fip:has-research-domain ?__domain_iri .
?community rdfs:label ?name .
}
bind(replace(str(?np), '^.*(RA[a-zA-Z0-9-_]{4})[a-zA-Z0-9-_]{39}$', '$1') as ?npLabel)
bind(replace(str(?community), '^.*[#/]([^#/]+)$', '$1') as ?communityLabel)
filter not exists {
graph npa:graph {
?newversion npa:hasHeadGraph ?nh .
?newversion npa:hasValidSignatureForPublicKey ?pubkey .
}
graph ?nh {
?newversion np:hasPublicationInfo ?ni .
}
graph ?ni {
?newversion npx:supersedes ?np .
}
}
filter not exists {
graph npa:graph {
?retraction npa:hasHeadGraph ?rh .
?retraction npa:hasValidSignatureForPublicKey ?pubkey .
}
graph ?rh {
?retraction np:hasAssertion ?ra .
}
graph ?ra {
?somebody npx:retracts ?np .
}
}
bind(uri(concat(showdeclarations:, encode_for_uri(?community))) as ?show_declarations)
bind('show declarations' as ?show_declarationsLabel)
bind(uri(concat(showresources:, encode_for_uri(?community))) as ?show_resources)
bind('show resources' as ?show_resourcesLabel)
}
order by asc(?name)