@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-activity-info a grlc:grlc-query; dct:description "Returns the basic information known about an activity such as a study, as property/value rows: its kind, description, the project it is part of, who conducted it, where to find more information, whether it has been approved, and the source nanopublication it all comes from. Takes the most recent still-current nanopub about the evidence that was published by somebody holding a role in the project its study belongs to."; dct:license ; rdfs:label "Get basic information about an activity"; grlc:endpoint ; grlc:sparql """prefix rdf: prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: prefix gen: prefix ff: prefix obo: prefix prov: prefix foaf: prefix nt: select ?Property_noheader ?Property_label ?Value_multi_val_noheader ?Value_label_multi ?np ?target_np ?approve_target where { values ?_activity_multi_iri {} { select ?np (sample(?npT) as ?npTitle) ?project ?project_label ?description (group_concat(distinct str(?kind); separator=\"\\n\") as ?kind_vals) (group_concat(distinct ?kindL; separator=\"\\n\") as ?kind_labels) (group_concat(distinct str(?agent); separator=\"\\n\") as ?agent_vals) (group_concat(distinct ?agentName; separator=\"\\n\") as ?agent_labels) (group_concat(distinct str(?link); separator=\"\\n\") as ?link_vals) where { values ?_activity_multi_iri {} # the most recent still-current nanopub about this activity, published by somebody # holding a role in the project it belongs to { select ?np where { values ?_activity_multi_iri {} graph npa:graph { ?np npa:hasValidSignatureForPublicKeyHash ?pk0 ; np:hasAssertion ?a0 ; np:hasPublicationInfo ?pi0 . filter not exists { ?inv0 npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pk0 . } filter not exists { ?sup0 npx:supersedes ?np . } } graph ?a0 { ?_activity_multi_iri a obo:OBI_0000066 ; dct:isPartOf ?project0 . } graph npa:graph { ?mnp0 np:hasAssertion ?ma0 . filter not exists { ?msup0 npx:supersedes ?mnp0 . } } graph ?ma0 { ?project0 ?mrel0 ?member0 . values ?mrel0 { gen:hasAdmin gen:hasProjectLead ff:has-principal-investigator ff:has-participant ff:has-data-steward } } graph ?pi0 { ?np dct:creator ?member0 ; dct:created ?created . } } order by desc(?created) limit 1 } graph npa:graph { ?np np:hasAssertion ?a ; np:hasPublicationInfo ?pi ; np:hasProvenance ?prov . } optional { graph ?a { ?_activity_multi_iri dct:description ?description } } optional { graph ?a { ?_activity_multi_iri a ?kind } filter(?kind != obo:OBI_0000066) optional { graph ?pi { ?kind rdfs:label ?kindL } } } optional { graph ?a { ?_activity_multi_iri dct:isPartOf ?project } optional { graph ?pi { ?project nt:hasLabelFromApi ?project_label } } } optional { graph ?a { ?_activity_multi_iri prov:wasAssociatedWith ?agent } optional { graph ?pi { ?agent foaf:name ?agentName } } } optional { graph ?a { ?_activity_multi_iri rdfs:seeAlso ?link } } optional { graph ?pi { ?np rdfs:label ?npT } } } group by ?np ?project ?project_label ?description } bind(exists { graph npa:graph { ?anp npa:hasValidSignatureForPublicKeyHash ?apk ; np:hasAssertion ?aa . filter not exists { ?ainv npx:invalidates ?anp ; npa:hasValidSignatureForPublicKeyHash ?apk . } filter not exists { ?asup npx:supersedes ?anp . } } graph ?aa { ?approver npx:approvesOf ?np } } as ?isApproved) values (?key ?Property_noheader ?Property_label) { ('Kind' rdf:type 'Kind:') ('Desc' dct:description 'Description:') ('Project' dct:isPartOf 'Part of:') ('Who' prov:wasAssociatedWith 'Conducted by:') ('Link' rdfs:seeAlso 'More information:') ('Status' npx:approvesOf 'Status:') ('Source' dct:source 'Source:') } bind(if(?key = 'Kind', ?kind_vals, if(?key = 'Desc', str(?description), if(?key = 'Project', str(?project), if(?key = 'Who', ?agent_vals, if(?key = 'Link', ?link_vals, if(?key = 'Status', if(?isApproved, \"approved\", \"not approved\"), str(?np))))))) as ?rawVal) filter(bound(?rawVal) && ?rawVal != \"\") bind(?rawVal as ?Value_multi_val_noheader) bind(if(?key = 'Kind', ?kind_labels, if(?key = 'Project', coalesce(?project_label, \"\"), if(?key = 'Who', ?agent_labels, if(?key = 'Source', coalesce(?npTitle, \"\"), \"\")))) as ?Value_label_multi) bind(if(?key = 'Source', str(?np), ?nothing) as ?target_np) bind(if(?key = 'Status' && !?isApproved, str(?np), \"\") as ?approve_target) } order by (if(?key = 'Kind', 1, if(?key = 'Desc', 2, if(?key = 'Project', 3, if(?key = 'Who', 4, if(?key = 'Link', 5, if(?key = 'Status', 6, 7)))))))""" . } 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-08-17T12:59:41Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:get-activity-info; rdfs:label "Get basic information about an activity"; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , , , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "ITtzdvifEUlVUl9oHu54iVwWtfx19XSYCFaKx8rHZL7kOkbrHRv4mBhJZZhM0b2cfOXGuyC+PNFhZp66JiyRo8OPtQPSKQao5/jNBUrCzvK+Ts0WnqQz4nTTtB4Bx8sTWslc90APR6x0gIGtv9Nnx2pn3Wxkuvw1osSF0Dvfy0w="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }