From Advanced Queries to Algorithms and Graph-Based ML: Tackling Diabetes with Knowledge Graphs