@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-use-cases-with-examples a grlc:grlc-query; dct:description "This query returns the use cases (categories) declared for a given entity (a Space or Maintained Resource), together with the concrete examples attached to each use case. Only the latest valid version of each use case definition is considered."; dct:license ; rdfs:label "Get use cases with examples for a resource"; grlc:endpoint ; grlc:sparql """prefix rdf: prefix rdfs: prefix dct: prefix schema: prefix np: prefix npa: prefix npx: prefix gen: prefix nt: select ?usecase ?usecase_label ?comment ?topic ?topic_label ?examples_multi_iri ?examples_label_multi (?usecase as ?usecase_ref) ?np (\"^\" as ?np_label) where { { select ?usecase (iri(strafter(max(concat(str(?date), \" \", str(?np0))), \" \")) as ?np) where { graph npa:graph { ?np0 npx:hasNanopubType gen:UseCase . ?np0 npa:hasValidSignatureForPublicKeyHash ?pubkey . filter not exists { ?npi npx:invalidates ?np0 ; npa:hasValidSignatureForPublicKeyHash ?pubkey . } filter not exists { ?np0 npx:hasNanopubType npx:ExampleNanopub . } ?np0 dct:created ?date . ?np0 np:hasAssertion ?a0 . } values ?_entity_multi_iri {} graph ?a0 { ?usecase rdfs:subClassOf gen:UseCase . ?usecase gen:isUseCaseFor ?_entity_multi_iri . } } group by ?usecase } graph npa:graph { ?np np:hasAssertion ?a . ?np np:hasPublicationInfo ?pi . } optional { graph ?a { ?usecase rdfs:label ?usecase_label . } } optional { graph ?a { ?usecase rdfs:comment ?comment . } } optional { graph ?a { ?usecase schema:about ?topic . } } optional { graph ?pi { ?topic nt:hasLabelFromApi ?topic_label . } } optional { { select ?usecase (group_concat(str(?example); separator=\" \") as ?examples_multi_iri) (group_concat(?exlabel_esc; separator=\"\\n\") as ?examples_label_multi) where { { select ?usecase ?example (coalesce(min(?exl), str(?example)) as ?exlabel) where { graph npa:graph { ?exnp npx:hasNanopubType gen:UseCase . ?exnp npa:hasValidSignatureForPublicKeyHash ?expubkey . filter not exists { ?exnpi npx:invalidates ?exnp ; npa:hasValidSignatureForPublicKeyHash ?expubkey . } filter not exists { ?exnp npx:hasNanopubType npx:ExampleNanopub . } ?exnp np:hasAssertion ?exa . } graph ?exa { ?example rdf:type ?usecase . } optional { graph ?exa { ?example rdfs:label ?exl . } } } group by ?usecase ?example } bind(replace(replace(str(?exlabel), \"\\\\\\\\\", \"\\\\\\\\\\\\\\\\\"), \"[\\r\\n]+\", \"\\\\\\\\n\") as ?exlabel_esc) } group by ?usecase } } } order by ?usecase_label""" . } 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-07-30T10:35:13Z"^^xsd:dateTime; dct:creator orcid:0000-0002-1267-0234; dct:license ; npx:embeds sub:get-use-cases-with-examples; rdfs:label "Get use cases with examples for a resource"; nt:wasCreatedFromProvenanceTemplate ; nt:wasCreatedFromPubinfoTemplate , , ; nt:wasCreatedFromTemplate . sub:sig npx:hasAlgorithm "RSA"; npx:hasPublicKey "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB"; npx:hasSignature "WFQft1mLmoCw99TGnVzbUrisEAqlsvMLbT/AcNa56tGFlSr9zfr7Oi6hsTGs2VwvIhzwAXQ6coiEiW9q58Uj9BZilniAhlMRuBM1xaMiZcnyGDl1HhFhpYucVe0+PnrTnXhj/r/Agt9GX9mZnlIADEJ86dW6mqUNBY1Say6Zf4M="; npx:hasSignatureTarget this:; npx:signedBy orcid:0000-0002-1267-0234 . }