@prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:27 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Find all names associated with UniProtKB entry P05067, and if the name is associated with the entry it's domains or its components"@en ,
   "Retrieve all protein names, including peptide names, associated with UniProtKB entry P05067."@en;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX up: <http://purl.uniprot.org/core/>

SELECT
  ?protein
  ?anyKindOfName 
  ?names 
  ?partType
WHERE
{
  BIND(<http://purl.uniprot.org/uniprot/P05067> AS ?protein)
  ?protein a up:Protein .
  {
    ?protein (up:recommendedName|up:alternativeName) ?structuredName .
  }
    UNION
  {
    VALUES(?partType){(up:domain) (up:component)}
    ?protein ?partType ?part .
    ?part (up:recommendedName|up:alternativeName) ?structuredName .
  }
  ?structuredName ?anyKindOfName  ?names .
  ?anyKindOfName rdfs:subPropertyOf up:structuredNameType .
}""" ;
schema:keywords "protein name", "peptide name" ;
schema:target <https://sparql.uniprot.org/sparql/> .

