-
Notifications
You must be signed in to change notification settings - Fork 0
/
find_gofair_qualified_things.rq
120 lines (116 loc) · 3.4 KB
/
find_gofair_qualified_things.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
#+ summary: Find things (optionally of the given type) introduced in nanopubs with info about any retractions, new versions, and qualifications by GO FAIR; nanopubs that were disapproved by a GO FAIR member are not shown
#+ 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/>
select distinct ?thing ?label ?description ?np ?date ?pubkey ?retraction ?newversion ?qualifier ?qualification_np 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 ?__type_iri .
?thing rdfs:label ?label .
optional {
?thing rdfs:comment ?comment .
}
optional {
?thing dct:description ?dctdesc .
}
}
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 .
}
}
optional {
graph npa:graph {
?retraction npa:hasHeadGraph ?rh .
?retraction npa:hasValidSignatureForPublicKey ?pubkey .
}
graph ?rh {
?retraction np:hasAssertion ?ra .
}
graph ?ra {
?somebody npx:retracts ?np .
}
}
bind(coalesce(?comment, ?dctdesc, "") as ?description)
bind(concat(" ",lcase(str(?label))," ",lcase(str(?description))," ") as ?text)
filter( contains(?text, lcase(str(?_searchterm))) )
optional {
graph npa:graph {
?disapproval npa:hasHeadGraph ?dh .
?disapproval npa:hasValidSignatureForPublicKey ?dpubkey .
}
graph <https://w3id.org/np/RAkVk6aKWsmgcuKtPA7OSp2h-GbDfx8xrz_kJAAgY8Xa4#assertion> {
?dpubkeys npx:hasPublicKey ?dpubkey .
}
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 .
}
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 .
}
}
filter not exists {
graph npa:graph {
?qretraction npa:hasHeadGraph ?qrh .
?qretraction npa:hasValidSignatureForPublicKey ?qpubkey .
}
graph ?qrh {
?qretraction np:hasAssertion ?ra .
}
graph ?qra {
?qsomebody npx:retracts ?qualification_np .
}
}
}
}
order by asc(?label)