Indirect Link From An Entry

Retrieve indirect link of a given entry.

SPARQL query:

BASE <http://www.genome.jp/linkdb/> 
SELECT DISTINCT ?fromlabel ?linklabel ?vialabel ?tolabel ?tourl WHERE {
?from ?link ?via .
?via  ?link ?to  .

?from rdfs:label "#{dbentry}"   .
?link a          <link> .

?from rdfs:label ?fromlabel .
?link rdfs:label "original" .
?via  rdfs:label ?vialabel  .
?to   rdfs:label ?tolabel  .

?to   <core/url>      ?tourl  .
?to   <core/database> ?todb .
?todb <core/dblabel>  ?todblabel .

?via   <core/database> ?viadb .
?viadb <core/dblabel>  ?viadblabel .

FILTER (?fromlabel != ?tolabel) .
FILTER (("#{to_dblabel}"  = "")  || (?todblabel  = "#{to_dblabel}")) .
FILTER (("#{via_dblabel}" = "")  || (?viadblabel = "#{via_dblabel}")) .
} ORDER BY ?tolabel ?vialabel

Parameters:

(* = required)

Name Description
* dbentry entry name.
via_dblabel dblabel of the intermediate database.
to_dblabel dblabel of the target database.

Sample:

http://www.genome.jp/stanza/linkdb/indirect_link_from_an_entry?dbentry=hsa:5621&via_dblabel=Genomics