Returns key-value facts for display on a project page (a gen:Project, which is also a gen:Space): its description, start date, end date, project lead(s), and admins. Description and dates are read from the project's latest non-invalidated definition nanopub. Project leads are the validated holders of the project-lead role (gen:hasRole .../projectLeadRole) and admins are the validated admins (npa:hasRoleType gen:AdminRole) of the project, both resolved via the spaces repository. Each property occupies one row; the Value column is a multi-value cell so properties with several values (multiple leads or admins) list them all in a single row. Both columns use the '_noheader' convention so the redundant header row is dropped.
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> prefix dct: <http://purl.org/dc/terms/> prefix schema: <http://schema.org/> prefix foaf: <http://xmlns.com/foaf/0.1/> prefix np: <http://www.nanopub.org/nschema#> prefix npa: <http://purl.org/nanopub/admin/> prefix npx: <http://purl.org/nanopub/x/> prefix gen: <https://w3id.org/kpxl/gen/terms/> select distinct ?Property_noheader ?Property_label ?Value_multi_val_noheader ?Value_label_multi where { values ?_resource_multi_iri {} graph npa:graph { ?np npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pubkey ; np:hasAssertion ?a . filter not exists { ?inv npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } } graph ?a { ?_resource_multi_iri a gen:Project } optional { select (group_concat(distinct ?descEsc; separator="\n") as ?descVal) where { values ?_resource_multi_iri {} graph npa:graph { ?npd npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pkd ; np:hasAssertion ?ad . filter not exists { ?invd npx:invalidates ?npd ; npa:hasValidSignatureForPublicKeyHash ?pkd . } } graph ?ad { ?_resource_multi_iri dct:description ?desc . } bind(replace(replace(str(?desc), "\\\\", "\\\\\\\\"), "[\r\n]+", "\\\\n") as ?descEsc) } having (count(?desc) > 0) } optional { select (group_concat(distinct substr(str(?sd), 1, 10); separator="\n") as ?startVal) where { values ?_resource_multi_iri {} graph npa:graph { ?nps npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pks ; np:hasAssertion ?asd . filter not exists { ?invs npx:invalidates ?nps ; npa:hasValidSignatureForPublicKeyHash ?pks . } } graph ?asd { ?_resource_multi_iri schema:startDate ?sd . } } having (count(?sd) > 0) } optional { select (group_concat(distinct substr(str(?ed), 1, 10); separator="\n") as ?endVal) where { values ?_resource_multi_iri {} graph npa:graph { ?npe npx:introduces ?_resource_multi_iri ; npa:hasValidSignatureForPublicKeyHash ?pke ; np:hasAssertion ?aed . filter not exists { ?inve npx:invalidates ?npe ; npa:hasValidSignatureForPublicKeyHash ?pke . } } graph ?aed { ?_resource_multi_iri schema:endDate ?ed . } } having (count(?ed) > 0) } optional { select (group_concat(?lead2; separator="\n") as ?leadVal) (group_concat(?leadName; separator="\n") as ?leadLabel) where { select distinct ?lead2 ?leadName where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?g . } graph ?g { ?ri a gen:RoleInstantiation ; npa:forSpace ?_resource_multi_iri ; gen:hasRole <https://w3id.org/np/RAei8Dr3uv5mhWDfkgmX39wbhFe_1fsF_zFBrzYt94LZQ/projectLeadRole> ; npa:forAgent ?lead . } optional { graph ?g { ?lead foaf:name ?leadName0 . } } } bind(coalesce(?leadName0, str(?lead)) as ?leadName) bind(str(?lead) as ?lead2) } } having (count(?lead2) > 0) } optional { select (group_concat(?admin2; separator="\n") as ?adminVal) (group_concat(?adminName; separator="\n") as ?adminLabel) where { select distinct ?admin2 ?adminName where { values ?_resource_multi_iri {} service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> { graph npa:graph { <http://purl.org/nanopub/admin/thisRepo> npa:hasCurrentSpaceState ?g . } graph ?g { ?ri2 a gen:RoleInstantiation ; npa:forSpace ?_resource_multi_iri ; npa:hasRoleType gen:AdminRole ; npa:forAgent ?admin . } optional { graph ?g { ?admin foaf:name ?adminName0 . } } } bind(coalesce(?adminName0, str(?admin)) as ?adminName) bind(str(?admin) as ?admin2) } } having (count(?admin2) > 0) } values (?key ?Property_noheader ?Property_label) { ('Description' dct:description 'Description:') ('StartDate' schema:startDate 'Start Date:') ('EndDate' schema:endDate 'End Date:') ('Lead' gen:hasProjectLead 'Project Lead:') ('Admins' gen:hasAdmin 'Admins:') } bind(if(?key='Description', ?descVal, if(?key='StartDate', ?startVal, if(?key='EndDate', ?endVal, if(?key='Lead', ?leadVal, ?adminVal)))) as ?Value_multi_val_noheader) filter(bound(?Value_multi_val_noheader)) bind(if(?key='Lead', ?leadLabel, if(?key='Admins', ?adminLabel, '')) as ?Value_label_multi) } order by (if(?key='Description', 1, if(?key='StartDate', 2, if(?key='EndDate', 3, if(?key='Lead', 4, 5)))))