-
Notifications
You must be signed in to change notification settings - Fork 0
/
fip_info.rq
79 lines (77 loc) · 3.56 KB
/
fip_info.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#+ summary: Get info about a particular FAIR Implementation Profile
#+ method: GET
#+ endpoint: https://query.np.trustyuri.net/repo/empty
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 ?decl_np ?question ?declares_pred ?fer ?fer_label ?fer_description where {
optional { <x:> <x:> ?_fipnp_iri }
{ select ?index_np where {
service <https://query.np.trustyuri.net/repo/type/92efd7a0ea4be4e01ec0817ccec87f975203b30addcc3166a204498ffed73b66> { # fip:FAIR-Implementation-Profile
graph npa:graph {
?_fipnp_iri npx:hasNanopubType fip:FAIR-Implementation-Profile ;
np:hasAssertion ?assertion .
}
graph ?assertion {
?fip a fip:FAIR-Implementation-Profile ;
fip:has-declaration-index ?index_np .
}
}
} }
{ select ?index_np ?decl_np where {
service <https://query.np.trustyuri.net/repo/type/18c5002de2ba489f81a45912f6e684121566cf77c9371c554bc3b6e6a58e1d09> { # npx:NanopubIndex
graph npa:graph {
?index_np np:hasAssertion ?assertion .
?index_np npx:hasNanopubType npx:NanopubIndex .
}
graph ?assertion {
?index_np npx:includesElement ?decl_np .
}
}
} }
{ select ?decl_np ?question ?declares_pred ?fer where {
service <https://query.np.trustyuri.net/repo/type/4ad845e860a6db3a69160adb7aec894e622280ff9881e41a600756ad1abcfa23> { # fip:FIP-Declaration
graph npa:graph {
?decl_np np:hasAssertion ?assertion .
?decl_np npx:hasNanopubType fip:FIP-Declaration .
}
graph ?assertion {
?subj fip:refers-to-question ?question .
values ?declares_pred { fip:declares-current-use-of fip:declares-planned-use-of fip:declares-planned-development-of fip:declares-planned-replacement-of }
?subj ?declares_pred ?fer .
}
}
} }
optional { select distinct ?fer ?fer_label_pre ?fer_description_pre where {
service <https://query.np.trustyuri.net/repo/type/3ef5b11551ebc44e34f4bca614b387204447656ce195314532769ca7b20143fe> { # fip:FAIR-Enabling-Resource
graph npa:graph {
?fer_np npa:hasValidSignatureForPublicKey ?pubkey ;
np:hasAssertion ?assertion .
filter not exists { ?fer_npx npx:invalidates ?fer_np ; npa:hasValidSignatureForPublicKey ?pubkey . }
}
graph ?assertion {
?fer rdfs:label ?fer_label_pre .
?fer rdfs:comment ?fer_description_pre .
}
}
} group by ?fer ?fer_label_pre ?fer_description_pre }
optional { select distinct ?fer (sample(?fer_label_prex) as ?fer_label_prex) (sample(?fer_description_prex) as ?fer_description_prex) where {
service <https://query.np.trustyuri.net/repo/type/3ef5b11551ebc44e34f4bca614b387204447656ce195314532769ca7b20143fe> { # fip:FAIR-Enabling-Resource
graph npa:graph {
?fer_np npa:hasValidSignatureForPublicKey ?pubkey ;
np:hasAssertion ?assertion .
}
graph ?assertion {
?fer rdfs:label ?fer_label_prex .
?fer rdfs:comment ?fer_description_prex .
}
}
} group by ?fer }
bind(coalesce(?fer_description_pre, ?fer_description_prex) as ?fer_description)
bind(coalesce(?fer_label_pre, ?fer_label_prex, replace(str(?fer), "^.*[/#]([^/#]*)$", "$1")) as ?fer_label)
bind(concat(replace(replace(str(?question), "^.*-([^-MD]+(-[MD]+)?)$", "$1"), "F|M", "0"), "x") as ?sort)
} order by ?sort