-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARQL] Rhea's RDF #95
Labels
Comments
PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX ch:<http://purl.obolibrary.org/obo/>
PREFIX ch3:<http://purl.obolibrary.org/obo/chebi/>
SELECT ?reaction ?reactionEquation WHERE {
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:status rh:Approved .
?reaction rh:equation ?reactionEquation .
?reaction rh:side ?reactionSide .
?reactionSide rh:contains ?participant .
?participant rh:compound ?compound .
?compound rh:chebi ?chebi .
?chebi ch3:inchikey 'WHUUTDBJXJRKMK-VKHMYHEASA-M' .
}
PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX ch:<http://purl.obolibrary.org/obo/>
PREFIX ch2:<http://purl.obolibrary.org/obo/chebi#>
SELECT count(distinct ?reaction) as ?reactionCount WHERE {
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:status rh:Approved .
?reaction rh:side ?reactionSide .
?reactionSide rh:contains ?participant .
?participant rh:compound ?compound .
{
?compound rh:chebi ?chebi .
?chebi rdfs:subClassOf+ ch:CHEBI_18059 .
}
UNION
{
?compound rh:chebi ?chebi .
?chebi2 rdfs:subClassOf ?chebiRestriction .
?chebiRestriction a owl:Restriction .
?chebiRestriction owl:onProperty ch2:has_major_microspecies_at_pH_7_3 .
?chebiRestriction owl:someValuesFrom ?chebi .
?chebi2 rdfs:subClassOf+ ch:CHEBI_18059 .
}
} |
And for MIM-translocation: PREFIX rh:<http://rdf.rhea-db.org/>
SELECT ?reaction ?reactionEquation WHERE {
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:status rh:Approved .
?reaction rh:equation ?reactionEquation .
?reaction rh:isTransport ?isTransport
FILTER (?isTransport=true)
}
ORDER BY ?reaction |
@egonw : what's the status of getting our cross-refs to WP into Rhea? I believe you discussed this with Alan Bridge PREFIX rh:<http://rdf.rhea-db.org/>
SELECT ?reaction ?xref WHERE {
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:directionalReaction ?directionalReaction .
OPTIONAL { ?directionalReaction rdfs:seeAlso ?xref . }
?reaction rh:bidirectionalReaction ?bidirectionalReaction .
OPTIONAL { ?bidirectionalReaction rdfs:seeAlso ?xref . }
FILTER (?reaction=rh:11932)
} |
Rhea federated to Uniprot example (EC-numbers): PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX ec:<http://purl.uniprot.org/enzyme/>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
SELECT ?ecClass (str(?ecName) as ?ecClassName) (count(?reaction) as ?reactionCount) WHERE {
SERVICE <http://sparql.uniprot.org/sparql> {
?ecNumber rdfs:subClassOf ?ecClass .
?ecClass skos:prefLabel ?ecName .
VALUES (?ecClass) { (ec:1.-.-.-)(ec:2.-.-.-)(ec:3.-.-.-)(ec:4.-.-.-)(ec:5.-.-.-)(ec:6.-.-.-)(ec:7.-.-.-) }
}
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:ec ?ecNumber .
} And example with Uniprot ID: PREFIX rh:<http://rdf.rhea-db.org/>
PREFIX ch:<http://purl.obolibrary.org/obo/>
PREFIX up:<http://purl.uniprot.org/core/>
PREFIX uniprotkb:<http://purl.uniprot.org/uniprot/>
SELECT ?chebi
?reaction
?equation
WHERE {
SERVICE <http://sparql.uniprot.org/sparql> {
?protein up:reviewed true .
?protein up:annotation ?a .
?a a up:Cofactor_Annotation .
?a up:cofactor ?chebi .
VALUES (?protein) {(uniprotkb:P15877)} .
}
?reaction rdfs:subClassOf rh:Reaction .
?reaction rh:status rh:Approved .
?reaction rh:equation ?equation .
?reaction rh:side ?reactionSide .
?reactionSide rh:contains ?participant .
?participant rh:compound ?compound .
?compound rh:chebi ?chebi .
}
order by ?chebi From Uniprot Endpoint (how to match reviewed protein IDs only): PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX up: <http://purl.uniprot.org/core/>
SELECT ?protein ?name
WHERE
{
?protein a up:Protein .
?protein up:reviewed true .
?protein up:recommendedName ?recommended .
?recommended up:fullName ?name .
?protein up:encodedBy ?gene .
?gene skos:prefLabel ?text .
FILTER CONTAINS(?text, 'DNA')
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reduce need for rewriting IRIs
Not possible, genes are not part of Rhea RDF --. Use "wp:bdbUniprot https://identifiers.org/uniprot/Q99424 " from WPRDF; what to do with "unreviewed" IDs?
Also not directly possible, Rhea documentation: "The cross-references to UniProt protein entries are not part of the rhea.rdf
distribution. They are available from the uniprot.rdf distribution." --> See below for examples on federated queries combining Rhea and Uniprot (either through EC, or UniprotID).
See two examples (InChIKey and ChEBI) below
@DeniseSl22 didn't find an example for this yet....
Write up examples SPARQL query
The text was updated successfully, but these errors were encountered: