140_disulfide_bonds_and_interchain_links

rq turtle/ttl

Find the disulfide bonds of human insulin (P01308), the pair of residue positions each one connects, and whether it links two different chains (e.g. the A and B chains of mature insulin) rather than two residues within the same chain

Use at

PREFIX up: <http://purl.uniprot.org/core/>
PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/>
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT
  ?annotation
  (GROUP_CONCAT(STR(?position); separator="-") AS ?positions)
  (SAMPLE(?rawComment) AS ?interchainNote)
WHERE {
  uniprotkb:P01308 up:annotation ?annotation .
  ?annotation a up:Disulfide_Bond_Annotation ;
    up:range ?range .
  # Each disulfide bond annotation has one up:range per residue it
  # connects; a plain xsd:int position must be coerced with STR() before
  # GROUP_CONCAT can aggregate it.
  ?range faldo:begin/faldo:position ?position .
  # Absence of a comment means the bond is intra-chain; a comment
  # mentioning "Interchain" means it links two separate chains.
  OPTIONAL { ?annotation rdfs:comment ?rawComment }
}
GROUP BY ?annotation
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?annotation"):::projected 
  v6("?interchainNote")
  v3("?position"):::projected 
  v5("?positions")
  v2("?range")
  v4("?rawComment"):::projected 
  a1((" "))
  c1(["uniprotkb:P01308"]):::iri 
  c4(["up:Disulfide_Bond_Annotation"]):::iri 
  c1 --"up:annotation"-->  v1
  v1 --"a"-->  c4
  v1 --"up:range"-->  v2
  v2 --"faldo:begin"-->  a1
  a1 --"faldo:position"-->  v3
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v1 -."rdfs:comment".->  v4
  end
  bind2[/"str(?position)"/]
  v3 --o bind2
  bind2 --as--o v5
  bind3[/"sample(?rawComment)"/]
  v4 --o bind3
  bind3 --as--o v6