How to retrieve the yeast locus tag from uniprot via sparql? Let's say I want to retrieve the yeast-specific identifier for a certain protein, in the example below it will be P00330 which I would like to link to YOL086C.

When I go to uniprot's sparql UI and type 

PREFIX up:&lt;http://purl.uniprot.org/core/&gt; 
PREFIX rdfs:&lt;http://www.w3.org/2000/01/rdf-schema#&gt; 

SELECT *
WHERE
{
    Bind(&lt;http://purl.uniprot.org/uniprot/P00330&gt; as ?protein).
    ?protein rdfs:seeAlso ?db .
    ?db up:database &lt;http://purl.uniprot.org/database/SGD&gt; .

}


it returns

protein db
http://purl.uniprot.org/uniprot/P00330  http://purl.uniprot.org/sgd/S000005446


How would I now go on and find the YOL086C? When I add the line

?db ?p ?o


to the query above, I don't see anything that would directly lead me to the identifier.

I also tried to access another database

?db2 up:database &lt;http://purl.uniprot.org/database/EuPathDB&gt;


but this returns all kind of databases while I am interested only in the FungiDB. How could I select this one?

How could I link the two IDs to each other?
Ok, figured it out by looking at the scheme uniprot provides:

PREFIX up:&lt;http://purl.uniprot.org/core/&gt; 

SELECT ?protein ?yeast_id
WHERE
{
    Bind(&lt;http://purl.uniprot.org/uniprot/P00330&gt; as ?protein).
    ?protein up:encodedBy ?gene .
    ?gene up:locusName ?yeast_id    
}


So one starts at the accession number in the middle and then uses the path to the actual locusName.

Also the path via the database works fine, I just did not use the seeAlso correctly (protein was only bound to db but not to db2, that's why it returned all entries):

PREFIX up:&lt;http://purl.uniprot.org/core/&gt; 
PREFIX rdfs:&lt;http://www.w3.org/2000/01/rdf-schema#&gt; 

SELECT ?protein ?db ?db2
WHERE
{
    Bind(&lt;http://purl.uniprot.org/uniprot/P00330&gt; as ?protein).
    ?protein rdfs:seeAlso ?db .
    ?protein rdfs:seeAlso ?db2 .
    ?db up:database &lt;http://purl.uniprot.org/database/SGD&gt; .
    ?db2 up:database &lt;http://purl.uniprot.org/database/EuPathDB&gt;

}


This will return the desired output (one would still have to process the db2 entry, of course):

protein db  db2
http://purl.uniprot.org/uniprot/P00330  http://purl.uniprot.org/sgd/S000005446  http://purl.uniprot.org/eupathdb/FungiDB:YOL086C