rows { options { physical_type: PHYSICAL_STREAM_TYPE_QUADS max_name_table_size: 128 max_prefix_table_size: 16 max_datatype_table_size: 16 logical_type: LOGICAL_STREAM_TYPE_DATASETS version: 2 } } rows { prefix { value: "https://w3id.org/np/" } } rows { name { value: "RAunUifYz7BVtmxBmneNaDh9SEO5fB7Uqsj6vsQXC66S4" } } rows { namespace { name: "this" value { prefix_id: 1 } } } rows { prefix { value: "https://w3id.org/np/RAunUifYz7BVtmxBmneNaDh9SEO5fB7Uqsj6vsQXC66S4/" } } rows { name { } } rows { namespace { name: "sub" value { prefix_id: 2 } } } rows { prefix { value: "http://www.nanopub.org/nschema#" } } rows { namespace { name: "np" value { prefix_id: 3 name_id: 2 } } } rows { prefix { value: "https://w3id.org/kpxl/grlc/" } } rows { namespace { name: "grlc" value { prefix_id: 4 name_id: 2 } } } rows { prefix { value: "http://purl.org/dc/terms/" } } rows { namespace { name: "dct" value { prefix_id: 5 name_id: 2 } } } rows { prefix { value: "https://w3id.org/np/o/ntemplate/" } } rows { namespace { name: "nt" value { prefix_id: 6 name_id: 2 } } } rows { prefix { value: "http://purl.org/nanopub/x/" } } rows { namespace { name: "npx" value { prefix_id: 7 name_id: 2 } } } rows { prefix { value: "http://www.w3.org/2001/XMLSchema#" } } rows { namespace { name: "xsd" value { prefix_id: 8 name_id: 2 } } } rows { prefix { value: "http://www.w3.org/2000/01/rdf-schema#" } } rows { namespace { name: "rdfs" value { prefix_id: 9 name_id: 2 } } } rows { prefix { value: "https://orcid.org/" } } rows { namespace { name: "orcid" value { prefix_id: 10 name_id: 2 } } } rows { prefix { value: "http://www.w3.org/ns/prov#" } } rows { namespace { name: "prov" value { prefix_id: 11 name_id: 2 } } } rows { prefix { value: "http://xmlns.com/foaf/0.1/" } } rows { namespace { name: "foaf" value { prefix_id: 12 name_id: 2 } } } rows { name { value: "hasAssertion" } } rows { name { value: "assertion" } } rows { name { value: "Head" } } rows { quad { s_iri { prefix_id: 1 name_id: 1 } p_iri { prefix_id: 3 name_id: 3 } o_iri { prefix_id: 2 } g_iri { } } } rows { name { value: "hasProvenance" } } rows { name { value: "provenance" } } rows { quad { p_iri { prefix_id: 3 } o_iri { prefix_id: 2 } } } rows { name { value: "hasPublicationInfo" } } rows { name { value: "pubinfo" } } rows { quad { p_iri { prefix_id: 3 } o_iri { prefix_id: 2 } } } rows { prefix { value: "http://www.w3.org/1999/02/22-rdf-syntax-ns#" } } rows { name { value: "type" } } rows { name { value: "Nanopublication" } } rows { quad { p_iri { prefix_id: 13 } o_iri { prefix_id: 3 } } } rows { name { value: "get-space-onehealth-coverage-svg" } } rows { name { value: "description" } } rows { quad { s_iri { prefix_id: 2 } p_iri { prefix_id: 5 } o_literal { lex: "Returns a single row holding an SVG diagram of how the projects of a space cover the three One Health domains: three overlapping circles for Human, Animal and Environment, each region showing the number of projects tagged with exactly that combination of domains via the ZonMw One Health vocabulary (zonmw/r/onehealth/domain), and each domain heading showing how many of the space\'s projects and how many datasets are tagged with it. Projects are the gen:Project spaces whose IRI extends the given space, tagged or not, which gives the \'of N\' denominator; entities are anything under the space\'s IRI that carries a domain tag, classified as project (gen:Project), dataset (ff:Dataset) or other. The per-entity domain flags are computed once and every count is a conditional sum over that one set of rows, so the figures never multiply each other. Only tags asserted in nanopublications signed by a current admin, maintainer or member of the space or one of its sub-spaces count, with invalidated, superseded and example nanopublications skipped; the membership lookup is a federated sub-select sharing no variables with the rest of the query. The SVG uses explicit end tags and camelCase attributes and contains no data-derived text other than numbers, so it needs no escaping." } g_iri { prefix_id: 2 name_id: 4 } } } rows { name { value: "license" } } rows { prefix { value: "http://www.apache.org/licenses/" } } rows { name { value: "LICENSE-2.0" } } rows { quad { p_iri { prefix_id: 5 name_id: 14 } o_iri { prefix_id: 14 } } } rows { name { value: "grlc-query" } } rows { quad { p_iri { prefix_id: 13 name_id: 10 } o_iri { prefix_id: 4 name_id: 16 } } } rows { name { value: "label" } } rows { quad { p_iri { prefix_id: 9 } o_literal { lex: "Get a One Health coverage diagram for a space and its sub-spaces" } } } rows { name { value: "endpoint" } } rows { prefix { value: "https://w3id.org/np/l/nanopub-query-1.1/repo/" } } rows { name { value: "full" } } rows { quad { p_iri { prefix_id: 4 } o_iri { prefix_id: 15 } } } rows { name { value: "sparql" } } rows { quad { p_iri { prefix_id: 4 } o_literal { lex: "prefix np: \nprefix npa: \nprefix npx: \nprefix gen: \nprefix ff: \nprefix oh: \n\nselect ?svg\nwhere {\n # One row: how many projects and datasets sit in each region of the Human / Animal /\n # Environment diagram, computed from one set of per-entity domain flags so that the\n # sums never multiply each other.\n {\n select\n (sum(if(?kind = \"project\" && ?h = 1 && ?a = 0 && ?e = 0, 1, 0)) as ?pH)\n (sum(if(?kind = \"project\" && ?h = 0 && ?a = 1 && ?e = 0, 1, 0)) as ?pA)\n (sum(if(?kind = \"project\" && ?h = 0 && ?a = 0 && ?e = 1, 1, 0)) as ?pE)\n (sum(if(?kind = \"project\" && ?h = 1 && ?a = 1 && ?e = 0, 1, 0)) as ?pHA)\n (sum(if(?kind = \"project\" && ?h = 1 && ?a = 0 && ?e = 1, 1, 0)) as ?pHE)\n (sum(if(?kind = \"project\" && ?h = 0 && ?a = 1 && ?e = 1, 1, 0)) as ?pAE)\n (sum(if(?kind = \"project\" && ?h = 1 && ?a = 1 && ?e = 1, 1, 0)) as ?pHAE)\n (sum(if(?kind = \"project\" && ?h = 1, 1, 0)) as ?pHt)\n (sum(if(?kind = \"project\" && ?a = 1, 1, 0)) as ?pAt)\n (sum(if(?kind = \"project\" && ?e = 1, 1, 0)) as ?pEt)\n (sum(if(?kind = \"project\", 1, 0)) as ?pTagged)\n (sum(if(?kind = \"dataset\" && ?h = 1, 1, 0)) as ?dHt)\n (sum(if(?kind = \"dataset\" && ?a = 1, 1, 0)) as ?dAt)\n (sum(if(?kind = \"dataset\" && ?e = 1, 1, 0)) as ?dEt)\n (sum(if(?kind = \"dataset\", 1, 0)) as ?dTagged)\n (sum(if(?kind = \"other\" && ?h = 1, 1, 0)) as ?oHt)\n (sum(if(?kind = \"other\" && ?a = 1, 1, 0)) as ?oAt)\n (sum(if(?kind = \"other\" && ?e = 1, 1, 0)) as ?oEt)\n where {\n {\n select ?entity ?kind\n (max(if(?domain = oh:Human, 1, 0)) as ?h)\n (max(if(?domain = oh:Animal, 1, 0)) as ?a)\n (max(if(?domain = oh:Environment, 1, 0)) as ?e)\n where {\n values ?_space_multi_iri {}\n {\n select (group_concat(distinct ?mpk; separator=\" \") as ?memberPubkeys) where {\n service {\n select ?mpk where {\n values ?_space_multi_iri {}\n graph npa:graph { npa:hasCurrentSpaceState ?stateG . }\n graph ?stateG {\n ?ri a gen:RoleInstantiation ; npa:forSpace ?sp ; npa:forAgent ?agent ; npa:hasRoleType ?rt .\n filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))\n ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk .\n }\n filter(?sp = ?_space_multi_iri || strstarts(str(?sp), concat(str(?_space_multi_iri), \"/\")))\n }\n }\n }\n }\n graph npa:graph {\n ?np npa:hasValidSignatureForPublicKeyHash ?npPubkey .\n filter not exists { ?invNp npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?npPubkey . }\n filter not exists { ?supNp npx:supersedes ?np . }\n filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }\n ?np np:hasAssertion ?a0 .\n }\n filter(contains(?memberPubkeys, ?npPubkey))\n graph ?a0 { ?entity oh:domain ?domain . }\n filter(strstarts(str(?entity), concat(str(?_space_multi_iri), \"/\")))\n bind(if(exists { graph ?ta { ?entity a gen:Project } }, \"project\",\n if(exists { graph ?tb { ?entity a ff:Dataset } }, \"dataset\", \"other\")) as ?kind)\n }\n group by ?entity ?kind\n }\n }\n }\n # Denominator: every project space in the subtree, tagged or not.\n {\n select (count(distinct ?project) as ?pAll) where {\n values ?_space_multi_iri {}\n graph npa:graph { ?pnp np:hasAssertion ?pa . filter not exists { ?psup npx:supersedes ?pnp . } }\n graph ?pa { ?project a gen:Project . }\n filter(strstarts(str(?project), concat(str(?_space_multi_iri), \"/\")))\n }\n }\n bind(if(?pAll > 0, ?pAll, ?pTagged) as ?pTotal)\n bind(concat(\n \'\',\n \'\',\n \'\',\n \'\',\n \'Human\',\n \'\', str(?pHt), \' of \', str(?pTotal), \' projects, \', str(?dHt), \' datasets\',\n \'Animal\',\n \'\', str(?pAt), \' of \', str(?pTotal), \' projects, \', str(?dAt), \' datasets\',\n \'Environment\',\n \'\', str(?pEt), \' of \', str(?pTotal), \' projects, \', str(?dEt), \' datasets\',\n \' 0, \'#222\', \'#aaa\'), \'\">\', str(?pH), \'\',\n \' 0, \'#222\', \'#aaa\'), \'\">\', str(?pA), \'\',\n \' 0, \'#222\', \'#aaa\'), \'\">\', str(?pE), \'\',\n \' 0, \'#222\', \'#aaa\'), \'\">\', str(?pHA), \'\',\n \' 0, \'#222\', \'#aaa\'), \'\">\', str(?pHE), \'\',\n \' 0, \'#222\', \'#aaa\'), \'\">\', str(?pAE), \'\',\n \' 0, \'#222\', \'#aaa\'), \'\">\', str(?pHAE), \'\',\n \'Numbers: projects per region (\', str(?pTagged), \' of \', str(?pTotal), \' projects tagged, \', str(?dTagged), \' datasets)\',\n \'\') as ?svg)\n}" } } } rows { name { value: "wasAttributedTo" } } rows { name { value: "0000-0002-1267-0234" } } rows { quad { s_iri { prefix_id: 2 name_id: 4 } p_iri { prefix_id: 11 name_id: 21 } o_iri { prefix_id: 10 } g_iri { prefix_id: 2 name_id: 7 } } } rows { name { value: "name" } } rows { quad { s_iri { prefix_id: 10 name_id: 22 } p_iri { prefix_id: 12 } o_literal { lex: "Tobias Kuhn" } g_iri { prefix_id: 2 name_id: 9 } } } rows { name { value: "created" } } rows { datatype { value: "http://www.w3.org/2001/XMLSchema#dateTime" } } rows { quad { s_iri { prefix_id: 1 name_id: 1 } p_iri { prefix_id: 5 name_id: 24 } o_literal { lex: "2026-09-13T05:32:24Z" datatype: 1 } } } rows { name { value: "creator" } } rows { quad { p_iri { } o_iri { prefix_id: 10 name_id: 22 } } } rows { prefix { value: "https://creativecommons.org/licenses/by/4.0/" } } rows { quad { p_iri { prefix_id: 5 name_id: 14 } o_iri { prefix_id: 16 name_id: 2 } } } rows { name { value: "embeds" } } rows { quad { p_iri { prefix_id: 7 name_id: 26 } o_iri { prefix_id: 2 name_id: 12 } } } rows { quad { p_iri { prefix_id: 9 name_id: 17 } o_literal { lex: "Get a One Health coverage diagram for a space and its sub-spaces" } } } rows { name { value: "wasCreatedFromProvenanceTemplate" } } rows { name { value: "RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU" } } rows { quad { p_iri { prefix_id: 6 name_id: 27 } o_iri { prefix_id: 1 } } } rows { name { value: "wasCreatedFromPubinfoTemplate" } } rows { name { value: "RACJ58Gvyn91LqCKIO9zu1eijDQIeEff28iyDrJgjSJF8" } } rows { quad { p_iri { prefix_id: 6 } o_iri { prefix_id: 1 } } } rows { name { value: "RAukAcWHRDlkqxk7H2XNSegc1WnHI569INvNr-xdptDGI" } } rows { quad { o_iri { } } } rows { name { value: "wasCreatedFromTemplate" } } rows { name { value: "RAEFAt-QcFK0ZhqfvlsmS10BnzGJA0xwOICZXkO-ai87k" } } rows { quad { p_iri { prefix_id: 6 } o_iri { prefix_id: 1 } } } rows { name { value: "sig" } } rows { name { value: "hasAlgorithm" } } rows { quad { s_iri { prefix_id: 2 } p_iri { prefix_id: 7 } o_literal { lex: "RSA" } } } rows { name { value: "hasPublicKey" } } rows { quad { p_iri { } o_literal { lex: "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB" } } } rows { name { value: "hasSignature" } } rows { quad { p_iri { } o_literal { lex: "AYD3btJN+kkQKJvpMXgJW/WUcAdli1ctXlF7m/qLdpMAUczBZCbV7gXGERgd/w07RwUCMfWA5btJdEF8Us5dcIn7TovnxLKnUI4NgQLKAOrJhmOGNGFEtP5nUa06emfWuTgr82MipwphD1585Y3YOVpRaOGw5t7Nll+7Riuo1xY=" } } } rows { name { value: "hasSignatureTarget" } } rows { quad { p_iri { } o_iri { prefix_id: 1 name_id: 1 } } } rows { name { value: "signedBy" } } rows { quad { p_iri { prefix_id: 7 name_id: 39 } o_iri { prefix_id: 10 name_id: 22 } } }