@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_01581#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_01581#construct-template-1>,
    <http://purl.uniprot.org/unirules/MF_01581#construct-template-5>, <http://purl.uniprot.org/unirules/MF_01581#construct-template-6>,
    <http://purl.uniprot.org/unirules/MF_01581#construct-template-4>, <http://purl.uniprot.org/unirules/MF_01581#construct-template-3>,
    <http://purl.uniprot.org/unirules/MF_01581#construct-template-2>, <http://purl.uniprot.org/unirules/MF_01581#construct-template-0>,
    <http://purl.uniprot.org/unirules/MF_01581#construct-template-7>, <http://purl.uniprot.org/unirules/MF_01581#construct-template-13>,
    <http://purl.uniprot.org/unirules/MF_01581#construct-template-14>, <http://purl.uniprot.org/unirules/MF_01581#construct-template-11>,
    <http://purl.uniprot.org/unirules/MF_01581#construct-template-12>, <http://purl.uniprot.org/unirules/MF_01581#construct-template-15>,
    <http://purl.uniprot.org/unirules/MF_01581#construct-template-10>, <http://purl.uniprot.org/unirules/MF_01581#construct-template-8>,
    <http://purl.uniprot.org/unirules/MF_01581#construct-template-9>;
  <http://www.w3.org/ns/shacl#prefixes> <http://purl.uniprot.org/unirules/>;
  <http://spinrdf.org/sp#where> <http://purl.uniprot.org/unirules/MF_01581#construct-where-list-0>;
  <http://spinrdf.org/sp#templates> <http://purl.uniprot.org/unirules/MF_01581#construct-template-list-0>;
  <http://www.w3.org/ns/shacl#construct> """CONSTRUCT {
  _:571028 up:source unirule:MF_01581 .
  _:571029 up:source unirule:MF_01581 .
  _:571030 up:source unirule:MF_01581 .
  ?this up:annotation ?annotation0 ;
    up:classifiedWith keyword:732 .
  ?annotation0 a up:Similarity_Annotation ;
    rdfs:comment 'Belongs to the UPF0482 family.' .
  ?sam3 up:classifiedWith keyword:732 .
  ?signal4 faldo:begin ?signalb5 ;
    faldo:end ?signale6 .
  ?signalb5 faldo:position ?signalbp7 .
  ?signale6 faldo:position ?signalep8 .
  ?keyword9 up:range ?signal4 .
  _:571031 a rdf:Statement ;
    up:attribution _:571028 ;
    rdf:subject ?this ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation0 .
  _:571032 a rdf:Statement ;
    up:attribution _:571029 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:732 .
  _:571033 a rdf:Statement ;
    up:attribution _:571030 ;
    rdf:subject ?sam3 ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:732 .
}
WHERE {
  #baseURI: http://purl.uniprot.org/unirule/MF_01581
  #Rule MF_01581 Created by:? on:2007-08-03 Modified by:Catherine Rivoire on:2016-10-19
  ?this up:organism ?thisOrganism ;
    rdfs:seeAlso signature:MF_01581 .
  ?thisOrganism rdfs:subClassOf+ taxon:91347 .
  BIND(URI(CONCAT(STR(?this), '#MF_01581a0')) AS ?annotation0) .
  OPTIONAL {
    ?this a up:Protein .
    VALUES ?supertaxon10 {taxon:561 taxon:620 taxon:590}
    ?this up:organism ?thisOrganism .
    ?thisOrganism rdfs:subClassOf+ ?supertaxon10 .
    BIND(?this AS ?case1) .
  }
  OPTIONAL {
    ?this a up:Protein .
    ?this up:organism ?thisOrganism .
    FILTER (! (EXISTS {
      VALUES ?supertaxon11 {taxon:561 taxon:620 taxon:590}
      ?thisOrganism rdfs:subClassOf+ ?supertaxon11 .
    })) .
    BIND(?this AS ?case2) .
  }
  OPTIONAL {
    ?this up:annotation ?samsignal12 ;
      up:sequence ?thisSequence .
    ?samsignal12 up:range ?samsignalr13 ;
      rdf:type up:Signal_Peptide_Annotation .
    ?samsignalr13 faldo:begin ?samsignalb14 ;
      faldo:end ?samsignale15 .
    ?samsignalb14 faldo:position ?samsignalbp16 ;
      faldo:reference ?thisSequence .
    ?samsignale15 faldo:position ?samsignalep17 ;
      faldo:reference ?thisSequence .
    BIND(?this AS ?sam3) .
  }
  BIND(URI(CONCAT(STR(?this), '#MF_01581a9')) AS ?keyword9) .
}
""" .

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