My current project requires the information about exon start/end on UniProt entries. My Uniprot entries are mapped to Ensembl transcript ids. I would like to know if there is a straightforward way to obtain exon start/end mapped on Uniprot entry (if necessary, given the Ensembl transcript id) via the REST service.
I don't know if you can do this via the Ensembl rest service but it can be done by combining
the UniProt sparql endpoint and the Ensembl sparql endpoints. Although if you have the Ensembl transcript ids you can use the ensembl one directly without involving the UniProt one by using the part in the service clause.
This gets the exons in Ensembl for the UniProt entry P05067. It first gets the corresponding transcripts then for each transcript we go the ensembl endpoint. There we double check the transcript translates to a peptide. The transcript has ordered parts in the Sequence ontology.
This is then linked to the exon. Then we get the location of the exon on the chromosome and ask for the begin and end. Then we calculate the length by figuring out the difference between those and make that a an positive value using the ABS function.
Here's a live SPARQL Query results page link, using the Uniprot SPARQL Query Service, with regards to your answer above. Net effect, this puts readers a mouse click away a page demonstrating the effect of your Federated SPARQL Query :)