diff --git a/query_service/core/routers/query.py b/query_service/core/routers/query.py
index b49e374..e569ed6 100644
--- a/query_service/core/routers/query.py
+++ b/query_service/core/routers/query.py
@@ -54,6 +54,27 @@ async def get_named_graphs():
}
return response_graph
+@router.get("query/xref-to-bkbit")
+async def get_bkbit_id(xref):
+ query_bkbit_id = f"""
+ PREFIX biolink:
+ PREFIX xsd:
+
+ SELECT DISTINCT ?bkbit_id
+ WHERE {{
+ ?bkbit_id biolink:xref "{xref}"^^xsd:anyURI .
+ }}
+ """
+
+ response = fetch_data_gdb(query_bkbit_id)
+ return {
+ "xref": xref,
+ "matched_ids": [
+ binding["bkbit_id"]["value"]
+ for binding in response["message"]["results"]["bindings"]
+ ]
+ }
+
@router.get("/query/sparql/")
async def sparql_query(