-
Notifications
You must be signed in to change notification settings - Fork 20
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
Elegant wat of filtering sets in sparql like style #66
Comments
I've noticed interesting thing. When we populate atomspace with more atoms:
and so on, running previously mentioned |
When it works it works correctly. The result is |
First of all, I never get segfault in such cases.
is an efficient way to do such queries, since the interpreter stomspace doesn't have range-based indexing for numeric values. There were ideas to implement custom indexing for grounded types, but they have not been implemented. So, what can be done now with the interpreter atomspace is to query for one pattern, filter out unnecessary results and query for the second pattern. It looks ok. The difference with SPARQL is only that all the parts are packed in one query there, while you need to write
It will less efficient (most likely), because it will query the second part of the pattern before filtering. It looks somewhat more elegant, though. So, it might be worthy to measure performance.
|
Consider we have example database and query in sparql:
The resul would be:
Let's try to reproduce this example in metta. Database will look like this:
The question is: do we have more elegant way to gain the same result than using code below?
The result would be just what we need:
[(semantic-web 23)]
The text was updated successfully, but these errors were encountered: