Open k00ni opened 6 years ago
Hello, a modification of your second test (and your row count of 3) demonstrates the insertions are successful; ARC2 allows the same triple in different graphs:
$res = $store->query('SELECT * WHERE { GRAPH ?g {?s ?p ?o }}');
print_r($res['result']['rows']);
// 3 rows are returned, also showing the graph associated with each triple
However the query in the last test is indeed only returning the first of the two triples actually present in graph2.
Unfortunately I don't yet have a solution(!) but I am interested if you have any further information on this, as I have what I believe are similar issues for multiple 'LOAD' statements - the data is loaded to the triple store but only the data from the first 'LOAD' is actually visible in subsequent queries.
After further testing I now have a solution for this issue, which also resolves the problems experienced with multiple 'LOAD' statements. In file ARC2_StoreLoadQueryHandler.php try changing line 228:
# old:
if (false !== empty($binaryValue)) {
# new:
if (false == empty($binaryValue)) {
The code here is locating the ID for a previously inserted value, but I believe the condition logic here is incorrect - the ID is never found, so a value may get inserted multiple times with different IDs. This leads to the inconsistencies observed, where inserted/loaded data is present in the triple store but not retrieved.
Unfortunately I don't yet have a solution(!) but I am interested if you have any further information on this [...]
Unfortunately no.
After further testing I now have a solution for this issue, which also resolves the problems experienced with multiple 'LOAD' statements.
Would you be OK with creating a test or two to reproduce the problem? And submit it as pull request, so that we can discuss the merge? That would be great.
OK yes I will do, have set up a separate issue #122 (related to LOAD statements) but it should fix this issue also
OK yes I will do
Nice to hear, looking for forward to it!
The following test code shows, that ARC2 does not seem to allow the same triple in different graphs. Is that right @semsol?