@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rdf4j: <http://rdf4j.org/schema/rdf4j#> .
@prefix sesame: <http://www.openrdf.org/schema/sesame#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .

<http://purl.uniprot.org/unirules/MF_01365#construct> a <http://www.w3.org/ns/shacl#SPARQLRule>,
    <http://spinrdf.org/sp#Construct>;
  <https://hamap.expasy.org/rdf/vocab#addsTriple> <http://purl.uniprot.org/unirules/MF_01365#construct-template-12>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-13>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-6>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-7>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-30>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-10>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-0>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-2>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-29>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-28>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-39>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-4>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-24>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-15>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-19>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-25>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-20>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-21>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-14>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-26>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-37>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-17>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-18>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-16>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-35>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-8>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-11>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-23>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-1>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-38>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-9>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-22>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-36>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-33>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-27>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-34>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-5>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-32>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-3>,
    <http://purl.uniprot.org/unirules/MF_01365#construct-template-31>, <http://purl.uniprot.org/unirules/MF_01365#construct-template-40>;
  <http://www.w3.org/ns/shacl#prefixes> <http://purl.uniprot.org/unirules/>;
  <http://spinrdf.org/sp#where> <http://purl.uniprot.org/unirules/MF_01365#construct-where-list-0>;
  <http://spinrdf.org/sp#templates> <http://purl.uniprot.org/unirules/MF_01365#construct-template-list-0>;
  <http://www.w3.org/ns/shacl#construct> """CONSTRUCT {
  _:492662 up:source unirule:MF_01365 .
  _:492663 up:source unirule:MF_01365 .
  _:492664 up:source unirule:MF_01365 .
  _:492665 up:source unirule:MF_01365 .
  _:492666 up:source unirule:MF_01365 .
  _:492667 up:source unirule:MF_01365 .
  _:492668 up:source unirule:MF_01365 .
  _:492669 up:source unirule:MF_01365 .
  _:492670 up:source unirule:MF_01365 .
  _:492671 up:source unirule:MF_01365 .
  ?this up:annotation ?annotation0 ;
    up:classifiedWith GO:0006412 ,
      GO:0019843 ,
      keyword:687 ,
      keyword:689 ,
      keyword:694 ,
      keyword:699 .
  ?annotation0 a up:Similarity_Annotation ;
    rdfs:comment 'Belongs to the universal ribosomal protein uL6 family.' .
  ?case1 up:classifiedWith keyword:7 .
  ?case2 up:classifiedWith GO:0009507 .
  ?pfs8 up:annotation ?annotation9 .
  ?annotation9 faldo:begin ?pfsb10 ;
    faldo:end ?pfse11 ;
    rdf:type up:Modified_Residue_Annotation ;
    rdfs:comment 'N6-acetyllysine' .
  ?pfsb10 faldo:position ?thisPositionOn12 ;
    rdf:type faldo:ExactPosition .
  ?pfse11 faldo:position ?thisPositionOn13 ;
    rdf:type faldo:ExactPosition .
  _:492672 a rdf:Statement ;
    up:attribution _:492662 ;
    rdf:subject ?this ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation0 .
  _:492673 a rdf:Statement ;
    up:attribution _:492663 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:687 .
  _:492674 a rdf:Statement ;
    up:attribution _:492664 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:689 .
  _:492675 a rdf:Statement ;
    up:attribution _:492665 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:694 .
  _:492676 a rdf:Statement ;
    up:attribution _:492666 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:699 .
  _:492677 a rdf:Statement ;
    up:attribution _:492667 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object GO:0019843 .
  _:492678 a rdf:Statement ;
    up:attribution _:492668 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object GO:0006412 .
  _:492679 a rdf:Statement ;
    up:attribution _:492669 ;
    rdf:subject ?case1 ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:7 .
  _:492680 a rdf:Statement ;
    up:attribution _:492670 ;
    rdf:subject ?case2 ;
    rdf:predicate up:classifiedWith ;
    rdf:object GO:0009507 .
  _:492681 a rdf:Statement ;
    up:source unirule:MF_01365 ;
    rdf:subject ?pfs8 ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation9 .
  _:492682 a rdf:Statement ;
    up:attribution _:492671 ;
    rdf:subject ?pfs8 ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation9 .
}
WHERE {
  #baseURI: http://purl.uniprot.org/unirule/MF_01365
  #Rule MF_01365 Created by:? on:2006-11-06 Modified by:Andrea Auchincloss on:2023-09-22
  {
    ?this up:organism ?thisOrganism ;
      rdfs:seeAlso signature:MF_01365_B .
    ?thisOrganism rdfs:subClassOf+ taxon:2 .
  } UNION {
    ?this rdfs:seeAlso signature:MF_01365_B .
    {
      ?this up:encodedIn up:Plastid .
    } UNION {
      ?this up:encodedIn up:Chloroplast .
    }
  } UNION {
    ?this up:organism ?thisOrganism ;
      rdfs:seeAlso signature:MF_01365_A .
    ?thisOrganism rdfs:subClassOf+ taxon:2157 .
  }
  BIND(URI(CONCAT(STR(?this), '#MF_01365a0')) AS ?annotation0) .
  OPTIONAL {
    ?this up:sequence ?thisSequence .
    ?thisSequence rdf:value ?thisSequenceValue .
    ?templateMotifMatch19 faldo:location ?templateMotifSequenceMatchRegionP0AG5520 ;
      edam:is_output_of ?templateMotifSequenceProfileAlignmentOperationP0AG5522 ;
      rdf:type edam:data_0869 ;
      rdf:value ?templateMotifCigarP0AG55MF_01365_B15 .
    ?templateMotifSequenceMatchRegionP0AG5520 faldo:begin ?templateMotifSequenceMatchBeginP0AG5521 .
    ?templateMotifSequenceMatchBeginP0AG5521 faldo:position ?templateMotifSequenceMatchBeginPositionP0AG5516 ;
      faldo:reference isoform:P0AG55-1 .
    ?templateMotifSequenceProfileAlignmentOperationP0AG5522 edam:has_input signature:MF_01365_B ;
      rdf:type edam:operation_0300 .
    ?targetMotifMatch23 faldo:location ?targetMotifMatchRegionMatch24 ;
      edam:is_output_of ?targetMotifSequenceAlignmentOperationMF_01365_B26 ;
      rdf:type edam:data_0869 ;
      rdf:value ?targetMotifMatchCigarP0AG55MF_01365_B17 .
    ?targetMotifMatchRegionMatch24 faldo:begin ?targetMotifMatchRegionMatchBeginMF_01365_B25 .
    ?targetMotifMatchRegionMatchBeginMF_01365_B25 faldo:position ?targetMotifMatchRegionMatchBeginPositionMF_01365_B18 ;
      faldo:reference ?thisSequence .
    ?targetMotifSequenceAlignmentOperationMF_01365_B26 edam:has_input signature:MF_01365_B ;
      rdf:type edam:operation_0300 .
    BIND(?this AS ?tagFT_1) .
    VALUES ?supertaxon14 {taxon:620 taxon:561}
    ?this up:organism ?thisOrganism .
    ?thisOrganism rdfs:subClassOf+ ?supertaxon14 .
    BIND(STRLEN(REPLACE(SUBSTR(?templateMotifCigarP0AG55MF_01365_B15, 1, (STRLEN(?templateMotifCigarP0AG55MF_01365_B15) - STRLEN(REPLACE(?templateMotifCigarP0AG55MF_01365_B15, CONCAT('^(?:-*[^-]){', STR(((44 - ?templateMotifSequenceMatchBeginPositionP0AG5516) + 1)), '}'), '')))), '[a-z]', '')) AS ?step127) .
    BIND((STRLEN(SUBSTR(?targetMotifMatchCigarP0AG55MF_01365_B17, 1, (STRLEN(?targetMotifMatchCigarP0AG55MF_01365_B17) - STRLEN(REPLACE(?targetMotifMatchCigarP0AG55MF_01365_B17, CONCAT('^(?:[a-z]*(?:[A-Z]|-)){', STR(?step127), '}'), ''))))) - STRLEN(REPLACE(SUBSTR(?targetMotifMatchCigarP0AG55MF_01365_B17, 1, (STRLEN(?targetMotifMatchCigarP0AG55MF_01365_B17) - STRLEN(REPLACE(?targetMotifMatchCigarP0AG55MF_01365_B17, CONCAT('^(?:[a-z]*(?:[A-Z]|-)){', STR(?step127), '}'), '')))), '[^-]', ''))) AS ?step228) .
    BIND(((?step228 + ?targetMotifMatchRegionMatchBeginPositionMF_01365_B18) - 1) AS ?thisPositionOn12) .
    BIND(?thisPositionOn12 AS ?thisPositionOn13) .
    BIND(?this AS ?pfs1t29) .
    BIND(URI(CONCAT(STR(?thisSequence), '#position', STR(?thisPositionOn12))) AS ?pfsb10) .
    BIND(URI(CONCAT(STR(?thisSequence), '#position', STR(?thisPositionOn13))) AS ?pfse11) .
    FILTER ((SUBSTR(?thisSequenceValue, ?thisPositionOn12, 1) = 'K')) .
    BIND(URI(CONCAT(STR(?this), '#MF_01365a9')) AS ?annotation9) .
    BIND(?this AS ?pfs8) .
  }
  OPTIONAL {
    ?this a up:Protein .
    BIND(?this AS ?caseWithTag30) .
  }
  BIND(IF(BOUND(?tagFT_1), ?caseWithTag30, ?UNBOUND_VARIABLE) AS ?case1) .
  OPTIONAL {
    ?this a up:Protein .
    {
      ?this up:encodedIn up:Plastid .
    } UNION {
      ?this up:encodedIn up:Chloroplast .
    }
    BIND(?this AS ?case2) .
  }
  OPTIONAL {
    ?this a up:Protein .
    FILTER (! (EXISTS {
      {
        ?this up:encodedIn up:Plastid .
      } UNION {
        ?this up:encodedIn up:Chloroplast .
      }
    })) .
    BIND(?this AS ?case3) .
  }
  OPTIONAL {
    ?this a up:Protein .
    ?this up:organism ?thisOrganism .
    ?thisOrganism rdfs:subClassOf+ taxon:2157 .
    BIND(?this AS ?case4) .
  }
  OPTIONAL {
    ?this a up:Protein .
    ?this up:organism ?thisOrganism .
    ?thisOrganism rdfs:subClassOf+ taxon:1117 .
    BIND(?this AS ?case5) .
  }
  OPTIONAL {
    ?this a up:Protein .
    ?this up:organism ?thisOrganism .
    ?thisOrganism rdfs:subClassOf+ taxon:2 .
    FILTER (! (EXISTS {
      ?thisOrganism rdfs:subClassOf+ taxon:1117 .
    })) .
    BIND(?this AS ?case6) .
  }
  OPTIONAL {
    ?this a up:Protein .
    ?this up:organism ?thisOrganism .
    {
      ?this up:encodedIn up:Plastid .
    } UNION {
      ?this up:encodedIn up:Chloroplast .
    }
    FILTER (! (EXISTS {
      VALUES ?supertaxon31 {taxon:2157 taxon:2}
      ?thisOrganism rdfs:subClassOf+ ?supertaxon31 .
    })) .
    BIND(?this AS ?case7) .
  }
}
""" .

<http://purl.uniprot.org/unirules/MF_01365> <http://www.w3.org/ns/shacl#rule> <http://purl.uniprot.org/unirules/MF_01365#construct> .
