@prefix this: . @prefix sub: . @prefix np: . @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-space-info a ; dct:description "Returns basic key-value facts about a given space (type, alternative IDs, start and end date for time-limited spaces, and the latest and root definition nanopubs). The space's latest-definition nanopub is passed in as the 'spaceNp' parameter; type, alternative IDs and dates are read from that definition, and its space-ref's root definition is resolved from the spaces repository. This scopes every fact to a single space-ref (identity = space IRI + root definition), so spaces whose IRI is claimed by several refs no longer mix. Type can carry multiple values (one row each). Alternative IDs are concatenated into a single HTML cell holding a comma-separated list of links (a span wrapping one anchor per ID), computed in a separate subquery so it stays clear of the spaces-repo SERVICE join. Both columns use the '_noheader' convention so the redundant header row is dropped."; dct:license ; rdfs:label "Get space info"; ; """prefix rdf: prefix rdfs: prefix dct: prefix np: prefix npa: prefix npx: prefix schema: prefix owl: prefix gen: select distinct ?Property_noheader ?Property_label ?Value_noheader ?Value_label where { values ?_space_multi_iri {} graph npa:graph { ?_spaceNp_iri np:hasAssertion ?a . } graph ?a { ?_space_multi_iri a gen:Space . } optional { graph ?a { ?_space_multi_iri a ?typeIri . filter(?typeIri != gen:Space) } } optional { graph ?a { ?_space_multi_iri schema:startDate ?startVal } } optional { graph ?a { ?_space_multi_iri schema:endDate ?endVal } } optional { select (concat('', group_concat(?anchor; separator=', '), '') as ?altHtml) where { values ?_space_multi_iri {} graph npa:graph { ?_spaceNp_iri np:hasAssertion ?asub . } graph ?asub { ?_space_multi_iri owl:sameAs ?altVal . } bind(concat('', str(?altVal), '') as ?anchor) } having (count(?altVal) > 0) } optional { service { graph npa:spacesGraph { ?def npa:viaNanopub ?_spaceNp_iri ; npa:forSpaceRef ?ref . ?ref npa:rootNanopub ?rootNp . } } } values (?key ?Property_noheader ?Property_label) { ('Type' rdf:type 'Type:') ('Alternative IDs' owl:sameAs 'Alternative IDs:') ('Start date' schema:startDate 'Start date:') ('End date' schema:endDate 'End date:') ('Latest definition' npa:viaNanopub 'Latest definition:') ('Root definition' gen:hasRootDefinition 'Root definition:') } bind(if(?key='Type', ?typeIri, if(?key='Alternative IDs', ?altHtml, if(?key='Start date', str(?startVal), if(?key='End date', str(?endVal), if(?key='Latest definition', ?_spaceNp_iri, ?rootNp))))) as ?Value_noheader) filter(bound(?Value_noheader)) bind(if(?key='Type', replace(str(?typeIri), '^.*[/#]', ''), if(?key='Latest definition', substr(strafter(str(?_spaceNp_iri), '/np/'), 1, 10), if(?key='Root definition', substr(strafter(str(?rootNp), '/np/'), 1, 10), ''))) as ?Value_label) } order by (if(?key='Type', 1, if(?key='Alternative IDs', 2, if(?key='Start date', 3, if(?key='End date', 4, if(?key='Latest definition', 5, 6))))))""" . } 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-06-16T08:36:38Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:get-space-info; npx:supersedes ; rdfs:label "Get space info"; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "Aoyrd16rZ6DfeyCfuC7VefIATgUJPWaqdNGGKMwJuVyjuiVUTGkh6rOttNFldmuJ47cEIVfLi1dZU2U8E2SWetWoCapbAh31hzagW5r+M/xFfm7WfBvkP8TOYaoaeK0VUE71naCulVNQLgq7mLUk0K5CCVcV294XvlG3gUr/14I="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }