https://w3id.org/np/RAozJCi7NW0GTH0SsymoGS_gfUgHMJEBMJ5FQjZfainM0
.trig | .trig.txt | .jelly | .jelly.txt | .jsonld | .jsonld.txt | .nq | .nq.txt | .xml | .xml.txt
@prefix this: <https://w3id.org/np/RAozJCi7NW0GTH0SsymoGS_gfUgHMJEBMJ5FQjZfainM0> .
@prefix sub: <https://w3id.org/np/RAozJCi7NW0GTH0SsymoGS_gfUgHMJEBMJ5FQjZfainM0/> .
@prefix np: <http://www.nanopub.org/nschema#> .
@prefix grlc: <https://w3id.org/kpxl/grlc/> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix nt: <https://w3id.org/np/o/ntemplate/> .
@prefix npx: <http://purl.org/nanopub/x/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix orcid: <https://orcid.org/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
sub:Head {
this: a np:Nanopublication;
np:hasAssertion sub:assertion;
np:hasProvenance sub:provenance;
np:hasPublicationInfo sub:pubinfo .
}
sub:assertion {
sub:get-recent-and-upcoming-events-by-topic a grlc:grlc-query;
dct:description "Returns the recent, ongoing and upcoming events that are defined as Spaces, narrowed to those stating at least one of the given topics (dct:subject). The topic parameter is optional and can be given more than once: with none, every event is returned, whatever its topics and whether it has any. An event stating several of the given topics is listed once. Events starting on the same day are listed with overarching spaces before their sub-spaces.";
dct:license <http://www.apache.org/licenses/LICENSE-2.0>;
rdfs:label "Get recent and upcoming events by topic";
grlc:endpoint <https://w3id.org/np/l/nanopub-query-1.1/repo/type/8ad572d99071cc1ba0c16e54087b43594bdd9e8b2cfb62d2a0b16945fc49e53c>;
grlc:sparql """prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix dct: <http://purl.org/dc/terms/>
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/>
prefix schema: <http://schema.org/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>
select ?event ?event_label ?status ?date ?np (\"^\" as ?np_label) where {
values ?__topic_multi_iri {}
graph npa:graph {
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
filter not exists { ?np npx:hasNanopubType npx:ExampleNanopub . }
?np npx:introduces ?event .
?np np:hasAssertion ?a .
?np dct:created ?npDate .
filter not exists {
?np2 npx:introduces ?event .
?np2 npa:hasValidSignatureForPublicKeyHash ?pubkey2 .
filter not exists { ?npx2 npx:invalidates ?np2 ; npa:hasValidSignatureForPublicKeyHash ?pubkey2 . }
?np2 dct:created ?npDate2 .
filter(?npDate2 > ?npDate)
}
}
graph ?a {
?event a gen:Space .
?event a gen:Event .
?event rdfs:label ?event_label .
?event schema:startDate ?datetime .
optional { ?event schema:endDate ?endDatetime . }
optional { ?event dct:subject ?topic . }
}
filter(!bound(?__topic_multi_iri) || ?topic = ?__topic_multi_iri)
bind(if(exists { graph ?a { ?event gen:isSubSpaceOf ?parentSpace . } }, 1, 0) as ?subSpaceOrder)
bind(xsd:date(substr(str(?datetime), 0, 11)) as ?date)
bind(xsd:date(substr(str(now()), 0, 11)) as ?today)
optional { bind(xsd:date(substr(str(?endDatetime), 0, 11)) as ?endDate) }
bind(if(bound(?endDate), ?endDate, ?date) as ?effectiveEnd)
filter(?date >= ?today || ?effectiveEnd >= ?today - \"P7D\"^^xsd:duration)
bind(if(?effectiveEnd < ?today, 1, if(?date > ?today, 3, 2)) as ?statusOrder)
bind(if(?date > ?today, \"upcoming\", if(?effectiveEnd >= ?today, \"ongoing\", \"recently concluded\")) as ?status)
}
group by ?event ?event_label ?status ?date ?np ?statusOrder ?subSpaceOrder
order by ?statusOrder ?date ?subSpaceOrder ?event_label""" .
}
sub:provenance {
sub:assertion prov:wasAttributedTo orcid:0000-0001-8492-0354 .
}
sub:pubinfo {
this: dct:created "2026-09-23T15:43:57Z"^^xsd:dateTime;
dct:creator orcid:0000-0001-8492-0354;
dct:license <https://creativecommons.org/licenses/by/4.0/>;
npx:introduces sub:get-recent-and-upcoming-events-by-topic;
npx:supersedes <https://w3id.org/np/RAe6w4R0RvtAj1nfhcKcpifRoDWHq3EBdOnRf-Ds8Flno>;
rdfs:label "Get recent and upcoming events by topic";
skos:changeNote "Makes the topic parameter optional: with no topic given the query returns every event, as the unfiltered listing does, instead of nothing.";
nt:wasCreatedFromProvenanceTemplate <https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU>;
nt:wasCreatedFromPubinfoTemplate <https://w3id.org/np/RA0J4vUn_dekg-U1kK3AOEt02p9mT2WO03uGxLDec1jLw>,
<https://w3id.org/np/RAKc76yHLDbloE6ObluzYQsfX37v6qrZXbYeIKpe8-YUo>, <https://w3id.org/np/RAoTD7udB2KtUuOuAe74tJi1t3VzK0DyWS7rYVAq1GRvw>,
<https://w3id.org/np/RAukAcWHRDlkqxk7H2XNSegc1WnHI569INvNr-xdptDGI>;
nt:wasCreatedFromTemplate <https://w3id.org/np/RAEFAt-QcFK0ZhqfvlsmS10BnzGJA0xwOICZXkO-ai87k> .
sub:sig npx:hasAlgorithm "RSA";
npx:hasPublicKey "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+i9DV8ynzO944pYkYsDwtlqJHuk+b7FQt6Bb4TIQSDX3jGUURn6WpaNwESHmgMLWSydaH5XlabMzuqpPL4iyB+IAzvwIxdJBLhe39EQMu2j+FZ/5d/xu/gO3nZw2KoEvJ7cJisabuI05OylIRSJ+OG5CmzFxnjojUEJeCFi1njY1InhXrb0yHud9b1ifzweoN6YYOBecKs1gTOaT2bf+t4Wgzg3M0PmRVZ4F0OALsnh4T5+x7kFtiPcDKNpORi585JjKCZ4kczIF6oUKcwgC0kmIY97jtLqSLcXRkxHx5CDI6qz4XlRFs1ZbCUdSlzjdPZAkaBcNem1gIhWzkHkEnQIDAQAB";
npx:hasSignature "qUZGdUSPUOd5Pe597JoJsgM/qYITPDngP+IJeWnoTak7TPKHhtPanU53MeW75X/SOHpBo/Pfig1zn4CjaDy16eqEU1Q5dptQwauMxjpTKsBX67J7bb3ls0LDykHYPNBzJFKnADJL9au2zs0aaA0O7o+nkL7aIi6bytm+0nW3wNZucOXUAznMNHAQarnxwt9ThIiigPInbP4qnamLkMbG7EjewZzriSatzPPJZFDjti1T0FAWzyjTpoZy8AzLYY4DDeu9/fDEW3F+K32q0zYo1FPg7yXqhQREwWDcxFF3tPYNPYUj/bXyHB86R3c1EMNFQYSso1i+w3RSy+pIfI0IPA==";
npx:hasSignatureTarget this:;
npx:signedBy orcid:0000-0001-8492-0354 .
}