Open galgonek opened 2 years ago
When I load your tables and generate default RDF Views from the tables all the SQL queries return no data:
SQL> sparql prefix : <http://hfw.openlinksw.com:8890/schemas/git1064/> select ?entry where { ?entry :gene / :chromosome "13"^^xsd:string. ?entry :isoform / :medical / rdf:type :Disease. };
entry
LONG VARCHAR
_______________________________________________________________________________
0 Rows. -- 133 msec.
SQL> sparql prefix : <http://hfw.openlinksw.com:8890/schemas/git1064/> select ?entry where { ?entry :gene / :chromosome "13". ?entry :isoform / :medical / rdf:type :Disease. };
entry
LONG VARCHAR
_______________________________________________________________________________
0 Rows. -- 162 msec.
SQL> sparql prefix : <http://hfw.openlinksw.com:8890/schemas/git1064/> select ?entry where { ?entry :gene / :chromosome "13"^^xsd:string. ?entry :isoform / :medical / rdf:type ?type. };
entry
LONG VARCHAR
_______________________________________________________________________________
0 Rows. -- 118 msec.
SQL>
Thus how are you creating your RDF Views ?
What is the version number and gitid of the binary being used, which can be obtained from the output of running virtuoso-t -?
I do not use the automated generation of Linked Data Views, I have created Linked Data Views manually. However, my database has more than 100 GB, and it is not easy to prepare a small example to demonstrate the issue because the issue depends on a selected execution plan that is typically different for small databases.
But I have observed that the issue is related to the SQL query evaluation. Thus I have prepare the SQL query to demonstrate the issue. Please try the SQL commands mentioned after the sentence "I was able to prepare the following scenario to demonstrate the issue", these commands demonstrate the incorrectly evaluated SQL query.
My version of Virtuoso is 7.2.7.3234-pthreads.
@galgonek -- Please execute the command virtuoso-t -?
and provide the full first stanza of output, which includes both the simple version you've provided and the exact gitid
of the codebase from which it was built (as there may be dozens if not hundreds of commits made to the /develop/7
branch between, for instance, 7.2.7.3234
and 7.2.7.3235
). You can also get the gitid
through a SPARQL query. Knowing this gitid
allows us to test backward in the codebase, to see whether and where we may have introduced the issue, as well as forward to test our patch.
As I just checked, the issue is present in both stable and development versions:
Version 7.2.7.3234-pthreads as of Aug 5 2022 (031118cc2)
Version 7.2.8-dev.3234-pthreads as of Aug 5 2022 (4b1e6fa24)
Thank you! Those details will be helpful to our ongoing testing and analysis.
I use Linked Data Views and I observed that some SPARQL queries are not evaluated correctly if they contain string literals with the xsd:string datatype. Without this datatype (i.e., if simple literals are used), the queries work as expected.
For example, the query —
— returns the empty result. However, the query —
— returns results as expected.
On the other hand, the query —
— works correctly even if the xsd:string is present.
I tried to identify a source of the problem and I found that SQL queries generated by Linked Data Views are correct, but they are incorrectly evaluated in some scenarios. When I tested them on a smaller database, the SQL queries works correctly as their execution plan were different in this case.
Through it all, I was able to prepare the following scenario to demonstrate the issue:
In the database —
— the SQL query —
— returns the empty result. However, the result —
— is expected.
If the ORDER option is removed from the end of the SQL query, the correct result is returned!