-
Notifications
You must be signed in to change notification settings - Fork 0
/
find_gofair_qualified_things_x.rq
117 lines (112 loc) · 3.27 KB
/
find_gofair_qualified_things_x.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
#+ summary: Find things (optionally of the given type) introduced in nanopubs with info about qualifications by GO FAIR, excluding nanopubs that have been retracted, superseded, or disapproved (the latter only by GO FAIR members)
#+ 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 ?thing ?label ?np ?date ?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 .
}
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))
bind(concat(" ",lcase(str(?label))," ") 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)