sub:assertion {
sub:get-planned-event-attendances dct:description "This query returns the events the given user plans to attend." ;
dct:license <
http://www.apache.org/licenses/LICENSE-2.0> ;
a <
https://w3id.org/kpxl/grlc/grlc-query> ;
rdfs:label "Get planned event attendances" ;
<
https://w3id.org/kpxl/grlc/endpoint> <
https://w3id.org/np/l/nanopub-query-1.1/repo/type/e0c10d8a3e60586806c4b357bb4767f6c71c162e061be85cfe165eaf18b13f2f> ;
<
https://w3id.org/kpxl/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/>
select ?event ?event_label ?date ?np (\"^\" as ?np_label) where {
graph npa:graph {
?np npx:hasNanopubType gen:plansToAttend .
?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
?np npx:signedBy ?_user_iri .
?np np:hasAssertion ?a .
}
graph ?a {
?_user_iri gen:plansToAttend ?event .
optional { ?event rdfs:label ?event_label }
optional { ?event dct:date ?date1 }
}
optional {
bind(iri(concat(\"https://w3id.org/np/l/nanopub-query-1.1/repo/type/\", sha256(str(gen:Space)))) as ?space_repo)
service ?space_repo {
graph npa:graph {
?nps npx:introduces ?event .
?nps npa:hasValidSignatureForPublicKeyHash ?pks .
filter not exists { ?npsx npx:invalidates ?nps ; npa:hasValidSignatureForPublicKeyHash ?pks . }
?nps np:hasAssertion ?as .
}
graph ?as {
?event schema:startDate ?datetime .
bind(xsd:date(substr(str(?datetime), 0, 11)) as ?date2)
}
}
}
bind(coalesce(?date1, ?date2) as ?date)
} order by desc(?date)""" .
}