Nanopublication

< Home

ID

https://w3id.org/np/RAO_Zx86Dtliwpz1liEw8-1LGfnmj7HAG1GD-L1tZCsYQ

Formats

.trig | .trig.txt | .jelly | .jelly.txt | .jsonld | .jsonld.txt | .nq | .nq.txt | .xml | .xml.txt

Content

@prefix this: <https://w3id.org/np/RAO_Zx86Dtliwpz1liEw8-1LGfnmj7HAG1GD-L1tZCsYQ> .
@prefix sub: <https://w3id.org/np/RAO_Zx86Dtliwpz1liEw8-1LGfnmj7HAG1GD-L1tZCsYQ/> .
@prefix np: <http://www.nanopub.org/nschema#> .
@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 rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix orcid: <https://orcid.org/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .

sub:Head {
  this: a np:Nanopublication;
    np:hasAssertion sub:assertion;
    np:hasProvenance sub:provenance;
    np:hasPublicationInfo sub:pubinfo .
}

sub:assertion {
  sub:get-subclasses-simple a <https://w3id.org/kpxl/grlc/grlc-query>;
    dct:description "This query returns the sub-classes of the given class, restricted to sub-classes that are part of the same space and published by admins, maintainers, or members of that space.";
    dct:license <http://www.apache.org/licenses/LICENSE-2.0>;
    rdfs:label "Get sub-classes for class (from space members)";
    <https://w3id.org/kpxl/grlc/endpoint> <https://w3id.org/np/l/nanopub-query-1.1/repo/full>;
    <https://w3id.org/kpxl/grlc/sparql> """prefix owl: <http://www.w3.org/2002/07/owl#>
prefix dct: <http://purl.org/dc/terms/>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix np: <http://www.nanopub.org/nschema#>
prefix npa: <http://purl.org/nanopub/admin/>
prefix npx: <http://purl.org/nanopub/x/>
prefix nt: <https://w3id.org/np/o/ntemplate/>
prefix gen: <https://w3id.org/kpxl/gen/terms/>

select ?subclass (coalesce(min(?untaggedLabel), min(?anyLabel)) as ?subclass_label) ?date ?np where {
  # the resource/ontology that the given (parent) class belongs to
  graph ?pg { ?_class_iri dct:isPartOf ?resource . }
  # collect the public keys of admins, maintainers, and members of the space maintaining that resource
  service <https://w3id.org/np/l/nanopub-query-1.1/repo/spaces> {
    select ?resource (group_concat(?mpk; separator=\" \") as ?memberPubkeys) where {
      graph npa:graph { npa:thisRepo npa:hasCurrentSpaceState ?stateG . }
      graph ?stateG {
        ?resource npa:isMaintainedBy? ?space .
        ?ri a gen:RoleInstantiation ; npa:forSpace ?space ; npa:forAgent ?agent ; npa:hasRoleType ?rt .
        filter(?rt in (gen:AdminRole, gen:MaintainerRole, gen:MemberRole))
        ?acct a npa:AccountState ; npa:agent ?agent ; npa:pubkey ?mpk .
      }
    } group by ?resource
  }
  # sub-classes of the given class, that are part of the same resource and signed by a space member
  graph ?g {
    ?subclass rdfs:subClassOf ?_class_iri .
    ?subclass dct:isPartOf ?resource .
  }
  graph npa:graph {
    ?np npa:hasValidSignatureForPublicKeyHash ?pubkey .
    filter not exists { ?npx npx:invalidates ?np ; npa:hasValidSignatureForPublicKeyHash ?pubkey . }
    ?np npa:hasGraph ?g .
    ?np np:hasPublicationInfo ?i .
    ?np dct:created ?date .
  }
  filter(contains(?memberPubkeys, ?pubkey))
  optional { graph ?g {  ?subclass rdfs:label ?subclassLabel1 . } }
  optional { graph ?g {  ?subclass dct:title ?subclassLabel2 . } }
  optional { graph ?i {  ?subclass rdfs:label ?subclassLabel3 . } }
  optional { graph ?i {  ?subclass nt:hasLabelFromApi ?subclassLabel4 . } }
  bind(coalesce(?subclassLabel1, ?subclassLabel2, ?subclassLabel3, ?subclassLabel4) as ?anyLabel)
  bind(if(lang(?anyLabel) = \"\", ?anyLabel, ?noLabel) as ?untaggedLabel)
}
group by ?subclass ?date ?np
order by desc(?date)""" .
}

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-15T06:13:33Z"^^xsd:dateTime;
    dct:creator orcid:0000-0002-1267-0234;
    dct:license <https://creativecommons.org/licenses/by/4.0/>;
    npx:embeds sub:get-subclasses-simple;
    prov:wasDerivedFrom <https://w3id.org/np/RA4s708TGiO6GXcj7kT2uSgiR72ZKOFqSflgxdHo4F3ZU>,
      <https://w3id.org/np/RAVitiGYYPFRelvHI2BnNdI6PHEGdbMoC23HqICDiAxGw>;
    nt:wasCreatedFromProvenanceTemplate <https://w3id.org/np/RA7lSq6MuK_TIC6JMSHvLtee3lpLoZDOqLJCLXevnrPoU>;
    nt:wasCreatedFromPubinfoTemplate <https://w3id.org/np/RA0J4vUn_dekg-U1kK3AOEt02p9mT2WO03uGxLDec1jLw>,
      <https://w3id.org/np/RARW4MsFkHuwjycNElvEVtuMjpf4yWDL10-0C5l2MqqRQ>, <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 "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwUtewGCpT5vIfXYE1bmf/Uqu1ojqnWdYxv+ySO80ul8Gu7m8KoyPAwuvaPj0lvPtHrg000qMmkxzKhYknEjq8v7EerxZNYp5B3/3+5ZpuWOYAs78UnQVjbHSmDdmryr4D4VvvNIiUmd0yxci47dTFUj4DvfHnGd6hVe5+goqdcwIDAQAB";
    npx:hasSignature "jxywuMBc4w1nfJtWYPWMYu84V++UfJf7cytuj3ru9maHk+VWSY+r2a84GPNg1XwI2KahmS80LPXCvzm/bXQuJinyAni7sFE1HKPbWf1Yz1TY2t+sygXvREkzwaqM8Lqu9j8/oTYShTX/VGrISUjchdirx9Z+lTt9P97cP5Spbw8=";
    npx:hasSignatureTarget this:;
    npx:signedBy orcid:0000-0002-1267-0234 .
}