@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_01088#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_01088#construct-template-25>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-2>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-24>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-13>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-3>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-10>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-21>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-18>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-14>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-0>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-1>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-7>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-40>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-9>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-17>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-6>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-5>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-38>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-4>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-27>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-8>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-20>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-29>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-31>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-19>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-30>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-28>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-16>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-15>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-33>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-34>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-11>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-26>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-32>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-37>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-22>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-35>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-12>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-36>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-23>, <http://purl.uniprot.org/unirules/MF_01088#construct-template-41>,
    <http://purl.uniprot.org/unirules/MF_01088#construct-template-39>;
  <http://www.w3.org/ns/shacl#prefixes> <http://purl.uniprot.org/unirules/>;
  <http://spinrdf.org/sp#where> <http://purl.uniprot.org/unirules/MF_01088#construct-where-list-0>;
  <http://spinrdf.org/sp#templates> <http://purl.uniprot.org/unirules/MF_01088#construct-template-list-0>;
  <http://www.w3.org/ns/shacl#construct> """CONSTRUCT {
  _:378118 up:source unirule:MF_01088 .
  _:378119 up:source unirule:MF_01088 .
  _:378120 up:source unirule:MF_01088 .
  _:378121 up:source unirule:MF_01088 .
  _:378122 up:source unirule:MF_01088 .
  _:378123 up:source unirule:MF_01088 .
  _:378124 up:source unirule:MF_01088 .
  _:378125 up:source unirule:MF_01088 .
  _:378126 up:source unirule:MF_01088 .
  _:378127 up:source unirule:MF_01088 .
  _:378128 up:source unirule:MF_01088 .
  ?this up:annotation ?annotation1 ;
    up:classifiedWith GO:0005886 ,
      keyword:1003 ,
      keyword:1133 ,
      keyword:472 ,
      keyword:812 .
  ?gene0 skos:prefLabel 'uspB' .
  ?annotation1 a up:Similarity_Annotation ;
    rdfs:comment 'Belongs to the universal stress protein B family.' .
  ?case4 up:classifiedWith keyword:997 .
  ?sam6 up:classifiedWith keyword:1133 ,
      keyword:472 ,
      keyword:812 .
  ?transmembrane7 faldo:begin ?transmembraneb8 ;
    faldo:end ?transmembranee9 .
  ?transmembraneb8 faldo:position ?transmembranebp10 .
  ?transmembranee9 faldo:position ?transmembraneep11 .
  ?keyword12 up:range ?transmembrane7 .
  ?keyword13 up:range ?transmembrane7 .
  ?keyword14 up:range ?transmembrane7 .
  _:378129 a rdf:Statement ;
    up:attribution _:378118 ;
    rdf:subject ?gene0 ;
    rdf:predicate up:encodedBy ;
    rdf:object ?gene0 .
  _:378130 a rdf:Statement ;
    up:attribution _:378119 ;
    rdf:subject ?this ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation1 .
  _:378131 a rdf:Statement ;
    up:attribution _:378120 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:1003 .
  _:378132 a rdf:Statement ;
    up:attribution _:378121 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:472 .
  _:378133 a rdf:Statement ;
    up:attribution _:378122 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:812 .
  _:378134 a rdf:Statement ;
    up:attribution _:378123 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:1133 .
  _:378135 a rdf:Statement ;
    up:attribution _:378124 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object GO:0005886 .
  _:378136 a rdf:Statement ;
    up:attribution _:378125 ;
    rdf:subject ?case4 ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:997 .
  _:378137 a rdf:Statement ;
    up:attribution _:378126 ;
    rdf:subject ?sam6 ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:472 .
  _:378138 a rdf:Statement ;
    up:attribution _:378127 ;
    rdf:subject ?sam6 ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:812 .
  _:378139 a rdf:Statement ;
    up:attribution _:378128 ;
    rdf:subject ?sam6 ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:1133 .
}
WHERE {
  #baseURI: http://purl.uniprot.org/unirule/MF_01088
  #Rule MF_01088 Created by:? on:2005-02-28 Modified by:Edouard de Castro on:2019-11-19
  ?this up:organism ?thisOrganism ;
    rdfs:seeAlso signature:MF_01088 .
  ?thisOrganism rdfs:subClassOf+ taxon:1236 .
  BIND(URI(CONCAT(STR(?this), '#MF_01088a1')) AS ?annotation1) .
  OPTIONAL {
    ?this a up:Protein .
    ?this up:organism ?thisOrganism .
    ?thisOrganism rdfs:subClassOf+ taxon:91347 .
    BIND(?this AS ?case2) .
  }
  OPTIONAL {
    ?this a up:Protein .
    ?this up:organism ?thisOrganism .
    FILTER (! (EXISTS {
      ?thisOrganism rdfs:subClassOf+ taxon:91347 .
    })) .
    BIND(?this AS ?case3) .
  }
  OPTIONAL {
    ?this a up:Protein .
    {
      ?this up:proteome <http://purl.uniprot.org/proteomes/Membrane#2>.
    } UNION {
      ?this up:proteome ?p15 .
      ?p15 skos:narrower <http://purl.uniprot.org/proteomes/Membrane#2>.
    }
    BIND(?this AS ?case4) .
  }
  OPTIONAL {
    ?this a up:Protein .
    {
      FILTER (! (EXISTS {
        {
          ?this up:proteome <http://purl.uniprot.org/proteomes/Membrane#any>.
        } UNION {
          ?this up:proteome ?p16 .
          ?p16 skos:narrower <http://purl.uniprot.org/proteomes/Membrane#any>.
        }
      })) .
    } UNION {
      {
        ?this up:proteome <http://purl.uniprot.org/proteomes/Membrane#1>.
      } UNION {
        ?this up:proteome ?p17 .
        ?p17 skos:narrower <http://purl.uniprot.org/proteomes/Membrane#1>.
      }
    }
    BIND(?this AS ?case5) .
  }
  OPTIONAL {
    ?this up:annotation ?samtransmembrane18 ;
      up:sequence ?thisSequence .
    ?samtransmembrane18 up:range ?samtransmembraner19 ;
      rdf:type up:Transmembrane_Annotation .
    ?samtransmembraner19 faldo:begin ?samtransmembraneb20 ;
      faldo:end ?samtransmembranee21 .
    ?samtransmembraneb20 faldo:position ?samtransmembranebp22 ;
      faldo:reference ?thisSequence .
    ?samtransmembranee21 faldo:position ?samtransmembraneep23 ;
      faldo:reference ?thisSequence .
    BIND(?this AS ?sam6) .
  }
  BIND(URI(CONCAT(STR(?this), '#MF_01088a12')) AS ?keyword12) .
  BIND(URI(CONCAT(STR(?this), '#MF_01088a13')) AS ?keyword13) .
  BIND(URI(CONCAT(STR(?this), '#MF_01088a14')) AS ?keyword14) .
}
""" .

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