-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-classdef-nanopubs.rq
70 lines (60 loc) · 3.52 KB
/
get-classdef-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
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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 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/RAdpgRpigXtt8iPV9uOPf3wIT3qzOI8Sg2Q72CNV8g-Yo&pitemplate1=http://purl.org/np/RAOGu9Lh0BD4tbIRB9RG6RGRA_ObDh75NTbIqaWgxxs8M&piparam1_np=>
select distinct ?class_np ?class_npLabel ?class_name ?author ?authorLabel ?add_review ?add_reviewLabel ?update_np ?update_npLabel ?add_update ?add_updateLabel 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 .
}
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 )
?submitted_np np:hasAssertion ?submitted_np_a . # TODO: move into npa:graph
graph ?submitted_np_a {
?spi ?spi_pred ?class .
}
graph npa:graph { ?class_np npa:hasValidSignatureForPublicKey ?pubkey . }
?class_np np:hasAssertion ?class_np_a ; np:hasPublicationInfo ?class_np_i . # TODO: move into npa:graph
bind(replace(str(?class_np), '^.*(RA[a-zA-Z0-9-_]{4})[a-zA-Z0-9-_]{39}$', '$1') as ?class_npLabel)
graph ?class_np_a {
?class rdfs:label ?class_name .
}
graph ?class_np_i {
?class_np npx:introduces ?class .
}
bind(uri(concat(addreview:, ?class_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 ?class_np . }
bind(replace(str(?update_np), '^.*(RA[a-zA-Z0-9-_]{4})[a-zA-Z0-9-_]{39}$', '$1') as ?update_npLabel)
filter not exists {
graph npa:graph { ?retraction npa:hasValidSignatureForPublicKey ?pubkey2 . } ?retraction np:hasAssertion ?ura . # TODO: move into npa:graph
graph ?ura { ?somebody npx:retracts ?update_np . }
}
filter not exists {
graph npa:graph { ?superseding npa:hasValidSignatureForPublicKey ?pubkey2 . } ?superseding np:hasPublicationInfo ?usi . # TODO: move into npa:graph
graph ?usi { ?superseding npx:supersedes ?update_np . }
}
}
bind(if(bound(?update_np), "", uri(concat(addupdate:, ?class_np, "&supersede=", ?class_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