SPARQL example query
26: Lipids produced in different organisms
PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rh: <http://rdf.rhea-db.org/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?swisslipid ?organism { ?swisslipid owl:equivalentClass ?chebi . SERVICE <https://sparql.rhea-db.org/sparql> { ?rhea rh:side/rh:contains/rh:compound ?compound . ?compound (rh:chebi|(rh:reactivePart/rh:chebi)|(rh:underlyingChebi/rh:chebi)) ?metabolite . } SERVICE <https://sparql.uniprot.org/sparql> { ?catalyticActivityAnnotation up:catalyticActivity/up:catalyzedReaction ?rhea . ?protein up:annotation ?catalyticActivityAnnotation ; up:organism ?organism . } }Use27: Find the list of SwissLipids for all organisms and their Isomeric subspecies
PREFIX SWISSLIPID: <https://swisslipids.org/rdf/SLM_> PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX rh: <http://rdf.rhea-db.org/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?swisslipid ?organism { ?swisslipid owl:equivalentClass ?chebi . SERVICE <https://sparql.rhea-db.org/sparql> { ?rhea rh:side/rh:contains/rh:compound ?compound . ?compound (rh:chebi|(rh:reactivePart/rh:chebi)|(rh:underlyingChebi/rh:chebi)) ?metabolite . } SERVICE <https://sparql.uniprot.org/sparql> { ?catalyticActivityAnnotation up:catalyticActivity/up:catalyzedReaction ?rhea . ?protein up:annotation ?catalyticActivityAnnotation ; up:organism ?organism . } ?swisslipidIsomericSubpecies rdfs:subClassOf ?swisslipid ; SWISSLIPID:rank SWISSLIPID:Isomeric_Subspecies . }Use34: Lipids affected by human enzymes
PREFIX owl: <http://www.w3.org/2002/07/owl#> PREFIX rh: <http://rdf.rhea-db.org/> PREFIX taxon: <http://purl.uniprot.org/taxonomy/> PREFIX up: <http://purl.uniprot.org/core/> SELECT ?swisslipid { ?swisslipid owl:equivalentClass ?chebi . SERVICE <https://sparql.rhea-db.org/sparql> { ?rhea rh:side/rh:contains/rh:compound ?compound . ?compound (rh:chebi|(rh:reactivePart/rh:chebi)|(rh:underlyingChebi/rh:chebi)) ?metabolite . } SERVICE <https://sparql.uniprot.org/sparql> { ?catalyticActivityAnnotation up:catalyticActivity/up:catalyzedReaction ?rhea . ?protein up:annotation ?catalyticActivityAnnotation ; up:organism taxon:9606 . } }Use35: Lipids by fatty acid component (hexadecanoate) at position sn1
PREFIX CHEBI: <http://purl.obolibrary.org/obo/CHEBI_> PREFIX SWISSLIPID: <https://swisslipids.org/rdf/SLM_> PREFIX owl: <http://www.w3.org/2002/07/owl#> SELECT ?swisslipid WHERE { VALUES (?chebi) { (CHEBI:7896) #hexadecanoate } ?swisslipidHexadeconate owl:equivalentClass ?chebi . ?swisslipid SWISSLIPID:hasPart [ SWISSLIPID:derived_from ?swisslipidHexadecanoate ; SWISSLIPID:position SWISSLIPID:sn1 ] }Use36: Returns the list of isomeric subspecies containing a specific combination of fatty acids at defined positions, but only those isomeric subspecies that are associated with a publication. If the user supplies a single fatty acid and position (e.g. hexadecanoate at sn1), find all lipids with that fatty acid at that position, irrespective of whether or not there are other fatty acids at positions (here sn2, sn3). could generalize this query to allow logical combinations of fatty acids (e.g. hexadecanoate at sn1 AND (9Z)-octadecenoate at sn2, hexadecanoate at sn1 AND NOT (9Z)-octadecenoate at sn2, etc) Output should include the corresponding SwissLipids ID(s) and name(s) and PMIDs.
PREFIX SWISSLIPID: <https://swisslipids.org/rdf/SLM_> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?startId ?startName ?tail1 ?tailName1 ?tail2 ?tailName2 ?id ?name ?pubmed WHERE { VALUES ?startId { SWISSLIPID:000121946 } ?startId rdfs:label ?startName . # tail components ?startId SWISSLIPID:haspart ?tail1 . ?startId SWISSLIPID:haspart ?tail2 . FILTER(!sameTerm(?tail1, ?tail2)) ?tail1 rdfs:label ?tailName1 . ?tail2 rdfs:label ?tailName2 . # Retrieve lipids with similar tails ?id SWISSLIPID:haspart ?tail1 , ?tail2 . # Restrict to isomeric subspecies with PubMed citation(s) ?id SWISSLIPID:rank SWISSLIPID:Isomeric_Subspecies . ?id SWISSLIPID:citation ?pubmed . # Retrieve name ?id rdfs:label ?name . } ORDER BY ?id ?tail1 ?tail2Use37: Returns the list of isomeric subspecies that contain the same fatty acid component(s) at the same position(s) as a user-defined lipid. The user supplies a lipid ID, from which we first retrieve the fatty acids and their positions, after which we search for other lipids with the same combination of fatty acids at the same positions. This query could be useful in the website (classification tab): for a given lipid, provide a list of the other lipids with the same “tail” e.g. for PA(16:0/18:1(9Z)) => hexadecanoate@sn1 AND (9Z)-octadecenoate@sn2 => PC(16:0/18:1(9Z)), PE(16:0/18:1(9Z)), PG(16:0/18:1(9Z)), PI(16:0/18:1(9Z)), PIP[3](16:0/18:1(9Z)), PIP[4](16:0/18:1(9Z)), PIP[5](16:0/18:1(9Z)), PI2P[3,4](16:0/18:1(9Z)), PI2P[4,5](16:0/18:1(9Z)), PI2P[3,5](16:0/18:1(9Z)), PI3P[3,4,5](16:0/18:1(9Z)), PS(16:0/18:1(9Z))… Output should include the corresponding SwissLipids ID(s) and name(s).
PREFIX SWISSLIPID: <https://swisslipids.org/rdf/SLM_> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> # Example 37 SELECT ?startId ?startName ?tail1 ?tailName1 ?tail2 ?tailName2 ?id ?name WHERE { VALUES ?startId { SWISSLIPID:000121946 } ?startId rdfs:label ?startName . # tail components ?startId SWISSLIPID:haspart ?tail1 . ?startId SWISSLIPID:haspart ?tail2 . FILTER(!sameTerm(?tail1, ?tail2)) ?tail1 rdfs:label ?tailName1 . ?tail2 rdfs:label ?tailName2 . # Retrieve lipids with similar tails ?id SWISSLIPID:haspart ?tail1 , ?tail2 . # Restrict to isomeric subspecies with PubMed citation(s) ?id SWISSLIPID:rank SWISSLIPID:Isomeric_Subspecies . # Retrieve name ?id rdfs:label ?name . } ORDER BY ?id ?tail1 ?tail2Use38: Returns the list of isomeric subspecies that contain the same fatty acid component(s) at the same position(s) as a user-defined lipid, but limits the output to published lipids linked to a PMID. Output should include the corresponding SwissLipids ID(s) and name(s) and the PMID(s) for each. Extends ex:36 Output should include the corresponding SwissLipids ID(s) and name(s).
PREFIX SWISSLIPID: <https://swisslipids.org/rdf/SLM_> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> # Example 38 SELECT ?startId ?startName ?tail1 ?tailName1 ?tail2 ?tailName2 ?id ?name ?pubmed WHERE { VALUES ?startId { SWISSLIPID:000121946 } ?startId rdfs:label ?startName . # tail components ?startId SWISSLIPID:haspart ?tail1 . ?startId SWISSLIPID:haspart ?tail2 . FILTER(!sameTerm(?tail1, ?tail2)) ?tail1 rdfs:label ?tailName1 . ?tail2 rdfs:label ?tailName2 . # Retrieve lipids with similar tails ?id SWISSLIPID:haspart ?tail1 , ?tail2 . # Restrict to isomeric subspecies with PubMed citation(s) ?id SWISSLIPID:rank SWISSLIPID:Isomeric_Subspecies . ?id SWISSLIPID:citation ?pubmed . # Retrieve name ?id rdfs:label ?name . } ORDER BY ?id ?tail1 ?tail2Use