-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-updates.rq
70 lines (57 loc) · 3.09 KB
/
get-updates.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
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix dct: <http://purl.org/dc/terms/>
prefix np: <http://www.nanopub.org/nschema#>
prefix npx: <http://purl.org/nanopub/x/>
prefix npa: <http://purl.org/nanopub/admin/>
prefix frbr: <http://purl.org/vocab/frbr/core#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix pso: <http://purl.org/spar/pso/>
prefix lf: <https://w3id.org/linkflows/reviews/>
select distinct ?node1 ?rel ?node2 where {
# SUPERPATTERN
graph ?submission_np_head {
?submission_np np:hasAssertion ?submission_np_assertion ;
np:hasPublicationInfo ?submission_np_pubinfo ;
a np:Nanopublication .
}
graph ?submission_np_assertion {
?submitted_np frbr:partOf <https://w3id.org/linkflows/formalization-papers/DataScienceSpecialIssue> ;
pso:withStatus pso:submitted .
bind(replace(str(?submitted_np), '^.*(RA[a-zA-Z0-9-_]{8})[a-zA-Z0-9-_]{35}$', '$1') as ?submitted_npLabel)
}
graph ?submission_np_pubinfo {
?submission_np dct:creator ?__author_iri .
bind(?__author_iri as ?author)
}
filter not exists {
graph npa:graph { ?newversion npa:hasValidSignatureForPublicKey ?pubkey . } ?newversion np:hasPublicationInfo ?si . # TODO: move into npa:graph
graph ?si { ?newversion npx:supersedes ?submission_np . }
}
filter not exists {
graph npa:graph { ?retraction_s npa:hasValidSignatureForPublicKey ?pubkey . } ?retraction_s np:hasAssertion ?sa . # TODO: move into npa:graph
graph ?sa { ?somebody_s npx:retracts ?submission_np . }
}
graph npa:graph { ?update_np npa:hasValidSignatureForPublicKey ?pubkey2 . } ?update_np np:hasPublicationInfo ?ui . # TODO: move into npa:graph; TODO: check pubkey
graph ?ui { ?update_np lf:isUpdateOf ?submitted_np . }
bind(replace(str(?update_np), '^.*(RA[a-zA-Z0-9-_]{4})[a-zA-Z0-9-_]{39}$', '$1') as ?update_npLabel)
optional {
graph npa:graph { ?update_retr npa:hasValidSignatureForPublicKey ?pubkey2 . } ?update_retr np:hasAssertion ?ura . # TODO: move into npa:graph
graph ?ura { ?update_retr_p npx:retracts ?update_np . }
}
filter(!bound(?update_retr))
optional { # 'filter not exists' doesn't seem to work here; not sure why...
graph npa:graph { ?superseding npa:hasValidSignatureForPublicKey ?pubkey2 . } ?superseding np:hasPublicationInfo ?usi . # TODO: move into npa:graph
graph ?usi { ?superseding npx:supersedes ?update_np . }
}
filter(!bound(?superseding))
optional {
graph npa:graph { ?decision_np npa:hasValidSignatureForPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCJlM78d80R+gFMoQB1IG3f7AbqqGOCIv4HmZd1cx1KgEWMUUpPsojFNvx84fC/TltcJ8F8JafnbhDXW2HM2MhdK4yC04ROEV1vIgSzjDicHfiqXvMqdPuMyQp4mmCEY7mUoeEW10mWZqjk+S9TnmiAQbFGcpExP8aosr2aTR7CSQIDAQAB"^^xsd:string . } ?decision_np np:hasAssertion ?da . # TODO: move into npa:graph
graph ?da {
?update_np pso:withStatus ?decision .
}
bind(replace(str(?decision_np), '^.*(RA[a-zA-Z0-9-_]{4})[a-zA-Z0-9-_]{39}$', '$1') as ?decision_npLabel)
}
bind(?update_npLabel as ?node1)
bind(concat("[fillcolor=black,URL=\"", ?update_np, "\"]") as ?rel)
bind("" as ?node2)
}