@prefix this: . @prefix sub: . @prefix np: . @prefix grlc: . @prefix dct: . @prefix nt: . @prefix npx: . @prefix xsd: . @prefix rdfs: . @prefix orcid: . @prefix prov: . @prefix foaf: . sub:Head { this: a np:Nanopublication; np:hasAssertion sub:assertion; np:hasProvenance sub:provenance; np:hasPublicationInfo sub:pubinfo . } sub:assertion { sub:get-evidence-of-statement a grlc:grlc-query; dct:description "Given a statement (an AIDA sentence), this query returns the evidence items and arguments behind it, one row per item and kind: the item with its label, its kind (the more specific ECO class, or wd:Q11538 for a deductive argument, labelled from the pubinfo of the item's nanopublication), the statements through which it supports the given statement, the projects of the study that generated it, and the item's nanopublication. An item counts when the statement obtains support from it directly (cito:obtainsSupportFrom), or when a statement the given statement generalises via hycl:hasMoreGeneralMeaningThan does so, one or two levels down, which is how a programme-level statement reaches the findings of its projects; each generalisation link sits in its own nanopublication, so the hops are written out explicitly rather than as a property path. Evidence that was merely generated by the same study as a supporting item, without being claimed as support, is not included. It is meant as a part-level view on a statement page, where the page's context resource is filled into the context parameter automatically; only nanopublications signed by a current admin, maintainer or member of the context space or of one of its sub-spaces count, with invalidated, superseded and example nanopublications skipped, and the member check is applied after the union of the hop branches."; dct:license ; rdfs:label "Get the evidence and arguments behind a statement"; grlc:endpoint ; grlc:sparql """prefix np: prefix npa: prefix npx: prefix gen: prefix hycl: prefix cito: prefix obo: prefix wd: prefix prov: prefix dct: prefix rdfs: select ?evidence ?evidence_label ?kind ?kind_label ?statement_multi_iri ?statement_label_multi ?project_multi_iri ?project_label_multi ?np ?np_label where { { select ?evidence ?kind (sample(?evLabel) as ?evidence_label) (sample(?kl) as ?kind_label) (group_concat(distinct str(?via); separator=\"\\n\") as ?statement_multi_iri) (group_concat(distinct ?viaLabel; separator=\"\\n\") as ?statement_label_multi) (group_concat(distinct str(?project); separator=\"\\n\") as ?project_multi_iri) (group_concat(distinct ?projectLabel; separator=\"\\n\") as ?project_label_multi) (sample(?enp) as ?np) where { { select (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where { service { select ?mpk where { values ?__context_multi_iri {} graph npa:graph { npa:hasCurrentSpaceState ?stateG . } graph ?stateG { ?ri a gen:RoleInstantiation ; npa:forSpace ?sp ; npa:forAgent ?agent ; npa:hasRoleType ?roleType . filter(?roleType in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole)) ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk . } # The context is the space itself or a resource it maintains; matched in a filter # with a bound() guard rather than a zero-length path, which would scan the whole # state graph when the optional context is absent. filter(bound(?__context_multi_iri) && ( ?sp = ?__context_multi_iri || strstarts(str(?sp), concat(str(?__context_multi_iri), \"/\")) || exists { graph ?stateG { ?__context_multi_iri npa:isMaintainedBy ?mb . filter(?sp = ?mb || strstarts(str(?sp), concat(str(?mb), \"/\"))) } })) } } } } # The item supports the statement directly, or supports a statement the statement # generalises, one or two levels down (programme statement > project statement > finding). # Each generalisation link sits in its own nanopublication, so the hops are explicit. { graph npa:graph { ?snp0 np:hasAssertion ?sa0 ; npa:hasValidSignatureForPublicKeyHash ?spk0 . filter not exists { ?sInv0 npx:invalidates ?snp0 ; npa:hasValidSignatureForPublicKeyHash ?spk0 } filter not exists { ?sSup0 npx:supersedes ?snp0 } } graph ?sa0 { ?_statement_iri cito:obtainsSupportFrom ?evidence . } } union { graph npa:graph { ?gnp1 np:hasAssertion ?ga1 ; npa:hasValidSignatureForPublicKeyHash ?gpk1 . filter not exists { ?gInv1 npx:invalidates ?gnp1 ; npa:hasValidSignatureForPublicKeyHash ?gpk1 } filter not exists { ?gSup1 npx:supersedes ?gnp1 } } graph ?ga1 { ?_statement_iri hycl:hasMoreGeneralMeaningThan ?via . } graph npa:graph { ?snp1 np:hasAssertion ?sa1 ; npa:hasValidSignatureForPublicKeyHash ?spk1 . filter not exists { ?sInv1 npx:invalidates ?snp1 ; npa:hasValidSignatureForPublicKeyHash ?spk1 } filter not exists { ?sSup1 npx:supersedes ?snp1 } } graph ?sa1 { ?via cito:obtainsSupportFrom ?evidence . } } union { graph npa:graph { ?gnp2 np:hasAssertion ?ga2 ; npa:hasValidSignatureForPublicKeyHash ?gpk2 . filter not exists { ?gInv2 npx:invalidates ?gnp2 ; npa:hasValidSignatureForPublicKeyHash ?gpk2 } filter not exists { ?gSup2 npx:supersedes ?gnp2 } } graph ?ga2 { ?_statement_iri hycl:hasMoreGeneralMeaningThan ?mid . } graph npa:graph { ?gnp3 np:hasAssertion ?ga3 ; npa:hasValidSignatureForPublicKeyHash ?gpk3 . filter not exists { ?gInv3 npx:invalidates ?gnp3 ; npa:hasValidSignatureForPublicKeyHash ?gpk3 } filter not exists { ?gSup3 npx:supersedes ?gnp3 } } graph ?ga3 { ?mid hycl:hasMoreGeneralMeaningThan ?via . } graph npa:graph { ?snp2 np:hasAssertion ?sa2 ; npa:hasValidSignatureForPublicKeyHash ?spk2 . filter not exists { ?sInv2 npx:invalidates ?snp2 ; npa:hasValidSignatureForPublicKeyHash ?spk2 } filter not exists { ?sSup2 npx:supersedes ?snp2 } } graph ?sa2 { ?via cito:obtainsSupportFrom ?evidence . } } # member checks after the union: a filter inside a branch cannot see ?memberPubkeys filter(coalesce(contains(?memberPubkeys, ?spk0), true)) filter(coalesce(contains(?memberPubkeys, ?gpk1), true)) filter(coalesce(contains(?memberPubkeys, ?spk1), true)) filter(coalesce(contains(?memberPubkeys, ?gpk2), true)) filter(coalesce(contains(?memberPubkeys, ?gpk3), true)) filter(coalesce(contains(?memberPubkeys, ?spk2), true)) graph npa:graph { ?enp np:hasAssertion ?ea ; np:hasPublicationInfo ?epi ; npa:hasValidSignatureForPublicKeyHash ?epk . filter not exists { ?eInv npx:invalidates ?enp ; npa:hasValidSignatureForPublicKeyHash ?epk } filter not exists { ?eSup npx:supersedes ?enp } filter not exists { ?enp npx:hasNanopubType npx:ExampleNanopub } } filter(contains(?memberPubkeys, ?epk)) graph ?ea { ?evidence a ?evType , ?kind . } filter(?evType in (obo:ECO_0000000, wd:Q11538)) filter(?kind != obo:ECO_0000000) optional { graph ?ea { ?evidence rdfs:label ?evLabelRaw } } optional { graph ?epi { ?kind rdfs:label ?klRaw } } bind(coalesce(?evLabelRaw, replace(str(?evidence), \"^.*/\", \"\")) as ?evLabel) bind(coalesce(?klRaw, replace(str(?kind), \"^.*/\", \"\")) as ?kl) optional { graph ?ea { ?evidence prov:wasGeneratedBy ?study . } graph npa:graph { ?stnp np:hasAssertion ?sta ; npa:hasValidSignatureForPublicKeyHash ?stpk . filter not exists { ?stInv npx:invalidates ?stnp ; npa:hasValidSignatureForPublicKeyHash ?stpk } filter not exists { ?stSup npx:supersedes ?stnp } } filter(contains(?memberPubkeys, ?stpk)) graph ?sta { ?study dct:isPartOf ?project . } bind(replace(str(?project), \"^.*/\", \"\") as ?projectLabel) } bind(replace(replace(replace(replace(replace(replace(replace(strafter(str(?via), \"http://purl.org/aida/\"), \"[+]\", \" \"), \"%2C\", \",\"), \"%3A\", \":\"), \"%28\", \"(\"), \"%29\", \")\"), \"%2F\", \"/\"), \"%25\", \"%\") as ?viaLabel) } group by ?evidence ?kind } bind(\"^\" as ?np_label) } order by ?kind_label ?evidence_label""" . } sub:provenance { sub:assertion prov:wasAttributedTo orcid:0000-0002-1267-0234 . } sub:pubinfo { orcid:0000-0002-1267-0234 foaf:name "Tobias Kuhn" . this: dct:created "2026-09-11T13:15:14Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:get-evidence-of-statement; rdfs:label "Get the evidence and arguments behind a statement"; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "nWmhxrlCUOJpcN5AAVu86oPlmlVNMHX9acOfFs2tv4qfv7D+7CN+RXKPMD8EsuExvRMVQJmlq4l38j3RlXx5VTej7UGJcWVBQD0yrh7NPkLCbUlluGsr/B94yAJjHMEaEUK7ke89/l6uArZ0zhpuuk/g21ONSj6bZG6dr8aJA2I="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }