@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_04160#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_04160#construct-template-17>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-16>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-19>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-18>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-37>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-13>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-36>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-12>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-39>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-15>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-38>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-14>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-33>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-32>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-11>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-35>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-10>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-34>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-31>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-30>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-9>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-8>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-3>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-2>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-1>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-0>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-7>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-29>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-6>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-28>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-5>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-4>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-25>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-24>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-27>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-26>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-21>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-20>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-23>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-22>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-41>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-40>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-49>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-43>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-53>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-42>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-47>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-58>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-57>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-46>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-56>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-51>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-59>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-45>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-52>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-55>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-54>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-44>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-50>,
    <http://purl.uniprot.org/unirules/MF_04160#construct-template-60>, <http://purl.uniprot.org/unirules/MF_04160#construct-template-48>;
  <http://www.w3.org/ns/shacl#prefixes> <http://purl.uniprot.org/unirules/>;
  <http://spinrdf.org/sp#where> <http://purl.uniprot.org/unirules/MF_04160#construct-where-list-0>;
  <http://spinrdf.org/sp#templates> <http://purl.uniprot.org/unirules/MF_04160#construct-template-list-0>;
  <http://www.w3.org/ns/shacl#construct> """CONSTRUCT {
  _:979324 up:source unirule:MF_04160 .
  _:979325 up:source unirule:MF_04160 .
  _:979326 up:source unirule:MF_04160 .
  _:979327 up:source unirule:MF_04160 .
  _:979328 up:source unirule:MF_04160 .
  _:979329 up:source unirule:MF_04160 .
  _:979330 up:source unirule:MF_04160 .
  _:979331 up:source unirule:MF_04160 .
  _:979332 up:source unirule:MF_04160 .
  _:979333 up:source unirule:MF_04160 .
  ?this up:annotation ?annotation1 ,
      ?annotation2 ;
    up:classifiedWith GO:0004519 ,
      GO:0004527 ,
      keyword:255 ,
      keyword:269 ;
    up:recommendedName ?name0 .
  ?name0 up:ecName '3.1.-.-' ;
    up:fullName 'Head completion nuclease' ;
    rdf:type up:Structured_Name .
  ?annotation1 a up:Function_Annotation ;
    rdfs:comment 'During phage morphogenesis, plays an essential role in the head-tail joining step. The associated nuclease activity is essential for morphogenesis, possibly by cleaving packaged DNA to enable the joining of heads to tails. Displays both exo- and endonuclease activity.' .
  ?annotation2 a up:Similarity_Annotation ;
    rdfs:comment 'Belongs to the Caudovirales head completion nuclease family.' .
  ?pfs3 up:annotation ?annotation4 .
  ?annotation4 faldo:begin ?pfsb5 ;
    faldo:end ?pfse6 ;
    rdf:type up:Active_Site_Annotation .
  ?pfsb5 faldo:position ?thisPositionOn7 ;
    rdf:type faldo:ExactPosition .
  ?pfse6 faldo:position ?thisPositionOn8 ;
    rdf:type faldo:ExactPosition .
  ?pfs9 up:annotation ?annotation10 .
  ?annotation10 faldo:begin ?pfsb11 ;
    faldo:end ?pfse12 ;
    rdf:type up:Active_Site_Annotation .
  ?pfsb11 faldo:position ?thisPositionOn13 ;
    rdf:type faldo:ExactPosition .
  ?pfse12 faldo:position ?thisPositionOn14 ;
    rdf:type faldo:ExactPosition .
  ?pfs15 up:annotation ?annotation16 .
  ?annotation16 faldo:begin ?pfsb17 ;
    faldo:end ?pfse18 ;
    rdf:type up:Active_Site_Annotation .
  ?pfsb17 faldo:position ?thisPositionOn19 ;
    rdf:type faldo:ExactPosition .
  ?pfse18 faldo:position ?thisPositionOn20 ;
    rdf:type faldo:ExactPosition .
  _:979334 a rdf:Statement ;
    up:attribution _:979324 ;
    rdf:subject ?this ;
    rdf:predicate up:recommendedName ;
    rdf:object ?name0 .
  _:979335 a rdf:Statement ;
    up:attribution _:979325 ;
    rdf:subject ?this ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation1 .
  _:979336 a rdf:Statement ;
    up:attribution _:979326 ;
    rdf:subject ?this ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation2 .
  _:979337 a rdf:Statement ;
    up:attribution _:979327 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:255 .
  _:979338 a rdf:Statement ;
    up:attribution _:979328 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object keyword:269 .
  _:979339 a rdf:Statement ;
    up:attribution _:979329 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object GO:0004527 .
  _:979340 a rdf:Statement ;
    up:attribution _:979330 ;
    rdf:subject ?this ;
    rdf:predicate up:classifiedWith ;
    rdf:object GO:0004519 .
  _:979341 a rdf:Statement ;
    up:source unirule:MF_04160 ;
    rdf:subject ?pfs3 ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation4 .
  _:979342 a rdf:Statement ;
    up:attribution _:979331 ;
    rdf:subject ?pfs3 ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation4 .
  _:979343 a rdf:Statement ;
    up:source unirule:MF_04160 ;
    rdf:subject ?pfs9 ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation10 .
  _:979344 a rdf:Statement ;
    up:attribution _:979332 ;
    rdf:subject ?pfs9 ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation10 .
  _:979345 a rdf:Statement ;
    up:source unirule:MF_04160 ;
    rdf:subject ?pfs15 ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation16 .
  _:979346 a rdf:Statement ;
    up:attribution _:979333 ;
    rdf:subject ?pfs15 ;
    rdf:predicate up:annotation ;
    rdf:object ?annotation16 .
}
WHERE {
  #baseURI: http://purl.uniprot.org/unirule/MF_04160
  #Rule MF_04160 Created by:? on:2021-04-06 Modified by:ipedruzz on:2021-04-20
  ?this up:organism ?thisOrganism ;
    rdfs:seeAlso signature:MF_04160 .
  ?thisOrganism rdfs:subClassOf+ taxon:10239 .
  BIND(URI(CONCAT(STR(?this), '#MF_04160a0')) AS ?name0) .
  BIND(URI(CONCAT(STR(?this), '#MF_04160a1')) AS ?annotation1) .
  BIND(URI(CONCAT(STR(?this), '#MF_04160a2')) AS ?annotation2) .
  OPTIONAL {
    ?this up:sequence ?thisSequence .
    ?thisSequence rdf:value ?thisSequenceValue .
    ?templateMotifMatch25 faldo:location ?templateMotifSequenceMatchRegionP1507526 ;
      edam:is_output_of ?templateMotifSequenceProfileAlignmentOperationP1507528 ;
      rdf:type edam:data_0869 ;
      rdf:value ?templateMotifCigarP15075MF_0416021 .
    ?templateMotifSequenceMatchRegionP1507526 faldo:begin ?templateMotifSequenceMatchBeginP1507527 .
    ?templateMotifSequenceMatchBeginP1507527 faldo:position ?templateMotifSequenceMatchBeginPositionP1507522 ;
      faldo:reference isoform:P15075-1 .
    ?templateMotifSequenceProfileAlignmentOperationP1507528 edam:has_input signature:MF_04160 ;
      rdf:type edam:operation_0300 .
    ?targetMotifMatch29 faldo:location ?targetMotifMatchRegionMatch30 ;
      edam:is_output_of ?targetMotifSequenceAlignmentOperationMF_0416032 ;
      rdf:type edam:data_0869 ;
      rdf:value ?targetMotifMatchCigarP15075MF_0416023 .
    ?targetMotifMatchRegionMatch30 faldo:begin ?targetMotifMatchRegionMatchBeginMF_0416031 .
    ?targetMotifMatchRegionMatchBeginMF_0416031 faldo:position ?targetMotifMatchRegionMatchBeginPositionMF_0416024 ;
      faldo:reference ?thisSequence .
    ?targetMotifSequenceAlignmentOperationMF_0416032 edam:has_input signature:MF_04160 ;
      rdf:type edam:operation_0300 .
    BIND(STRLEN(REPLACE(SUBSTR(?templateMotifCigarP15075MF_0416021, 1, (STRLEN(?templateMotifCigarP15075MF_0416021) - STRLEN(REPLACE(?templateMotifCigarP15075MF_0416021, CONCAT('^(?:-*[^-]){', STR(((29 - ?templateMotifSequenceMatchBeginPositionP1507522) + 1)), '}'), '')))), '[a-z]', '')) AS ?step133) .
    BIND((STRLEN(SUBSTR(?targetMotifMatchCigarP15075MF_0416023, 1, (STRLEN(?targetMotifMatchCigarP15075MF_0416023) - STRLEN(REPLACE(?targetMotifMatchCigarP15075MF_0416023, CONCAT('^(?:[a-z]*(?:[A-Z]|-)){', STR(?step133), '}'), ''))))) - STRLEN(REPLACE(SUBSTR(?targetMotifMatchCigarP15075MF_0416023, 1, (STRLEN(?targetMotifMatchCigarP15075MF_0416023) - STRLEN(REPLACE(?targetMotifMatchCigarP15075MF_0416023, CONCAT('^(?:[a-z]*(?:[A-Z]|-)){', STR(?step133), '}'), '')))), '[^-]', ''))) AS ?step234) .
    BIND(((?step234 + ?targetMotifMatchRegionMatchBeginPositionMF_0416024) - 1) AS ?thisPositionOn7) .
    BIND(?thisPositionOn7 AS ?thisPositionOn8) .
    BIND(?this AS ?pfs1t35) .
    BIND(URI(CONCAT(STR(?thisSequence), '#position', STR(?thisPositionOn7))) AS ?pfsb5) .
    BIND(URI(CONCAT(STR(?thisSequence), '#position', STR(?thisPositionOn8))) AS ?pfse6) .
    FILTER ((SUBSTR(?thisSequenceValue, ?thisPositionOn7, 1) = 'E')) .
    BIND(URI(CONCAT(STR(?this), '#MF_04160a4')) AS ?annotation4) .
    BIND(?this AS ?pfs3) .
  }
  OPTIONAL {
    ?this up:sequence ?thisSequence .
    ?thisSequence rdf:value ?thisSequenceValue .
    ?templateMotifMatch40 faldo:location ?templateMotifSequenceMatchRegionP1507541 ;
      edam:is_output_of ?templateMotifSequenceProfileAlignmentOperationP1507543 ;
      rdf:type edam:data_0869 ;
      rdf:value ?templateMotifCigarP15075MF_0416036 .
    ?templateMotifSequenceMatchRegionP1507541 faldo:begin ?templateMotifSequenceMatchBeginP1507542 .
    ?templateMotifSequenceMatchBeginP1507542 faldo:position ?templateMotifSequenceMatchBeginPositionP1507537 ;
      faldo:reference isoform:P15075-1 .
    ?templateMotifSequenceProfileAlignmentOperationP1507543 edam:has_input signature:MF_04160 ;
      rdf:type edam:operation_0300 .
    ?targetMotifMatch44 faldo:location ?targetMotifMatchRegionMatch45 ;
      edam:is_output_of ?targetMotifSequenceAlignmentOperationMF_0416047 ;
      rdf:type edam:data_0869 ;
      rdf:value ?targetMotifMatchCigarP15075MF_0416038 .
    ?targetMotifMatchRegionMatch45 faldo:begin ?targetMotifMatchRegionMatchBeginMF_0416046 .
    ?targetMotifMatchRegionMatchBeginMF_0416046 faldo:position ?targetMotifMatchRegionMatchBeginPositionMF_0416039 ;
      faldo:reference ?thisSequence .
    ?targetMotifSequenceAlignmentOperationMF_0416047 edam:has_input signature:MF_04160 ;
      rdf:type edam:operation_0300 .
    BIND(STRLEN(REPLACE(SUBSTR(?templateMotifCigarP15075MF_0416036, 1, (STRLEN(?templateMotifCigarP15075MF_0416036) - STRLEN(REPLACE(?templateMotifCigarP15075MF_0416036, CONCAT('^(?:-*[^-]){', STR(((68 - ?templateMotifSequenceMatchBeginPositionP1507537) + 1)), '}'), '')))), '[a-z]', '')) AS ?step148) .
    BIND((STRLEN(SUBSTR(?targetMotifMatchCigarP15075MF_0416038, 1, (STRLEN(?targetMotifMatchCigarP15075MF_0416038) - STRLEN(REPLACE(?targetMotifMatchCigarP15075MF_0416038, CONCAT('^(?:[a-z]*(?:[A-Z]|-)){', STR(?step148), '}'), ''))))) - STRLEN(REPLACE(SUBSTR(?targetMotifMatchCigarP15075MF_0416038, 1, (STRLEN(?targetMotifMatchCigarP15075MF_0416038) - STRLEN(REPLACE(?targetMotifMatchCigarP15075MF_0416038, CONCAT('^(?:[a-z]*(?:[A-Z]|-)){', STR(?step148), '}'), '')))), '[^-]', ''))) AS ?step249) .
    BIND(((?step249 + ?targetMotifMatchRegionMatchBeginPositionMF_0416039) - 1) AS ?thisPositionOn13) .
    BIND(?thisPositionOn13 AS ?thisPositionOn14) .
    BIND(?this AS ?pfs1t50) .
    BIND(URI(CONCAT(STR(?thisSequence), '#position', STR(?thisPositionOn13))) AS ?pfsb11) .
    BIND(URI(CONCAT(STR(?thisSequence), '#position', STR(?thisPositionOn14))) AS ?pfse12) .
    FILTER ((SUBSTR(?thisSequenceValue, ?thisPositionOn13, 1) = 'D')) .
    BIND(URI(CONCAT(STR(?this), '#MF_04160a10')) AS ?annotation10) .
    BIND(?this AS ?pfs9) .
  }
  OPTIONAL {
    ?this up:sequence ?thisSequence .
    ?thisSequence rdf:value ?thisSequenceValue .
    ?templateMotifMatch55 faldo:location ?templateMotifSequenceMatchRegionP1507556 ;
      edam:is_output_of ?templateMotifSequenceProfileAlignmentOperationP1507558 ;
      rdf:type edam:data_0869 ;
      rdf:value ?templateMotifCigarP15075MF_0416051 .
    ?templateMotifSequenceMatchRegionP1507556 faldo:begin ?templateMotifSequenceMatchBeginP1507557 .
    ?templateMotifSequenceMatchBeginP1507557 faldo:position ?templateMotifSequenceMatchBeginPositionP1507552 ;
      faldo:reference isoform:P15075-1 .
    ?templateMotifSequenceProfileAlignmentOperationP1507558 edam:has_input signature:MF_04160 ;
      rdf:type edam:operation_0300 .
    ?targetMotifMatch59 faldo:location ?targetMotifMatchRegionMatch60 ;
      edam:is_output_of ?targetMotifSequenceAlignmentOperationMF_0416062 ;
      rdf:type edam:data_0869 ;
      rdf:value ?targetMotifMatchCigarP15075MF_0416053 .
    ?targetMotifMatchRegionMatch60 faldo:begin ?targetMotifMatchRegionMatchBeginMF_0416061 .
    ?targetMotifMatchRegionMatchBeginMF_0416061 faldo:position ?targetMotifMatchRegionMatchBeginPositionMF_0416054 ;
      faldo:reference ?thisSequence .
    ?targetMotifSequenceAlignmentOperationMF_0416062 edam:has_input signature:MF_04160 ;
      rdf:type edam:operation_0300 .
    BIND(STRLEN(REPLACE(SUBSTR(?templateMotifCigarP15075MF_0416051, 1, (STRLEN(?templateMotifCigarP15075MF_0416051) - STRLEN(REPLACE(?templateMotifCigarP15075MF_0416051, CONCAT('^(?:-*[^-]){', STR(((84 - ?templateMotifSequenceMatchBeginPositionP1507552) + 1)), '}'), '')))), '[a-z]', '')) AS ?step163) .
    BIND((STRLEN(SUBSTR(?targetMotifMatchCigarP15075MF_0416053, 1, (STRLEN(?targetMotifMatchCigarP15075MF_0416053) - STRLEN(REPLACE(?targetMotifMatchCigarP15075MF_0416053, CONCAT('^(?:[a-z]*(?:[A-Z]|-)){', STR(?step163), '}'), ''))))) - STRLEN(REPLACE(SUBSTR(?targetMotifMatchCigarP15075MF_0416053, 1, (STRLEN(?targetMotifMatchCigarP15075MF_0416053) - STRLEN(REPLACE(?targetMotifMatchCigarP15075MF_0416053, CONCAT('^(?:[a-z]*(?:[A-Z]|-)){', STR(?step163), '}'), '')))), '[^-]', ''))) AS ?step264) .
    BIND(((?step264 + ?targetMotifMatchRegionMatchBeginPositionMF_0416054) - 1) AS ?thisPositionOn19) .
    BIND(?thisPositionOn19 AS ?thisPositionOn20) .
    BIND(?this AS ?pfs1t65) .
    BIND(URI(CONCAT(STR(?thisSequence), '#position', STR(?thisPositionOn19))) AS ?pfsb17) .
    BIND(URI(CONCAT(STR(?thisSequence), '#position', STR(?thisPositionOn20))) AS ?pfse18) .
    FILTER ((SUBSTR(?thisSequenceValue, ?thisPositionOn19, 1) = 'K')) .
    BIND(URI(CONCAT(STR(?this), '#MF_04160a16')) AS ?annotation16) .
    BIND(?this AS ?pfs15) .
  }
}
""" .

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