sparql-examples

A set of SPARQL examples that are used in different SIB resources

View the Project on GitHub sib-swiss/sparql-examples

neXtProt/NXQ_09650

Check there are no entries with non-compliant glycosylation sites from neXtProt

Use at

PREFIX : <http://nextprot.org/rdf/>
PREFIX cv: <http://nextprot.org/rdf/terminology/>
PREFIX source: <http://nextprot.org/rdf/source/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

select distinct ?entry where { # Add  ?glypos ?qual to idenfiy glycosylation site and quality
?entry :isoform ?iso.
?iso :swissprotDisplayed true ; :glycosylationSite ?glycosite.
?glycosite :start ?glypos; rdfs:comment ?desc; :quality ?qual .
filter(contains(?desc,"N-linked"))
?glycosite :evidence / :assignedBy source:NextProt.
{
values ?forbiddom
{ cv:DO-00843 cv:DO-00082 cv:DO-00096 cv:DO-00098 cv:DO-00099 cv:DO-00100 cv:DO-00127 cv:DO-00135 cv:DO-00162 cv:DO-00212 cv:DO-00218 cv:DO-00224 cv:DO-00234 cv:DO-00847 cv:DO-00280 cv:DO-00282 cv:DO-00302 cv:DO-00310 cv:DO-00341 cv:DO-00343 cv:DO-00349 cv:DO-00350 cv:DO-00354 cv:DO-00376 cv:DO-00378 cv:DO-00404 cv:DO-00416 cv:DO-00418 cv:DO-00421 cv:DO-00415 cv:DO-00430 cv:DO-00462 cv:DO-00466 cv:DO-00467 cv:DO-00469 cv:DO-00477 cv:DO-00869 cv:DO-00555 cv:DO-00592 cv:DO-00602 cv:DO-00604 cv:DO-00779 cv:DO-00918 cv:DO-00943 cv:DO-00632 cv:DO-00636 cv:DO-00671 cv:DO-00691 cv:DO-00695 cv:DO-00700 cv:DO-00832 cv:DO-00741 cv:DO-00078 cv:DO-00057 cv:DO-00104 cv:DO-00144 cv:DO-00244 cv:DO-00273 cv:DO-00284 cv:DO-00387 cv:DO-00451 cv:DO-00561 cv:DO-00650 cv:DO-00658 cv:DO-00692 cv:DO-00697 cv:DO-00707 }


?iso :domain ?dom .
?dom :term ?forbiddom; :start ?forbidstart; :end ?forbidend .
}
union
{
values ?forbidtopodom
{ cv:CVTO_0001 cv:CVTO_0004 cv:CVTO_0013 cv:CVTO_0015 cv:CVTO_0022 }

?iso :topology ?top .
?top :term ?forbidtopodom; :start ?forbidstart; :end ?forbidend .
}
union
{ ?iso :signalPeptide ?sigpep . ?sigpep :start ?forbidstart; :end ?forbidend . }

union
{ ?iso :mitochondrialTransitPeptide ?trpep . ?trpep :start ?forbidstart; :end ?forbidend . }

filter((?glypos >= ?forbidstart) && (?glypos <= ?forbidend))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v4("?desc")
  v10("?dom")
  v5("?entry"):::projected 
  v9("?forbiddom")
  v3("?forbidend")
  v2("?forbidstart")
  v11("?forbidtopodom")
  v7("?glycosite")
  v1("?glypos")
  v6("?iso")
  v8("?qual")
  v13("?sigpep")
  v12("?top")
  v14("?trpep")
  a1((" "))
  c11([":source/NextProt"]):::iri 
  c4(["true^^xsd:boolean"]):::literal 
  f0[["?glypos >= ?forbidstart?glypos <= ?forbidend"]]
  f0 --> v1
  f0 --> v2
  f0 --> v3
  f1[["contains(?desc,'N-linked')"]]
  f1 --> v4
  v5 --":isoform"-->  v6
  v6 --":swissprotDisplayed"-->  c4
  v6 --":glycosylationSite"-->  v7
  v7 --":start"-->  v1
  v7 --"rdfs:comment"-->  v4
  v7 --":quality"-->  v8
  v7 --":evidence"-->  a1
  a1 --":assignedBy"-->  c11
  subgraph union0[" Union "]
  subgraph union0l[" "]
    style union0l fill:#abf,stroke-dasharray: 3 3;
    subgraph union1[" Union "]
    subgraph union1l[" "]
      style union1l fill:#abf,stroke-dasharray: 3 3;
      subgraph union2[" Union "]
      subgraph union2l[" "]
        style union2l fill:#abf,stroke-dasharray: 3 3;
        v6 --":mitochondrialTransitPeptide"-->  v14
        v14 --":start"-->  v2
        v14 --":end"-->  v3
      end
      subgraph union2r[" "]
        style union2r fill:#abf,stroke-dasharray: 3 3;
        v6 --":signalPeptide"-->  v13
        v13 --":start"-->  v2
        v13 --":end"-->  v3
      end
      union2r <== or ==> union2l
      end
    end
    subgraph union1r[" "]
      style union1r fill:#abf,stroke-dasharray: 3 3;
      bind2[/VALUES ?forbidtopodom/]
      bind2-->v11
      bind20([":terminology/CVTO_0001"])
      bind20 --> bind2
      bind21([":terminology/CVTO_0004"])
      bind21 --> bind2
      bind22([":terminology/CVTO_0013"])
      bind22 --> bind2
      bind23([":terminology/CVTO_0015"])
      bind23 --> bind2
      bind24([":terminology/CVTO_0022"])
      bind24 --> bind2
      v6 --":topology"-->  v12
      v12 --":term"-->  v11
      v12 --":start"-->  v2
      v12 --":end"-->  v3
    end
    union1r <== or ==> union1l
    end
  end
  subgraph union0r[" "]
    style union0r fill:#abf,stroke-dasharray: 3 3;
    bind3[/VALUES ?forbiddom/]
    bind3-->v9
    bind30([":terminology/DO-00843"])
    bind30 --> bind3
    bind31([":terminology/DO-00082"])
    bind31 --> bind3
    bind32([":terminology/DO-00096"])
    bind32 --> bind3
    bind33([":terminology/DO-00098"])
    bind33 --> bind3
    bind34([":terminology/DO-00099"])
    bind34 --> bind3
    bind35([":terminology/DO-00100"])
    bind35 --> bind3
    bind36([":terminology/DO-00127"])
    bind36 --> bind3
    bind37([":terminology/DO-00135"])
    bind37 --> bind3
    bind38([":terminology/DO-00162"])
    bind38 --> bind3
    bind39([":terminology/DO-00212"])
    bind39 --> bind3
    bind310([":terminology/DO-00218"])
    bind310 --> bind3
    bind311([":terminology/DO-00224"])
    bind311 --> bind3
    bind312([":terminology/DO-00234"])
    bind312 --> bind3
    bind313([":terminology/DO-00847"])
    bind313 --> bind3
    bind314([":terminology/DO-00280"])
    bind314 --> bind3
    bind315([":terminology/DO-00282"])
    bind315 --> bind3
    bind316([":terminology/DO-00302"])
    bind316 --> bind3
    bind317([":terminology/DO-00310"])
    bind317 --> bind3
    bind318([":terminology/DO-00341"])
    bind318 --> bind3
    bind319([":terminology/DO-00343"])
    bind319 --> bind3
    bind320([":terminology/DO-00349"])
    bind320 --> bind3
    bind321([":terminology/DO-00350"])
    bind321 --> bind3
    bind322([":terminology/DO-00354"])
    bind322 --> bind3
    bind323([":terminology/DO-00376"])
    bind323 --> bind3
    bind324([":terminology/DO-00378"])
    bind324 --> bind3
    bind325([":terminology/DO-00404"])
    bind325 --> bind3
    bind326([":terminology/DO-00416"])
    bind326 --> bind3
    bind327([":terminology/DO-00418"])
    bind327 --> bind3
    bind328([":terminology/DO-00421"])
    bind328 --> bind3
    bind329([":terminology/DO-00415"])
    bind329 --> bind3
    bind330([":terminology/DO-00430"])
    bind330 --> bind3
    bind331([":terminology/DO-00462"])
    bind331 --> bind3
    bind332([":terminology/DO-00466"])
    bind332 --> bind3
    bind333([":terminology/DO-00467"])
    bind333 --> bind3
    bind334([":terminology/DO-00469"])
    bind334 --> bind3
    bind335([":terminology/DO-00477"])
    bind335 --> bind3
    bind336([":terminology/DO-00869"])
    bind336 --> bind3
    bind337([":terminology/DO-00555"])
    bind337 --> bind3
    bind338([":terminology/DO-00592"])
    bind338 --> bind3
    bind339([":terminology/DO-00602"])
    bind339 --> bind3
    bind340([":terminology/DO-00604"])
    bind340 --> bind3
    bind341([":terminology/DO-00779"])
    bind341 --> bind3
    bind342([":terminology/DO-00918"])
    bind342 --> bind3
    bind343([":terminology/DO-00943"])
    bind343 --> bind3
    bind344([":terminology/DO-00632"])
    bind344 --> bind3
    bind345([":terminology/DO-00636"])
    bind345 --> bind3
    bind346([":terminology/DO-00671"])
    bind346 --> bind3
    bind347([":terminology/DO-00691"])
    bind347 --> bind3
    bind348([":terminology/DO-00695"])
    bind348 --> bind3
    bind349([":terminology/DO-00700"])
    bind349 --> bind3
    bind350([":terminology/DO-00832"])
    bind350 --> bind3
    bind351([":terminology/DO-00741"])
    bind351 --> bind3
    bind352([":terminology/DO-00078"])
    bind352 --> bind3
    bind353([":terminology/DO-00057"])
    bind353 --> bind3
    bind354([":terminology/DO-00104"])
    bind354 --> bind3
    bind355([":terminology/DO-00144"])
    bind355 --> bind3
    bind356([":terminology/DO-00244"])
    bind356 --> bind3
    bind357([":terminology/DO-00273"])
    bind357 --> bind3
    bind358([":terminology/DO-00284"])
    bind358 --> bind3
    bind359([":terminology/DO-00387"])
    bind359 --> bind3
    bind360([":terminology/DO-00451"])
    bind360 --> bind3
    bind361([":terminology/DO-00561"])
    bind361 --> bind3
    bind362([":terminology/DO-00650"])
    bind362 --> bind3
    bind363([":terminology/DO-00658"])
    bind363 --> bind3
    bind364([":terminology/DO-00692"])
    bind364 --> bind3
    bind365([":terminology/DO-00697"])
    bind365 --> bind3
    bind366([":terminology/DO-00707"])
    bind366 --> bind3
    v6 --":domain"-->  v10
    v10 --":term"-->  v9
    v10 --":start"-->  v2
    v10 --":end"-->  v3
  end
  union0r <== or ==> union0l
  end