-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to query with code? #25
Comments
Hey hey, thanks for looking into this. Indeed, the current query notation is not really SPARQL- or database-ready - it is inherited from how Query2Box defined the queries in this parenthesis notation.
SELECT ?t WHERE { e r ?t}
SELECT ?y WHERE {
e r1 ?x .
?x r2 ?y
}
The "query engine" in UltraQuery expects the parenthesis notation to derive the execution order, so in case you want to answer SPARQL queries with the model, there should be some external module (smth rule-based or even LLM, hehe) that parses SPARQL queries to this notation. The graphs are expected to be PyG Data objects residing in memory (RAM or GPU memory). PyG itself does have some bindings to call external graph databases but there is no specific piece of code to query external databases. Might be a useful PR though! |
Very cool, that was a great explanation @migalkin.
That's exactly my end-goal! 😅 I'm struggling so others don't have to. |
Sorry, so you're saying that the right way, or the best way, of going about this is creating a |
Somethings like this, yes. |
Hey @migalkin, thank you for making this project open source! It's really awesome :)
I'm trying to use Ultraquery on my ontologies but I'm new to the ecosystem and I'm struggling to understand how to write queries in Python. I understand the overall idea of performing search with FOL and how it translates to this:
ULTRA/ultra/datasets_query.py
Lines 23 to 40 in 561f2c7
But I haven't found a piece of code that is querying a database.
I've unpickled the query files that were used to train Ultra... But that also didn't prove very enlightening.
I think I'm going in the complete wrong direction. That's why I'm asking for help!
Once I've figured this stuff out I'm happy to write a little tutorial or docs for newbies like me to get started with the project, if you think it'd be beneficial.
Best and thanks again,
The text was updated successfully, but these errors were encountered: