Matches in Nanopublications for { ?s <https://w3id.org/kpxl/grlc/sparql> ?o ?g. }
- get-latest-nanopubs-from-pubkeys sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?service) service ?service { graph npa:graph { ?np rdfs:label ?label ; npa:hasValidSignatureForPublicKey ?pubkey ; dct:created ?date . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?_pubkeyhashes, sha256(str(?pubkeyx)))) } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-pubkeys sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?service) service ?service { graph npa:graph { ?np rdfs:label ?label ; npa:hasValidSignatureForPublicKey ?pubkey ; dct:created ?date . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?_pubkeyhashes, sha256(str(?pubkeyx)))) } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-pubkeys sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?_pubkeyhashes, sha256(str(?pubkeyx)))) } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-most-recent-nanopubs sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . optional { ?np rdfs:label ?label . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } order by desc(?date) limit 10" assertion.
- get-latest-accepted sparql "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 oa: <http://www.w3.org/ns/oa#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix pav: <http://purl.org/pav/> prefix bibo: <http://purl.org/ontology/bibo/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?np ?label ?npType ?mainAuthor ?authorEtAl ?timestamp ?date where { values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select distinct ?np ?label (coalesce(?firstAuthor, min(?author), min(?creator)) as ?mainAuthor) (if(if(count(distinct ?author)>0, count(distinct ?author), count(distinct ?creator)) > 1, " et al.", "") as ?authorEtAl) ?timestamp (substr(str(?timestamp), 0, 11) as ?date) where { graph npa:graph { ?np dct:created ?timestamp . ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np rdfs:label ?label . ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } optional { graph ?i { ?np pav:authoredBy ?author . } } optional { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?author . filter(strstarts(str(?hasElement), str(rdf:_))) } } optional { graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } } group by ?np ?label ?timestamp } } order by desc(?timestamp) limit 10" assertion.
- get-latest-accepted sparql "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 oa: <http://www.w3.org/ns/oa#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix pav: <http://purl.org/pav/> prefix bibo: <http://purl.org/ontology/bibo/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?np ?label ?npType ?mainAuthor ?authorEtAl ?timestamp ?date where { values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select distinct ?np ?label (coalesce(?firstAuthor, min(?author), min(?creator)) as ?mainAuthor) (if(if(count(distinct ?author)>0, count(distinct ?author), count(distinct ?creator)) > 1, " et al.", "") as ?authorEtAl) ?timestamp (substr(str(?timestamp), 0, 11) as ?date) where { graph npa:graph { ?np dct:created ?timestamp . ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np rdfs:label ?label . ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } optional { graph ?i { ?np pav:authoredBy ?author . } } optional { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?author . filter(strstarts(str(?hasElement), str(rdf:_))) } } optional { graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } } group by ?np ?label ?timestamp } } order by desc(?timestamp) limit 10" assertion.
- get-top-creators-last30d sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix foaf: <http://xmlns.com/foaf/0.1/> select distinct ?userid (count(distinct ?np) as ?count) where { { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?userid . } } union { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasAssertion ?assertion . ?np np:hasProvenance ?prov . } graph ?prov { ?assertion prov:wasAttributedTo ?userid . } } filter(strstarts(str(?userid), "https://orcid.org/")) } group by ?userid order by desc(?count) limit 10" assertion.
- get-top-templates-last30d sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix xsd: <http://www.w3.org/2001/XMLSchema#> prefix dct: <http://purl.org/dc/terms/> select distinct ?template (count(distinct ?np) as ?count) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . } graph ?i { ?np nt:wasCreatedFromTemplate ?template . } } group by ?template order by desc(?count) limit 10" assertion.
- get-accepted-nanopubs-by-author sparql "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#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?np ?label ?npType ?timestamp where { values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select distinct ?np ?label ?timestamp where { graph npa:graph { ?np dct:created ?timestamp . ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np rdfs:label ?label . ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_author_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } group by ?np ?label ?timestamp } } order by desc(?timestamp)" assertion.
- subj-refs sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?pred ?obj ?date ?creator where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?creator . ?np np:hasAssertion ?assertion . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?_subj_iri ?pred ?obj . } } order by desc(?date)" assertion.
- query sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?pred ?obj ?date ?creator where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?creator . ?np np:hasAssertion ?assertion . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?_subj_iri ?pred ?obj . } } order by desc(?date)" assertion.
- subj-refs sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix tpff: <https://w3id.org/fair/3pff/> select ?event ?eventName ?eventDate ?npDate ?np where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?npDate . ?np dct:creator ?creator . ?np np:hasAssertion ?assertion . ?np npx:introduces ?event . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?event a tpff:3PFF-event . ?event rdfs:label ?eventName . ?event dct:date ?eventDate . } } order by desc(?eventDate)" assertion.
- get-3pff-events sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix tpff: <https://w3id.org/fair/3pff/> select ?event ?eventName ?eventDate ?npDate ?np where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?npDate . ?np dct:creator ?creator . ?np np:hasAssertion ?assertion . ?np npx:introduces ?event . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?event a tpff:3PFF-event . ?event rdfs:label ?eventName . ?event dct:date ?eventDate . } } order by desc(?eventDate)" assertion.
- get-field-value-annotations sparql "prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 foaf: <http://xmlns.com/foaf/0.1/> prefix oa: <http://www.w3.org/ns/oa#> select ?target_source ?field ?value ?np ?user ?pubkey where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?a { ?ann a oa:Annotation . ?ann oa:hasTarget ?target . ?target oa:hasSource ?target_source . ?target oa:hasSelector ?selector . ?selector a <http://example.org/FieldValueSelector> . ?selector <http://example.org/hasField> ?field . ?ann oa:hasBody ?body . ?body rdf:value ?value . } graph ?i { optional { ?sig npx:hasSignatureTarget ?np . ?sig npx:signedBy ?user . } } } order by desc(?date)" assertion.
- get-field-value-annotations sparql "prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 foaf: <http://xmlns.com/foaf/0.1/> prefix oa: <http://www.w3.org/ns/oa#> select ?target_source ?field ?value ?np ?user where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?a { ?ann a oa:Annotation . ?ann oa:hasTarget ?target . ?target oa:hasSource ?target_source . ?target oa:hasSelector ?selector . ?selector a <http://example.org/FieldValueSelector> . ?selector <http://example.org/hasField> ?field . ?ann oa:hasBody ?body . ?body rdf:value ?value . } graph ?i { optional { ?sig npx:hasSignatureTarget ?np . ?sig npx:signedBy ?user . } } } order by desc(?date)" assertion.
- query sparql "prefix dbo: <http://dbpedia.org/ontology/> prefix dbp: <http://dbpedia.org/property/> prefix schema: <http://schema.org/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?band ?album where { ?band rdf:type dbo:Band . ?album rdf:type schema:MusicAlbum . ?band dbo:genre ?__genre_iri . ?album dbp:artist ?band . } limit 100" assertion.
- get-user-stats sparql "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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { optional { <x:> <x:> ?_pubkeyhashes } # ensure grlc is picking up the placeholder #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?service) service ?service { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?_pubkeyhashes, sha256(str(?pubkeyx)))) } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) optional { <x:> <x:> ?_userid_iri } # ensure grlc is picking up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-top-creators-last30d sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix foaf: <http://xmlns.com/foaf/0.1/> select distinct ?userid (count(distinct ?np) as ?count) where { { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?userid . } } union { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasAssertion ?assertion . ?np np:hasProvenance ?prov . } graph ?prov { ?assertion prov:wasAttributedTo ?userid . } } filter(?userid != <https://orcid.org/1234-1234-1234-1234>) filter(?userid != <https://orcid.org/0000-0000-0000-0000>) } group by ?userid order by desc(?count) limit 10" assertion.
- get-latest-nanopubs-from-pubkeys sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?__pubkeyhashes as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?_userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?_pubkeyhashes, sha256(str(?pubkeyx)))) } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-pubkeys sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?__pubkeyhashes as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?_userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?__pubkeyhashes, sha256(str(?pubkeyx)))) } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-pubkeys sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?__pubkeyhashes as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?__userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?__pubkeyhashes, sha256(str(?pubkeyx)))) } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-pubkeys-userid sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?__pubkeyhashes as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?__userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?__pubkeyhashes, sha256(str(?pubkeyx)))) } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-pubkeys-userid sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(if(?__pubkeyhashes = "", ?unbound, ?__pubkeyhashes) as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?__userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?__pubkeyhashes, sha256(str(?pubkeyx)))) } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-pubkeys-userid sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(if(?__pubkeyhashes = "", ?unbound, ?__pubkeyhashes) as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?__userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-user-stats sparql "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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { optional { <x:> <x:> ?_pubkeyhashes } # ensure grlc is picking up the placeholder #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?service) service ?service { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?_pubkeyhashes, sha256(str(?pubkeyx)))) } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) optional { <x:> <x:> ?_userid_iri } # ensure grlc is picking up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key 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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(if(?__pubkeyhashes = "", ?unbound, ?__pubkeyhashes) as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?_userid_iri . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) optional { <x:> <x:> ?_userid_iri } # ensure grlc is picking up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-user-stats sparql "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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(if(?__pubkeyhashes = "", ?unbound, ?__pubkeyhashes) as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?_userid_iri . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) optional { <x:> <x:> ?_userid_iri } # ensure grlc is picking up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-3pff-events sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix tpff: <https://w3id.org/fair/3pff/> select ?event ?eventSeries ?eventName ?eventShortName ?eventLongName ?eventType ?eventTypeName ?eventDate ?eventOrganizer ?eventOrganizerLabel ?eventFacilitator ?eventFacilitatorLabel ?eventMoreInfoLink ?eventMoreInfoLinkLabel ?np ?npCreator ?npDate where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?npDate . ?np dct:creator ?npCreator . ?np np:hasAssertion ?assertion . ?np npx:introduces ?event . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?event a tpff:3PFF-event . ?event rdfs:label ?eventName . bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName) bind(replace(str(?eventName), '^([A-Z0-9]{2,3}).*$', '$1') as ?eventSeries) bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName) ?event dct:date ?eventDate . optional { ?event tpff:has-event-organizer ?eventOrganizer . bind(replace(str(?eventOrganizer), '^.*[/#]([^#/\\?]+)[#/]?(\\?.*)?$', '$1') as ?eventOrganizerLabel) } optional { ?event tpff:has-event-facilitator ?eventFacilitator . bind(replace(str(?eventFacilitator), '^.*[/#]([^#/\\?]+)[#/]?(\\?.*)?$', '$1') as ?eventFacilitatorLabel) } optional { values ?eventType { tpff:In-Person-Event tpff:Hybrid-Event tpff:Virtual-Event } ?event a ?eventType . bind(replace(str(?eventType), '^.*/', '') as ?eventTypeName) } optional { ?event rdfs:seeAlso ?eventMoreInfoLink . bind(replace(str(?eventMoreInfoLink), '^.*[/#]([^#/\\?]+)[#/]?(\\?.*)?$', '$1') as ?eventMoreInfoLinkLabel) } } } order by ?eventSeries desc(?eventDate)" assertion.
- find-uri-references sparql "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 ?np ?graphpred ?subj ?pred ?obj ?date ?pubkey where { graph ?g { { { bind(?_ref_iri as ?subj) } union { bind(?_ref_iri as ?pred) } union { bind(?_ref_iri as ?obj) } } ?subj ?pred ?obj . } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . ?np ?__graphpred_iri ?g . bind(?__graphpred_iri as ?graphpred) values ?graphpred { np:hasAssertion np:hasProvenance np:hasPublicationInfo } } } limit 100" assertion.
- find-uri-references sparql "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 ?np ?graphpred ?subj ?pred ?obj ?date ?pubkey where { graph ?g { { { bind(?_ref_iri as ?subj) } union { bind(?_ref_iri as ?pred) } union { bind(?_ref_iri as ?obj) } } ?subj ?pred ?obj . } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?__pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkey . } bind(?__pubkey as ?pubkey) ?np dct:created ?date . ?np ?__graphpred_iri ?g . bind(?__graphpred_iri as ?graphpred) values ?graphpred { np:hasAssertion np:hasProvenance np:hasPublicationInfo } } } limit 1000" assertion.
- find-uri-references sparql "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 ?np ?graphpred ?subj ?pred ?obj ?date ?pubkey where { graph ?g { { { bind(?_ref_iri as ?subj) } union { bind(?_ref_iri as ?pred) } union { bind(?_ref_iri as ?obj) } } ?subj ?pred ?obj . } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?__pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkey . } bind(?__pubkey as ?pubkey) ?np dct:created ?date . ?np ?__graphpred_iri ?g . bind(?__graphpred_iri as ?graphpred) values ?graphpred { np:hasAssertion np:hasProvenance np:hasPublicationInfo } } } limit 100" assertion.
- find-uri-references sparql "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 ?np ?graphpred ?subj ?pred ?obj ?date (?__pubkey as ?pubkey) where { graph ?g { { { bind(?_ref_iri as ?subj) } union { bind(?_ref_iri as ?pred) } union { bind(?_ref_iri as ?obj) } } ?subj ?pred ?obj . } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?__pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkey . } ?np dct:created ?date . ?np ?__graphpred_iri ?g . bind(?__graphpred_iri as ?graphpred) values ?graphpred { np:hasAssertion np:hasProvenance np:hasPublicationInfo } } } limit 1000" assertion.
- find-uri-references sparql "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 ?np (?__graphpred_iri as ?graphpred) ?subj ?pred ?obj ?date (?__pubkey as ?pubkey) where { graph ?g { { { bind(?_ref_iri as ?subj) } union { bind(?_ref_iri as ?pred) } union { bind(?_ref_iri as ?obj) } } ?subj ?pred ?obj . } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?__pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkey . } ?np dct:created ?date . ?np ?__graphpred_iri ?g . values ?graphpred { np:hasAssertion np:hasProvenance np:hasPublicationInfo } } } limit 100" assertion.
- find-uri-references sparql "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 ?np (?__graphpred_iri as ?graphpred) ?subj ?pred ?obj ?date (?__pubkey as ?pubkey) where { graph ?g { { { bind(?_ref_iri as ?subj) } union { bind(?_ref_iri as ?pred) } union { bind(?_ref_iri as ?obj) } } ?subj ?pred ?obj . } graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?__pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkey . } ?np dct:created ?date . ?np ?__graphpred_iri ?g . values ?__graphpred_iri { np:hasAssertion np:hasProvenance np:hasPublicationInfo } } } limit 100" assertion.
- get-latest-accepted-bdj sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix bibo: <http://purl.org/ontology/bibo/> select ?np ?label ?firstAuthor ?date where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } order by desc(?date) limit 100" assertion.
- get-latest-accepted-ds sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix bibo: <http://purl.org/ontology/bibo/> select ?np ?label ?firstAuthor ?date where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } order by desc(?date) limit 100" assertion.
- get-latest-ds-candidates sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 biolink: <https://w3id.org/biolink/vocab/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix biodiv: <https://w3id.org/kpxl/biodiv/terms/> prefix prov: <http://www.w3.org/ns/prov#> select distinct ?np ?label ?pubkey ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np rdfs:label ?label . values ?type { <https://w3id.org/kpxl/rel/terms/hasRelationTo> <https://w3id.org/kpxl/rel/terms/tendsToHaveRelationTo> <https://w3id.org/linkflows/superpattern/terms/SuperPatternInstance> <http://purl.org/petapico/o/hycl#AIDA-Sentence> <https://w3id.org/biolink/vocab/related_to> <http://www.w3.org/ns/mls#Run> } ?np npx:hasNanopubType ?type . ?np dct:creator ?__creator_iri . ?np dct:created ?date . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } } order by desc(?date)" assertion.
- get-ds-reactions sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 biolink: <https://w3id.org/biolink/vocab/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix biodiv: <https://w3id.org/kpxl/biodiv/terms/> prefix prov: <http://www.w3.org/ns/prov#> select distinct ?np ?label ?comment ?ref_np ?pubkey ?date where { graph npa:graph { ?ref_np npa:hasValidSignatureForPublicKey ?ref_pubkey . values ?ref_type { <https://w3id.org/kpxl/rel/terms/hasRelationTo> <https://w3id.org/kpxl/rel/terms/tendsToHaveRelationTo> <https://w3id.org/linkflows/superpattern/terms/SuperPatternInstance> <http://purl.org/petapico/o/hycl#AIDA-Sentence> <https://w3id.org/biolink/vocab/related_to> <http://www.w3.org/ns/mls#Run> } ?ref_np npx:hasNanopubType ?ref_type . filter not exists { ?ref_np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?ref_npx npx:invalidates ?ref_np ; npa:hasValidSignatureForPublicKey ?ref_pubkey . } graph npa:networkGraph { ?np npa:refersToNanopub ?ref_np . } ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np npx:hasNanopubType <http://purl.org/spar/cito/cites> . ?np rdfs:label ?label . ?np dct:created ?date . service <https://query.knowledgepixels.com/repo/type/2c1cce3f3152738c1009d59251409392aaaa3b0324bcb5fdfb4b7b944b8f0c18> { select ?np ?comment where { graph npa:graph { ?np np:hasAssertion ?a . } graph ?a { ?a rdfs:comment ?comment . } } } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } } order by desc(?date)" assertion.
- get-latest-rio-candidates sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 biolink: <https://w3id.org/biolink/vocab/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix biodiv: <https://w3id.org/kpxl/biodiv/terms/> prefix prov: <http://www.w3.org/ns/prov#> select distinct ?np ?label ?pubkey ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np rdfs:label ?label . values ?type { <https://w3id.org/kpxl/rel/terms/hasRelationTo> <https://w3id.org/kpxl/rel/terms/tendsToHaveRelationTo> <https://w3id.org/linkflows/superpattern/terms/SuperPatternInstance> <http://purl.org/petapico/o/hycl#AIDA-Sentence> <https://w3id.org/biolink/vocab/related_to> <http://www.w3.org/2004/02/skos/core#relatedMatch> } ?np npx:hasNanopubType ?type . ?np dct:creator ?__creator_iri . ?np dct:created ?date . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } } order by desc(?date)" assertion.
- get-nanopubs-by-type sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> select ?np ?label ?pubkey ?date where { graph npa:graph { ?np npx:hasNanopubType ?_type_iri . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } optional { ?np rdfs:label ?label . } ?np dct:created ?date . } }" assertion.
- get-introducing-nanopub sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> select ?np ?label ?pubkey ?date where { graph npa:graph { ?np npx:introduces ?_thing_iri . ?np npa:hasValidSignatureForPublicKey ?pubkey . optional { ?np rdfs:label ?label . } ?np dct:created ?date . } }" assertion.
- fulltext-search-on-labels sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select ?np ?label ?date where { graph npa:graph { ?np rdfs:label ?label . ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } ?np search:matches [ search:query ?_query ; search:property rdfs:label ; search:score ?score ; search:snippet ?snippet ] . } limit 100" assertion.
- fulltext-search-on-labels sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select ?np ?label ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?__pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?__pubkey . } optional { ?np rdfs:label ?label . } ?np dct:created ?date . } ?np search:matches [ search:query ?_query ; search:property rdfs:label ; search:score ?score ; search:snippet ?snippet ] . } limit 100" assertion.
- find-things sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select ?thing ?label ?description ?np ?pubkey ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . ?np npx:introduces|npx:describes ?thing . ?np rdfs:label ?label . optional { ?np dct:description ?description . } ?np np:hasAssertion ?a . } ?np search:matches [ search:query ?_query ; search:property rdfs:label ; search:score ?score ; search:snippet ?snippet ] . } limit 100" assertion.
- find-things sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select ?thing ?label ?description ?np ?pubkey ?date where { graph npa:graph { ?np npx:hasNanopubType ?__type_iri . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . ?np npx:introduces|npx:describes ?thing . ?np rdfs:label ?label . optional { ?np dct:description ?description . } ?np np:hasAssertion ?a . } ?np search:matches [ search:query ?_query ; search:property rdfs:label ; search:score ?score ; search:snippet ?snippet ] . } limit 100" assertion.
- get-3pff-events sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix tpff: <https://w3id.org/fair/3pff/> select ?event ?eventSeries ?eventName ?eventShortName ?eventLongName ?eventType ?eventTypeName ?eventDate ?eventOrganizer ?eventOrganizerLabel (group_concat(?eventFacilitator; separator=" ") as ?eventFacilitators) (group_concat(?eventFacilitatorLabel; separator=" ") as ?eventFacilitatorLabels) ?eventMoreInfoLink ?eventMoreInfoLinkLabel ?np ?npCreator ?npDate where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?npDate . ?np dct:creator ?npCreator . ?np np:hasAssertion ?assertion . ?np npx:introduces ?event . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?event a tpff:3PFF-event . ?event rdfs:label ?eventName . bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName) bind(replace(str(?eventName), '^([A-Z0-9]{2,3}).*$', '$1') as ?eventSeries) bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName) ?event dct:date ?eventDate . optional { ?event tpff:has-event-organizer ?eventOrganizer . bind(replace(str(?eventOrganizer), '^.*[/#]([^#/\\?]+)[#/]?(\\?.*)?$', '$1') as ?eventOrganizerLabel) } optional { ?event tpff:has-event-facilitator ?eventFacilitator . bind(replace(str(?eventFacilitator), '^.*[/#]([^#/\\?]+)[#/]?(\\?.*)?$', '$1') as ?eventFacilitatorLabel) } optional { values ?eventType { tpff:In-Person-Event tpff:Hybrid-Event tpff:Virtual-Event } ?event a ?eventType . bind(replace(str(?eventType), '^.*/', '') as ?eventTypeName) } optional { ?event rdfs:seeAlso ?eventMoreInfoLink . bind(replace(str(?eventMoreInfoLink), '^.*[/#]([^#/\\?]+)[#/]?(\\?.*)?$', '$1') as ?eventMoreInfoLinkLabel) } } } group by ?event ?eventSeries ?eventName ?eventShortName ?eventLongName ?eventType ?eventTypeName ?eventDate ?eventOrganizer ?eventOrganizerLabel ?eventMoreInfoLink ?eventMoreInfoLinkLabel ?np ?npCreator ?npDate order by ?eventSeries desc(?eventDate)" assertion.
- get-3pff-events sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix tpff: <https://w3id.org/fair/3pff/> select ?event ?eventSeries ?eventName ?eventShortName ?eventLongName ?eventType ?eventTypeName ?eventDate ?eventOrganizer ?eventOrganizerLabel (min(?eventFacilitator) as ?eventFacilitator1) (if(count(?eventFacilitator)>1,"et al.","") as ?eventFacilitatorEtAl) ?eventMoreInfoLink ?eventMoreInfoLinkLabel ?np ?npCreator ?npDate where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?npDate . ?np dct:creator ?npCreator . ?np np:hasAssertion ?assertion . ?np npx:introduces ?event . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?event a tpff:3PFF-event . ?event rdfs:label ?eventName . bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName) bind(replace(str(?eventName), '^([A-Z0-9]{2,3}).*$', '$1') as ?eventSeries) bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName) ?event dct:date ?eventDate . optional { ?event tpff:has-event-organizer ?eventOrganizer . bind(replace(str(?eventOrganizer), '^.*[/#]([^#/\\?]+)[#/]?(\\?.*)?$', '$1') as ?eventOrganizerLabel) } optional { ?event tpff:has-event-facilitator ?eventFacilitator . bind(replace(str(?eventFacilitator), '^.*[/#]([^#/\\?]+)[#/]?(\\?.*)?$', '$1') as ?eventFacilitatorLabel) } optional { values ?eventType { tpff:In-Person-Event tpff:Hybrid-Event tpff:Virtual-Event } ?event a ?eventType . bind(replace(str(?eventType), '^.*/', '') as ?eventTypeName) } optional { ?event rdfs:seeAlso ?eventMoreInfoLink . bind(replace(str(?eventMoreInfoLink), '^.*[/#]([^#/\\?]+)[#/]?(\\?.*)?$', '$1') as ?eventMoreInfoLinkLabel) } } } group by ?event ?eventSeries ?eventName ?eventShortName ?eventLongName ?eventType ?eventTypeName ?eventDate ?eventOrganizer ?eventOrganizerLabel ?eventMoreInfoLink ?eventMoreInfoLinkLabel ?np ?npCreator ?npDate order by ?eventSeries desc(?eventDate)" assertion.
- get-accepted-nanopubs-by-author sparql "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#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?np ?label ?npType ?timestamp where { optional { <x:> <x:> ?_author_iri } # for grlc to pick up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select distinct ?np ?label ?timestamp where { graph npa:graph { ?np dct:created ?timestamp . ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np rdfs:label ?label . ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_author_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } group by ?np ?label ?timestamp } } order by desc(?timestamp)" assertion.
- get-user-stats sparql "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#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?key ?value where { { select ?key (count(?np) as ?value) where { optional { <x:> <x:> ?_pubkeyhashes } # ensure grlc is picking up the placeholder #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?service) service ?service { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?_pubkeyhashes, sha256(str(?pubkeyx)))) } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) optional { <x:> <x:> ?_userid_iri } # ensure grlc is picking up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-latest-nanopubs-from-pubkeys sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?_pubkeyhashes, sha256(str(?pubkeyx)))) } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-pubkeys sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkeyx . filter(contains(?_pubkeyhashes, sha256(str(?pubkeyx)))) } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-pubkeys-userid sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(if(?__pubkeyhashes = "", ?unbound, ?__pubkeyhashes) as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?__userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-user-stats sparql "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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(if(?__pubkeyhashes = "", ?unbound, ?__pubkeyhashes) as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?_userid_iri . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) optional { <x:> <x:> ?_userid_iri } # ensure grlc is picking up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-user-stats sparql "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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(if(?__pubkeyhashes = "", ?unbound, ?__pubkeyhashes) as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?_userid_iri . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) optional { <x:> <x:> ?_userid_iri } # ensure grlc is picking up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-latest-nanopubs-from-pubkeys-userid sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(if(?__pubkeyhashes = "", ?unbound, ?__pubkeyhashes) as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/meta>) as ?service) service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?__userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-user-stats sparql "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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(if(?__pubkeyhashes = "", ?unbound, ?__pubkeyhashes) as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(!bound(?pkh) || exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/full>) as ?service) # Should be /meta once RDF4J bug is resolved and we can allow for >1 concurrent queries service ?service { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?_userid_iri . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) optional { <x:> <x:> ?_userid_iri } # ensure grlc is picking up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-latest-nanopubs-from-pubkeys-userid sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(if(?__pubkeyhashes = "", ?unbound, ?__pubkeyhashes) as ?vs) # <- VAR __pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(!bound(?pkh) || exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/full>) as ?service) # Should be /meta once RDF4J bug is resolved and we can allow for >1 concurrent queries service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?__userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-top-creators-last30d sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix foaf: <http://xmlns.com/foaf/0.1/> select distinct ?userid (count(distinct ?np) as ?count) where { { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?userid . } } union { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasAssertion ?assertion . ?np np:hasProvenance ?prov . } graph ?prov { ?assertion prov:wasAttributedTo ?userid . } } filter(?userid != <https://orcid.org/1234-1234-1234-1234>) filter(?userid != <https://orcid.org/0000-0000-0000-0000>) filter(!regex(str(?userid), '[^A-Za-z0-9-_]RA[A-Za-z0-9-_]{43}$')) } group by ?userid order by desc(?count) limit 10" assertion.
- lookup-fdo-types sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> select ?thing ?label where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np npx:introduces ?thing . ?np np:hasAssertion ?a . } graph ?a { ?thing rdfs:label ?label . filter(contains(lcase(str(?label)), lcase(?_query))) } } limit 10" assertion.
- get-all-nanopubs-last30d sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?userid ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . optional { ?np rdfs:label ?label . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?np npx:hasNanopubType npx:retracts . } optional { ?np dct:creator ?userid . } } } order by desc(?date)" assertion.
- get-most-used-templates-last30d sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix dct: <http://purl.org/dc/terms/> select ?latest_template_np ?label (sum(?npcount) as ?overallcount) { { select ?template_np (count(distinct ?np) as ?npcount) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np np:hasPublicationInfo ?i . } graph ?i { ?np nt:wasCreatedFromTemplate ?template_np . } } group by ?template_np } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(nt:AssertionTemplate)))) as ?atservice) { service ?atservice { graph npa:networkGraph { ?latest_template_np npx:supersedes* ?template_np . } graph npa:graph { ?template_np npa:hasValidSignatureForPublicKey ?pubkey . ?latest_template_np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?latest_template_npx npx:invalidates ?latest_template_np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?template_np np:hasAssertion ?a . } graph ?a { ?a rdfs:label ?label . } } } } group by ?latest_template_np ?label order by desc(?overallcount) limit 10" assertion.
- get-fdos sparql "prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 fdof: <https://w3id.org/fdof/ontology#> select ?fdo ?label ?type ?np ?creator where { graph npa:graph { ?np npx:hasNanopubType fdof:FAIRDigitalObject . ?np dct:creator ?creator . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np np:hasAssertion ?a . } graph ?a { ?fdo fdof:hasInformationObjectType ?__type_iri . bind(?__type_iri as ?type) ?fdo rdfs:label ?label . bind(?__query as ?query) filter(if(bound(?query), contains(lcase(str(?label)), lcase(?query)), true)) } }" assertion.
- get-fdos sparql "prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 fdof: <https://w3id.org/fdof/ontology#> select ?fdo ?label ?type ?np ?creator where { graph npa:graph { ?np npx:hasNanopubType fdof:FAIRDigitalObject . ?np dct:creator ?creator . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np np:hasAssertion ?a . } graph ?a { ?fdo fdof:hasInformationObjectType ?__type_iri . bind(?__type_iri as ?type) ?fdo rdfs:label ?label . bind(?__query as ?query) filter(if(bound(?query), contains(lcase(str(?label)), lcase(?query)), true)) } }" assertion.
- get-user-stats sparql "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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?__pubkeyhashes as ?pubkeyhashes) # <- VAR __pubkeyhashes bind(if(bound(?pubkeyhashes), ?pubkeyhashes, "") as ?vs) # {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(!bound(?pkh) || exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/full>) as ?service) # Should be /meta once RDF4J bug is resolved and we can allow for >1 concurrent queries service ?service { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?_userid_iri . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) optional { <x:> <x:> ?_userid_iri } # ensure grlc is picking up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-latest-nanopubs-from-pubkeys-userid sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?__pubkeyhashes as ?pubkeyhashes) # <- VAR __pubkeyhashes bind(if(bound(?pubkeyhashes), ?pubkeyhashes, "") as ?vs) # {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(!bound(?pkh) || exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) bind(if(bound(?pkh), ?pubkeyservice, <https://w3id.org/np/l/nanopub-query-1.1/repo/full>) as ?service) # Should be /meta once RDF4J bug is resolved and we can allow for >1 concurrent queries service ?service { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?__userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-pubkeys sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(!bound(?pkh) || exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) service ?pubkeyservice { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?__userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-from-userid sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?_userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } order by desc(?date) limit 100" assertion.
- get-user-stats-from-pubkeys sparql "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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(!bound(?pkh) || exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) service ?pubkeyservice { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?_userid_iri . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-user-stats-from-userid sparql "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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?_userid_iri . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } as ?invalidated ) } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) optional { <x:> <x:> ?_userid_iri } # ensure grlc is picking up the placeholder values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-user-stats-from-pubkeys sparql "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 rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix dct: <http://purl.org/dc/terms/> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix bibo: <http://purl.org/ontology/bibo/> prefix pav: <http://purl.org/pav/> select ?key ?value where { { select ?key (count(?np) as ?value) where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{<x:> <x:> <x:>}}} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(!bound(?pkh) || exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) service ?pubkeyservice { select distinct ?np ?invalidated { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?_userid_iri . bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } as ?invalidated ) } } } } bind(if(?invalidated,"invalidatedNpCount","validNpCount") as ?key) values ?key { "invalidatedNpCount" "validNpCount" } } group by ?key ?invalidated } union { select ?key (sum(?npcount) as ?value) where { bind("acceptedNpCount" as ?key) values ?npType { <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(?npType)))) as ?service) service ?service { select (count(distinct ?np) as ?npcount) where { optional { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np np:hasPublicationInfo ?i . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } { { graph ?i { ?np pav:authoredBy ?_userid_iri . } } union { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?_userid_iri . filter(strstarts(str(?hasElement), str(rdf:_))) } } } } } group by ?np } } group by ?key } } order by ?key" assertion.
- get-latest-nanopubs-from-pubkeys sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------ { select ?pkh { # <- VAR pkh bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes {select*{optional{<x:> <x:> <x:>}}} # (for some Virtuoso ver.) # values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} # bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) # bind(" " as ?sep) # (separator as single regex-compatible char) # <- CONST sep bind(concat("^([^",?sep,"]*",?sep,"){",str(?n),"}") as ?p) # bind(concat(?sep,".*") as ?p0) # filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) # bind(replace(if(?n=0,?vs,replace(?vs,?p,"")),?p0,"") as ?pkh) # <- VAR pkh filter(!bound(?pkh) || exists {?any_np npa:hasValidSignatureForPublicKeyHash ?pkh }) # Filter out the hashes for which no repo exists; try to do this better with future versions of Nanopub Query } } # #==================================================================#--------------------- bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/", ?pkh)) as ?pubkeyservice) service ?pubkeyservice { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?__userid_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } } order by desc(?date) limit 100" assertion.
- get-latest-nanopubs-by-type sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?np ?label ?pubkey ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np npx:hasNanopubType ?_type_iri . optional { ?np rdfs:label ?label } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } filter not exists { ?np npx:hasNanopubType npx:retracts . } } } order by desc(?date) limit 100" assertion.
- get-most-used-templates-last30d sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix dct: <http://purl.org/dc/terms/> select ?template_np ?label (sum(?npcount) as ?overallcount) { { select ?used_template_np (count(distinct ?np) as ?npcount) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np np:hasPublicationInfo ?i . } graph ?i { ?np nt:wasCreatedFromTemplate ?used_template_np . } } group by ?used_template_np } bind(uri(concat("https://w3id.org/np/l/nanopub-query-1.1/repo/type/", sha256(str(nt:AssertionTemplate)))) as ?atservice) { service ?atservice { graph npa:networkGraph { ?template_np npx:supersedes* ?used_template_np . } graph npa:graph { ?used_template_np npa:hasValidSignatureForPublicKey ?pubkey . ?template_np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?template_npx npx:invalidates ?template_np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?used_template_np np:hasAssertion ?a . } graph ?a { ?a rdfs:label ?label . } } } } group by ?template_np ?label order by desc(?overallcount) limit 10" assertion.
- get-latest-version-of-np sparql "prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> select ?latest ?date where { graph npa:graph { ?_np_iri npa:hasValidSignatureForPublicKey ?pubkey . ?latest npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?latest ; npa:hasValidSignatureForPublicKey ?pubkey . } ?latest dct:created ?date . } graph npa:networkGraph { ?latest (npx:supersedes)* ?_np_iri . } }" assertion.
- get-all-user-intros sparql "prefix np: <http://www.nanopub.org/nschema#> prefix npx: <http://purl.org/nanopub/x/> prefix npa: <http://purl.org/nanopub/admin/> prefix dct: <http://purl.org/dc/terms/> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?user ?name ?intronp ?date ?pubkey where { graph npa:graph { ?intronp npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?intronpx npx:invalidates ?intronp ; npa:hasValidSignatureForPublicKey ?pubkey . } ?intronp dct:created ?date . ?intronp np:hasAssertion ?a . } graph ?a { ?keydeclaration npx:declaredBy ?user . optional { ?user foaf:name ?name . } } } order by ?user desc(?date)" assertion.
- get-suggested-templates-to-get-started sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> select ?template_np ?label ?date where { graph npa:graph { ?np npx:hasNanopubType <https://w3id.org/kpxl/gen/terms/SuggestedTemplateToGetStarted> . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . ?np np:hasAssertion ?a . } graph ?a { ?template_np a <https://w3id.org/kpxl/gen/terms/SuggestedTemplateToGetStarted> . } } order by desc(?date)" assertion.
- fulltext-search-on-labels sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select ?np ?label ?date where { graph npa:graph { ?np rdfs:label ?label . ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } ?np search:matches [ search:query ?_query ; search:property rdfs:label ; search:score ?score ; search:snippet ?snippet ] . } limit 10" assertion.
- get-autocomplete-suggestions sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix dct: <http://purl.org/dc/terms/> prefix search: <http://www.openrdf.org/contrib/lucenesail#> select distinct ?suggestion { { select ?suggestion where { graph npa:graph { ?np rdfs:label ?label . ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } filter(!contains(?_query, " ")) filter(strEnds(?_query, "*")) ?np search:matches [ search:query ?_query ; search:property rdfs:label ; search:score ?score ; search:snippet ?snippet ] . bind(replace(?snippet, ".*<B>(.*)</B>.*", "$1") as ?suggestion) } limit 100 } } group by ?suggestion" assertion.
- get-creator-pubkeys sparql "prefix np: <http://www.nanopub.org/nschema#> prefix npx: <http://purl.org/nanopub/x/> prefix npa: <http://purl.org/nanopub/admin/> prefix dct: <http://purl.org/dc/terms/> select distinct ?creator ?pubkey where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:creator ?creator . filter(!strstarts(str(?creator), str(?np))) } } order by ?creator" assertion.
- get-latest-accepted-bdj sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?np ?label ?timestamp where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?timestamp . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasAssertion ?a . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } } order by desc(?timestamp) limit 20" assertion.
- get-latest-accepted-bdj sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?np ?label ?date where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasAssertion ?a . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } } order by desc(?date) limit 20" assertion.
- get-latest-accepted-bdj sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix bibo: <http://purl.org/ontology/bibo/> select ?np ?label ?firstAuthor ?date where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } order by desc(?date) limit 20" assertion.
- get-latest-accepted-bdj sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix bibo: <http://purl.org/ontology/bibo/> select ?np ?label ?firstAuthor ?date where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } order by desc(?date) limit 100" assertion.
- get-latest-biodiv-candidates sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 biolink: <https://w3id.org/biolink/vocab/> prefix biodiv: <https://w3id.org/kpxl/biodiv/terms/> select ?np ?label ?pubkey ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . ?np rdfs:label ?label . ?np dct:creator ?_creator_iri . ?np npx:hasNanopubType biodiv:BiodivNanopub . filter(not exists { ?np npx:hasNanopubType <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> } ) filter(not exists { ?np npx:hasNanopubType <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> } ) filter(not exists { ?np npx:hasNanopubType <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } ) } } order by desc(?date) limit 100" assertion.
- get-latest-biodiv-candidates sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 biolink: <https://w3id.org/biolink/vocab/> prefix biodiv: <https://w3id.org/kpxl/biodiv/terms/> select ?np ?label ?pubkey ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . ?np rdfs:label ?label . ?np dct:creator ?__creator_iri . ?np npx:hasNanopubType biodiv:BiodivNanopub . filter(not exists { ?np npx:hasNanopubType <https://w3id.org/kpxl/pensoft/rio/terms/RIOJournalNanopub> } ) filter(not exists { ?np npx:hasNanopubType <https://w3id.org/kpxl/pensoft/bdj/terms/BiodiversityDataJournalNanopub> } ) filter(not exists { ?np npx:hasNanopubType <https://w3id.org/kpxl/ios/ds/terms/DataScienceNanopub> } ) } } order by desc(?date) limit 100" assertion.
- get-type-overview-last-12-months sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 ?type ?month ?npCount ?npCountType where { { select ?type ?month (count(?np) as ?npCount) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . ?np dct:creator ?_creator_iri . ?np npx:hasNanopubType ?type . bind(substr(str(?date), 0, 8) as ?month) bind(now() as ?now) bind(concat(str(year(?now)), '-', if(month(?now)>9,'','0'), str(month(?now))) as ?lastMonth) bind(concat(str(year(?now)-1), '-', if(month(?now)>9,'','0'), str(month(?now))) as ?firstMonth) filter(?month > ?firstMonth && ?month <= ?lastMonth) } } group by ?type ?month order by ?type desc(?month) } { select ?type (count(?np) as ?npCountType) where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np dct:created ?date . ?np dct:creator ?_creator_iri . ?np npx:hasNanopubType ?type . bind(substr(str(?date), 0, 8) as ?month) bind(now() as ?now) bind(concat(str(year(?now)), '-', if(month(?now)>9,'','0'), str(month(?now))) as ?lastMonth) bind(concat(str(year(?now)-1), '-', if(month(?now)>9,'','0'), str(month(?now))) as ?firstMonth) filter(?month > ?firstMonth && ?month <= ?lastMonth) } } group by ?type order by desc(?npCountType) limit 10 } } order by desc(?npCountType) ?type desc(?month)" assertion.
- get-reactions sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 cito: <http://purl.org/spar/cito/> select distinct ?np ?person ?rel ?reltext ?pub ?text ?date ?pubkey where { graph npa:networkGraph { ?_pub_iri npx:supersedes* ?pub . } graph npa:graph { ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?i. ?np dct:created ?date . ?np dct:creator ?person . ?np npx:hasNanopubType cito:cites . ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?a { ?a dct:creator ?person . ?a ?rel ?pub . optional { ?a rdfs:comment ?text . } filter(strstarts(str(?rel), str(cito:))) } graph <http://purl.org/np/RA6d0qLmlRdXd-ubre83LxP22auJdJjXGzaW3W3qH4Neo#assertion> { ?rel rdfs:label ?reltext . } } order by desc(?date)" assertion.
- get-latest-accepted-ds sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix bibo: <http://purl.org/ontology/bibo/> select ?np ?label ?firstAuthor ?date where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } order by desc(?date) limit 100" assertion.
- get-latest-accepted-rio sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix bibo: <http://purl.org/ontology/bibo/> select ?np ?label ?firstAuthor ?date where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } order by desc(?date) limit 100" assertion.
- get-latest-accepted-ds sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix bibo: <http://purl.org/ontology/bibo/> select ?np ?label ?firstAuthor ?date where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } order by desc(?date) limit 100" assertion.
- get-latest-accepted-rio sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix bibo: <http://purl.org/ontology/bibo/> select ?np ?label ?firstAuthor ?date where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } order by desc(?date) limit 100" assertion.
- get-latest-accepted-bdj sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix bibo: <http://purl.org/ontology/bibo/> select ?np ?label ?firstAuthor ?date where { values ?pubkey { "1162349fdeaf431e71ab55898cb2a425b971d466150c2aa5b3c1beb498045a37" "cfe248c38933693b1ddeb62e17976a4d2396b0c738af5356bfffbe559d1a3de0" "170211c91a70e67992d52c760de3f0052c8c7271bd3c225ef0347245e8517ff6" } graph npa:graph { ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKeyHash ?pubkey . ?np rdfs:label ?label . ?np np:hasPublicationInfo ?i . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } order by desc(?date) limit 100" assertion.
- get-approved-nanopubs sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?creator ?approved_np ?np ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np npx:hasNanopubType npx:approvesOf . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np dct:created ?date . ?np dct:creator ?creator . ?np np:hasAssertion ?a . } graph ?a { ?creator npx:approvesOf ?approved_np . filter(regex(str(?approved_np), '^.*[^A-Za-z0-9-_]RA[A-Za-z0-9-_]{43}$')) } }" assertion.
- get-approved-nanopubs sparql "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#> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select ?approved_np ?approver ?pubkey ?np ?date where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } ?np npx:hasNanopubType npx:approvesOf . filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . } ?np dct:created ?date . ?np dct:creator ?approver . ?np np:hasAssertion ?a . } graph ?a { ?approver npx:approvesOf ?approved_np . filter(regex(str(?approved_np), '^.*[^A-Za-z0-9-_]RA[A-Za-z0-9-_]{43}$')) } }" assertion.
- get-nanopubs-for-pubkeyhash sparql "prefix npa: <http://purl.org/nanopub/admin/> select ?np where { graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?_pubkeyhash . } }" assertion.
- get-nanopubs-for-pubkey-and-type sparql "prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> select ?np where { graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?_pubkeyhash . ?np npx:hasNanopubType ?_type_iri . } }" assertion.
- get-3pff-events sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix tpff: <https://w3id.org/fair/3pff/> select ?event ?eventName ?eventShortName ?eventLongName ?eventType ?eventTypeName ?eventDate ?eventOrganizer ?eventMoreInfoLink ?np ?npCreator ?npDate where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?npDate . ?np dct:creator ?npCreator . ?np np:hasAssertion ?assertion . ?np npx:introduces ?event . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?event a tpff:3PFF-event . ?event rdfs:label ?eventName . bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName) bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName) ?event dct:date ?eventDate . ?event tpff:has-event-organizer ?eventOrganizer . values ?eventType { tpff:In-Person-Event tpff:Hybrid-Event tpff:Virtual-Event } ?event a ?eventType . bind(replace(str(?eventType), '^.*/', '') as ?eventTypeName) ?event rdfs:seeAlso ?eventMoreInfoLink . } } order by desc(?eventDate)" assertion.
- get-3pff-events sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix tpff: <https://w3id.org/fair/3pff/> select ?event ?eventName ?eventShortName ?eventLongName ?eventType ?eventTypeName ?eventDate ?eventOrganizer ?eventMoreInfoLink ?np ?npCreator ?npDate where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?npDate . ?np dct:creator ?npCreator . ?np np:hasAssertion ?assertion . ?np npx:introduces ?event . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?event a tpff:3PFF-event . ?event rdfs:label ?eventName . bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName) bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName) ?event dct:date ?eventDate . optional { ?event tpff:has-event-organizer ?eventOrganizer . } optional { values ?eventType { tpff:In-Person-Event tpff:Hybrid-Event tpff:Virtual-Event } ?event a ?eventType . bind(replace(str(?eventType), '^.*/', '') as ?eventTypeName) } optional { ?event rdfs:seeAlso ?eventMoreInfoLink . } } } order by desc(?eventDate)" assertion.
- get-3pff-events sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix tpff: <https://w3id.org/fair/3pff/> select ?event ?eventName ?eventShortName ?eventLongName ?eventType ?eventTypeName ?eventDate ?eventOrganizer ?eventFacilitator ?eventMoreInfoLink ?np ?npCreator ?npDate where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?npDate . ?np dct:creator ?npCreator . ?np np:hasAssertion ?assertion . ?np npx:introduces ?event . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?event a tpff:3PFF-event . ?event rdfs:label ?eventName . bind(replace(str(?eventName), ' ?\\|.*$', '') as ?eventShortName) bind(replace(str(?eventName), '^.*\\| ?(.*)$', '$1') as ?eventLongName) ?event dct:date ?eventDate . optional { ?event tpff:has-event-organizer ?eventOrganizer . } optional { ?event tpff:has-event-facilitator ?eventFacilitator . } optional { values ?eventType { tpff:In-Person-Event tpff:Hybrid-Event tpff:Virtual-Event } ?event a ?eventType . bind(replace(str(?eventType), '^.*/', '') as ?eventTypeName) } optional { ?event rdfs:seeAlso ?eventMoreInfoLink . } } } order by desc(?eventDate)" assertion.
- subj-refs sparql "prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 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 prov: <http://www.w3.org/ns/prov#> prefix foaf: <http://xmlns.com/foaf/0.1/> select ?pred ?obj ?date ?creator where { graph npa:graph { ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np dct:created ?date . ?np dct:creator ?creator . ?np np:hasAssertion ?assertion . filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } } graph ?assertion { ?_subj_iri ?pred ?obj . } } order by desc(?date)" assertion.
- get-core-np-info sparql "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 oa: <http://www.w3.org/ns/oa#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix nt: <https://w3id.org/np/o/ntemplate/> prefix pav: <http://purl.org/pav/> prefix bibo: <http://purl.org/ontology/bibo/> prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> select distinct ?np (coalesce(?signer, min(?declaredCreator)) as ?creator) (coalesce(?firstAuthor, min(?author), min(?creator)) as ?mainAuthor) (if(count(distinct ?author)>0,count(distinct ?author),count(distinct ?creator)) as ?authorCount) ?introducedThing ?label ?date where { graph npa:graph { bind(replace(str(<https://w3id.org/kpxl/pensoft/bdj/np/RAgwnIlPtxRUkDoaT2xei8lmhQniGaWwZAQgHsCHuuCAk>), "^.*[^a-zA-Z0-9-_](RA[a-zA-Z0-9-_]{43})$", "$1") as ?ac) ?np npa:artifactCode ?ac . optional {<x:> <x:> ?_np_iri} # for grlc to pick up the placeholder ?np npa:hasHeadGraph ?h . ?np dct:created ?date . ?np npa:hasValidSignatureForPublicKey ?pubkey . ?np rdfs:label ?label . ?np np:hasPublicationInfo ?i . ?np dct:creator ?declaredCreator . optional { ?np npx:signedBy ?signer . } optional { ?np npx:introduces ?introducedThing . } } optional { graph ?i { ?np pav:authoredBy ?author . } } optional { graph ?i { ?np bibo:authorList ?authorList . ?authorList ?hasElement ?author . filter(strstarts(str(?hasElement), str(rdf:_))) } } optional { graph ?i { ?np bibo:authorList ?authorList . ?authorList rdf:_1 ?firstAuthor . } } } group by ?np ?signer ?introducedThing ?label ?date ?firstAuthor" assertion.