Open vikramsubramanian opened 4 months ago
Summary: Issue with setting the IRI of predicates in Relationship tables of RDFGraphs in UniKG example.
Based on the provided information, the issue is with setting the IRI of predicates in Relationship tables of RDFGraphs. The IRI of the resource node is not being set correctly. To address this issue, consider the following solution:
bind_graph_pattern.cpp
file to include logic that checks if the IRI exists in the Resources table and adds it if necessary before setting it on the Relationship.setProperty
function to handle the setting of the iri
property correctly, ensuring that it references the correct entry in the Resources table.Here is a pseudo-code outline of the steps to take in the bind_graph_pattern.cpp
file:
if (!resourceTableIDs.empty()) {
// ... existing code ...
// Check if the IRI exists in the Resources table
auto iriID = checkAndAddIRIToResourcesTable(iri);
// Set the IRI of the predicate relationship
setProperty(queryRel, rdf::IRI, iriID);
// ... existing code ...
}
And in the setProperty
function:
void setProperty(Entity entity, String propertyKey, String propertyValue) {
if (propertyKey.equals(rdf::IRI)) {
// Logic to set the IRI property, referencing the Resources table
} else {
// Existing logic for other properties
}
}
Make sure to test the changes thoroughly to ensure that the IRI is being set correctly and that the expected behavior is achieved.
src/binder/bind/bind_graph_pattern.cpp
This snippet contains logic for binding properties of relationships in RDF graphs, which is directly related to the issue of setting the IRI of predicates in Relationship tables.
I tried the following query in the UniKG example in the documentation:
This query is trying to set the IRI of the resource node. I got the following output:
Which already is wrong. But it also did not have any effect, i.e., the IRI stayed the same:
The previous IRI is still there. And when I query for all triples, I don't see any triple of Waterloo with predicate
We should either disable setting iris of predicates or support this so that we implement the right behavior, which is: 1) add the predicate if needed to Resources table 2) set the IRI of the predicate relationship. )