[ { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#pubinfo", "@graph": [ { "@id": "https://orcid.org/0000-0002-1267-0234", "http://xmlns.com/foaf/0.1/name": [ { "@value": "Tobias Kuhn" } ] }, { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#sig", "http://purl.org/nanopub/x/hasAlgorithm": [ { "@value": "RSA" } ], "http://purl.org/nanopub/x/hasPublicKey": [ { "@value": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD4Wj537OijfOWVtsHMznuXKISqBhtGDQZfdO6pbb4hg9EHMcUFGTLbWaPrP783PHv8HMAAPjvEkHLaOHMIknqhaIa5236lfBO3r+ljVdYBElBcLvROmwG+ZGtmPNZf7lMhI15xf5TfoaSa84AFRd5J2EXekK6PhaFQhRm1IpSYtwIDAQAB" } ], "http://purl.org/nanopub/x/hasSignature": [ { "@value": "MBQ/zeAJfxmo7vPh/2S5XrSbyogLfppVISPWTEQjsBWgcsTRui7GGKcCoHq719B05N/iWPlJHMelvXmtXJ6h2di29azCEKnMEtV3hwIDVWpxAJDb5FgoGSn9eq5OLivlL+XDs0BN1ZWCpT+j/8u5SoklD4oBbiJXQScA5M6oLBM=" } ], "http://purl.org/nanopub/x/hasSignatureTarget": [ { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8" } ], "http://purl.org/nanopub/x/signedBy": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ] }, { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8", "http://purl.org/dc/terms/created": [ { "@value": "2024-09-23T10:29:25.228Z", "@type": "http://www.w3.org/2001/XMLSchema#dateTime" } ], "http://purl.org/dc/terms/creator": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ], "http://purl.org/dc/terms/license": [ { "@id": "https://creativecommons.org/licenses/by/4.0/" } ], "http://purl.org/nanopub/x/introduces": [ { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#get-user-stats-from-pubkeys" } ], "http://purl.org/nanopub/x/wasCreatedAt": [ { "@id": "https://nanodash.knowledgepixels.com/" } ], "https://w3id.org/np/o/ntemplate/wasCreatedFromProvenanceTemplate": [ { "@id": "http://purl.org/np/RANwQa4ICWS5SOjw7gp99nBpXBasapwtZF1fIM3H2gYTM" } ], "https://w3id.org/np/o/ntemplate/wasCreatedFromPubinfoTemplate": [ { "@id": "http://purl.org/np/RAA2MfqdBCzmz9yVWjKLXNbyfBNcwsMmOqcNUxkk1maIM" }, { "@id": "http://purl.org/np/RAh1gm83JiG5M6kDxXhaYT1l49nCzyrckMvTzcPn-iv90" } ], "https://w3id.org/np/o/ntemplate/wasCreatedFromTemplate": [ { "@id": "https://w3id.org/np/RAYvkQOT9-zrcql5lzMW9OpiPjA9UvSh-RezaVwYmWvns" } ] } ] }, { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#provenance", "@graph": [ { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#assertion", "http://www.w3.org/ns/prov#wasAttributedTo": [ { "@id": "https://orcid.org/0000-0002-1267-0234" } ] } ] }, { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#Head", "@graph": [ { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8", "http://www.nanopub.org/nschema#hasAssertion": [ { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#assertion" } ], "http://www.nanopub.org/nschema#hasProvenance": [ { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#provenance" } ], "http://www.nanopub.org/nschema#hasPublicationInfo": [ { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#pubinfo" } ], "@type": [ "http://www.nanopub.org/nschema#Nanopublication" ] } ] }, { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#assertion", "@graph": [ { "@id": "https://w3id.org/np/RAYx5vIObDu1ZQuEV5kShGlnRrLvEFBvC3buF_YLtl8T8#get-user-stats-from-pubkeys", "http://purl.org/dc/terms/description": [ { "@value": "This query returns some general user statistics from the given pubkey hashes in the form of number of valid/invalidated/accepted nanopublications published." } ], "http://purl.org/dc/terms/license": [ { "@id": "http://www.apache.org/licenses/LICENSE-2.0" } ], "@type": [ "https://w3id.org/kpxl/grlc/grlc-query" ], "http://www.w3.org/2000/01/rdf-schema#label": [ { "@value": "Get some general user statistics" } ], "https://w3id.org/kpxl/grlc/endpoint": [ { "@id": "https://w3id.org/np/l/nanopub-query-1.1/repo/meta" } ], "https://w3id.org/kpxl/grlc/sparql": [ { "@value": "prefix np: \r\nprefix npa: \r\nprefix npx: \r\nprefix xsd: \r\nprefix rdf: \r\nprefix dct: \r\nprefix rdfs: \r\nprefix nt: \r\nprefix bibo: \r\nprefix pav: \r\n\r\nselect ?key ?value where {\r\n{\r\nselect ?key (count(?np) as ?value) where {\r\n\r\n #==================== MULTI-VALUE PLACEHOLDER =====================#------ config: ------\r\n { select ?pkh { # <- VAR pkh\r\n bind(?_pubkeyhashes as ?vs) # <- VAR _pubkeyhashes\r\n {select*{optional{?a ?b ?c}}limit 1} # (for some Virtuoso ver.) #\r\n values ?x {0 1 2 3 4 5 6 7 8 9} values ?y {0 1 2 3 4 5 6 7 8 9} #\r\n bind((10*?x)+?y as ?n) # (works up to a maximum of 100 values) #\r\n bind(\" \" as ?sep) # (separator as single regex-compatible char) # <- CONST sep\r\n bind(concat(\"^([^\",?sep,\"]*\",?sep,\"){\",str(?n),\"}\") as ?p) #\r\n bind(concat(?sep,\".*\") as ?p0) #\r\n filter(if(?n=0,true,regex(?vs,?p))) # (?n=0 check for Viruoso) #\r\n bind(replace(if(?n=0,?vs,replace(?vs,?p,\"\")),?p0,\"\") as ?pkh) # <- VAR pkh\r\n 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\r\n } } #\r\n #==================================================================#---------------------\r\n bind(uri(concat(\"https://w3id.org/np/l/nanopub-query-1.1/repo/pubkey/\", ?pkh)) as ?pubkeyservice)\r\n \r\n service ?pubkeyservice { select distinct ?np ?invalidated { optional {\r\n graph npa:graph {\r\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\r\n ?np dct:creator ?_userid_iri .\r\n bind( exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . } as ?invalidated )\r\n }\r\n } } }\r\n\r\nbind(if(?invalidated,\"invalidatedNpCount\",\"validNpCount\") as ?key)\r\nvalues ?key { \"invalidatedNpCount\" \"validNpCount\" }\r\n\r\n}\r\ngroup by ?key ?invalidated\r\n}\r\nunion\r\n{\r\nselect ?key (sum(?npcount) as ?value) where {\r\n\r\nbind(\"acceptedNpCount\" as ?key)\r\n\r\nvalues ?npType {\r\n \r\n \r\n \r\n}\r\nbind(uri(concat(\"https://w3id.org/np/l/nanopub-query-1.1/repo/type/\", sha256(str(?npType)))) as ?service)\r\n\r\nservice ?service { select (count(distinct ?np) as ?npcount) where { optional {\r\n graph npa:graph {\r\n ?np npa:hasValidSignatureForPublicKey ?pubkey .\r\n ?np np:hasPublicationInfo ?i .\r\n filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKey ?pubkey . }\r\n }\r\n { {\r\n graph ?i { ?np pav:authoredBy ?_userid_iri . }\r\n } union {\r\n graph ?i {\r\n ?np bibo:authorList ?authorList .\r\n ?authorList ?hasElement ?_userid_iri .\r\n filter(strstarts(str(?hasElement), str(rdf:_)))\r\n }\r\n } }\r\n} }\r\ngroup by ?np\r\n} }\r\ngroup by ?key\r\n}\r\n}\r\norder by ?key" } ] } ] } ]