-
Notifications
You must be signed in to change notification settings - Fork 0
/
list_nonqualified_fsr.rq
138 lines (132 loc) · 4.24 KB
/
list_nonqualified_fsr.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#+ summary: List non-qualified FAIR Enabling/Supporting Resources
#+ method: GET
#+ pagination: 10000
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select distinct ?np ?label (group_concat(distinct ?typelabel; separator = ", ") as ?types) ?date where {
graph npa:graph {
?np npa:hasHeadGraph ?h .
?np dct:created ?date .
filter(str(?date) > "2022")
?np npa:hasValidSignatureForPublicKey ?pubkey .
}
graph ?h {
?np np:hasAssertion ?a .
?np np:hasPublicationInfo ?i.
}
graph ?a {
?thing a ?maintype .
values ?maintype { <https://w3id.org/fair/fip/terms/FAIR-Supporting-Resource> <https://w3id.org/fair/fip/terms/FAIR-Enabling-Resource> <https://w3id.org/fair/fip/terms/Available-FAIR-Supporting-Resource> <https://w3id.org/fair/fip/terms/Available-FAIR-Enabling-Resource> } .
?thing a ?type .
filter( ?type != <https://w3id.org/fair/fip/terms/FAIR-Supporting-Resource> )
filter( ?type != <https://w3id.org/fair/fip/terms/Available-FAIR-Supporting-Resource> )
filter( ?type != <https://w3id.org/fair/fip/terms/FAIR-Supporting-Resource-to-be-Developed> )
filter( ?type != <https://w3id.org/fair/fip/terms/FAIR-Enabling-Resource> )
filter( ?type != <https://w3id.org/fair/fip/terms/Available-FAIR-Enabling-Resource> )
filter( ?type != <https://w3id.org/fair/fip/terms/FAIR-Enabling-Resource-to-be-Developed> )
bind(replace(str(?type), '^.*/([^/]+)$', '$1') as ?typelabel)
?thing rdfs:label ?labelx .
bind(str(?labelx) as ?label)
}
graph ?i {
?np (npx:introduces|npx:describes) ?thing .
}
optional {
graph npa:graph {
?newversion npa:hasHeadGraph ?nh .
?newversion npa:hasValidSignatureForPublicKey ?pubkey .
}
graph ?nh {
?newversion np:hasPublicationInfo ?ni .
}
graph ?ni {
?newversion npx:supersedes ?np .
}
}
filter (!bound(?newversion))
optional {
graph npa:graph {
?retraction npa:hasHeadGraph ?rh .
?retraction npa:hasValidSignatureForPublicKey ?pubkey .
}
graph ?rh {
?retraction np:hasAssertion ?ra .
}
graph ?ra {
?somebody npx:retracts ?np .
}
}
filter (!bound(?retraction))
optional {
graph npa:graph {
?disapproval npa:hasHeadGraph ?dh .
?disapproval npa:hasValidSignatureForPublicKey ?dpubkey .
}
graph <https://w3id.org/np/RAkVk6aKWsmgcuKtPA7OSp2h-GbDfx8xrz_kJAAgY8Xa4#assertion> {
?qpubkeys npx:hasPublicKey ?qpubkey .
}
graph ?dh {
?disapproval np:hasAssertion ?da .
}
graph ?da {
?dsomebody ( npx:disapproves-of | npx:disapprovesOf ) ?np .
}
}
filter (!bound(?disapproval)) # No idea why "filter not exists" above doesn't work...
optional {
graph npa:graph {
?qualification_np npa:hasHeadGraph ?qh .
?qualification_np npa:hasValidSignatureForPublicKey ?qpubkey .
}
graph <https://w3id.org/np/RAkVk6aKWsmgcuKtPA7OSp2h-GbDfx8xrz_kJAAgY8Xa4#assertion> {
?qpubkeys npx:hasPublicKey ?qpubkey .
}
graph ?qh {
?qualification_np np:hasAssertion ?qa .
}
graph ?qa {
?qualifier npx:qualifies ?np_q .
}
filter not exists {
graph npa:graph {
?qnewversion npa:hasHeadGraph ?qnh .
?qnewversion npa:hasValidSignatureForPublicKey ?qpubkey .
}
graph ?qnh {
?qnewversion np:hasPublicationInfo ?qni .
}
graph ?qni {
?qnewversion npx:supersedes ?qualification_np .
}
}
optional {
graph npa:graph {
?qretraction npa:hasHeadGraph ?qrh .
?qretraction npa:hasValidSignatureForPublicKey ?qpubkey .
}
graph ?qrh {
?qretraction np:hasAssertion ?ra .
}
graph ?qra {
?qsomebody npx:retracts ?qualification_np .
}
}
filter (!bound(?qretraction))
graph npa:graph {
?np_q npa:hasHeadGraph ?h_q .
}
graph ?h_q {
?np_q np:hasPublicationInfo ?i_q.
}
graph ?i_q {
?np_q (npx:introduces|npx:describes) ?thing .
}
}
filter (!bound(?qualification_np))
}
group by ?np ?label ?date
order by desc(?date)