-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-superpattern-nanopubs.rq
72 lines (62 loc) · 4.13 KB
/
get-superpattern-nanopubs.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
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 lf: <https://w3id.org/linkflows/reviews/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix Accepted: <http://purl.org/spar/pso/accepted-for-publication>
prefix Rejected: <http://purl.org/spar/pso/rejected-for-publication>
prefix pso: <http://purl.org/spar/pso/>
prefix addreview: <http://localhost:37373/publish?template=http://purl.org/np/RAmIPyDSP2ZrKM3PaAjSOIhkbZJ0CV6lRkh3Mlv7AzFiw¶m_ReferredObject=>
prefix addupdate: <http://localhost:37373/publish?template=http://purl.org/np/RAv68imZrEjfcp2rnEg1hzoBqEVc0cQMtp9_1Za0BxNM4&pitemplate1=http://purl.org/np/RAOGu9Lh0BD4tbIRB9RG6RGRA_ObDh75NTbIqaWgxxs8M&piparam1_np=>
select distinct ?submitted_np ?submitted_npLabel ?author ?authorLabel ?add_review ?add_reviewLabel ?update_np ?update_npLabel ?add_update ?add_updateLabel ?decision_np ?decision_npLabel ?decision where {
graph npa:graph { ?submission_np npa:hasValidSignatureForPublicKey ?pubkey . }
?submission_np np:hasAssertion ?submission_np_a ; np:hasPublicationInfo ?submission_np_i . # TODO: move into npa:graph
graph ?submission_np_a {
?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-_]{4})[a-zA-Z0-9-_]{39}$', '$1') as ?submitted_npLabel)
}
graph ?submission_np_i {
?submission_np dct:creator ?__author_iri .
bind(?__author_iri as ?author)
}
filter not exists {
graph npa:graph { ?retraction npa:hasValidSignatureForPublicKey ?pubkey . } ?retraction np:hasAssertion ?sra . # TODO: move into npa:graph
graph ?sra { ?somebody npx:retracts ?submission_np . }
}
optional { ?__author_iri foaf:name ?authorLabel . }
filter( ?authorLabel != "Cristina-Iulia Bucu"^^xsd:string )
filter not exists {
graph npa:graph { ?retraction npa:hasValidSignatureForPublicKey ?pubkey . } ?retraction np:hasAssertion ?dra . # TODO: move into npa:graph
graph ?dra { ?somebody npx:retracts ?submitted_np . }
}
bind(uri(concat(addreview:, ?submitted_np)) as ?add_review)
bind('click here to add review' as ?add_reviewLabel)
optional {
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(if(bound(?update_np), "", uri(concat(addupdate:, ?submitted_np, "&fill-all=", ?submitted_np))) as ?add_update)
bind(if(bound(?update_np), "", concat(coalesce(?authorLabel, "the author"), ' can click here to update in response to the reviews')) as ?add_updateLabel)
} order by ?authorLabel