-
Notifications
You must be signed in to change notification settings - Fork 0
GDB-8161 MongoDB connector: Multiple index calls in the same query #21
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
base: master
Are you sure you want to change the base?
Conversation
… and fixed the second example from multiple index calls in the same query documentation
The MR resolves the issue with the second query from the documentation (GDB-8161) and the problem described in GDB-8473. With the proposed solution it will be possible to create custom graphs (regarding the second query from the documentation) using the two namespaces - "http://www.ontotext.com/connectors/mongodb#" and "http://www.ontotext.com/connectors/mongodb/instance#". If we want to use only the one namespace (as it was before the proposed fix), we can change the example in the documentation because it uses the other namespace and because of that the query doesn’t work. If we want to use the both namespaces, again can be clarified in the documentation because with different namespaces the query will not work. |
@@ -243,7 +243,7 @@ public StatementIterator interpret(long subject, long predicate, long object, lo | |||
if (predicate == rdf_type && context == 0) { | |||
if (object >= 0) | |||
return null; | |||
String suffix = Utils.matchPrefix(Utils.getString(entities, object), NAMESPACE_INST); | |||
String suffix = Utils.matchPrefix(Utils.getString(entities, object), NAMESPACE_INST, NAMESPACE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not care about this, since context is 0, we never get to here with the specific graph
@@ -502,7 +502,7 @@ public boolean interpretUpdate(long subject, long predicate, long object, long c | |||
|| predicate == passwordId || predicate == authDbId) { | |||
// no valid object or subject | |||
// get new instance localname | |||
String suffix = Utils.matchPrefix(Utils.getString(pluginConnection.getEntities(), subject), NAMESPACE_INST); | |||
String suffix = Utils.matchPrefix(Utils.getString(pluginConnection.getEntities(), subject), NAMESPACE_INST, NAMESPACE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should never get here as well
@@ -541,7 +541,7 @@ public boolean interpretUpdate(long subject, long predicate, long object, long c | |||
return true; | |||
} | |||
if (predicate == dropId) { | |||
String suffix = Utils.matchPrefix(Utils.getString(pluginConnection.getEntities(), subject), NAMESPACE_INST); | |||
String suffix = Utils.matchPrefix(Utils.getString(pluginConnection.getEntities(), subject), NAMESPACE_INST, NAMESPACE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can lead to lot of thrown exception, don`t need it here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I run this branch in order to test the examples from the documentation, the first example was still giving only 1 result (if we swap mongodb:entity ?entity to be in the first sub-query and mongodb:entity ?creativeWork in the second sub-query we get 2 results).
The MR includes fixes for GDB-8161 and GDB-8473 tasks.