Skip to content
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

Calling SQL from SPARQL: Transaction deadlocked #468

Closed
galgonek opened this issue Aug 24, 2015 · 3 comments
Closed

Calling SQL from SPARQL: Transaction deadlocked #468

galgonek opened this issue Aug 24, 2015 · 3 comments

Comments

@galgonek
Copy link

Hi,

calling SQL from SPARQL does not work correctly in my case.

I perform a clean installation of virtuoso, and then I load data:

ld_dir ('/home/galgonek' ,'chebi_test.nt.gz', 'http://bioinfo.uochb.cas.cz/data/chebi#');
rdf_loader_run();

Data can be downloaded from https://drive.google.com/file/d/0B3EkPc9W8U0USFJzTzRsUzhfWHc/view?usp=sharing.

For the purpose of this report, I define the following procedure:

create procedure testProcedure(in par1 varchar, in par2 varchar, 
        in par3 varchar, in par4 varchar) {
    result('http://bioinfo.uochb.cas.cz/test1');
    result('http://bioinfo.uochb.cas.cz/test2');
};

Then I submit the followig query:

sparql
select (sql:testProcedure(?ROLE, 'MOL', 0.8, 1) as ?TEST) where {
    ?ATB <http://bioinfo.uochb.cas.cz/0.9/chebi#isA> * 
         / <http://bioinfo.uochb.cas.cz/0.9/chebi#hasRole> ?ROLE.
};

After the submission, isql prints http://bioinfo.uochb.cas.cz/test1 and http://bioinfo.uochb.cas.cz/test2 as it is expected. However, it also prints 0. And finally, the following error is returned *** Error 40001: [Virtuoso Driver][Virtuoso Server]SR172: Transaction deadlocked.

@HughWilliams
Copy link
Collaborator

@galgonek: I get a slightly different SR172 error but seems transactional all the same so we shall look into this ...

SQL> sparql select (sql:testProcedure(?ROLE, 'MOL', 0.8, 1) as ?TEST) where {     ?ATB <http://bioinfo.uochb.cas.cz/0.9/chebi#isA> *           / <http://bioinfo.uochb.cas.cz/0.9/chebi#hasRole> ?ROLE. };
TEST
VARCHAR
_______________________________________________________________________________

http://bioinfo.uochb.cas.cz/test1
http://bioinfo.uochb.cas.cz/test2
http://bioinfo.uochb.cas.cz/test1
.
.
.
http://bioinfo.uochb.cas.cz/test2
http://bioinfo.uochb.cas.cz/test1
http://bioinfo.uochb.cas.cz/test2

*** Error 4000X: VD [Virtuoso Server]SR177: Misc Transaction Error
at line 19 of Top-Level:
sparql select (sql:testProcedure(?ROLE, 'MOL', 0.8, 1) as ?TEST) where {     ?ATB <http://bioinfo.uochb.cas.cz/0.9/chebi#isA> *           / <http://bioinfo.uochb.cas.cz/0.9/chebi#hasRole> ?ROLE. }
SQL> 

@HughWilliams
Copy link
Collaborator

Development indicate that when calling SQL stored procedures (sql:) or built in functions (bif:) in SPARQL expressions only single return values are supported/expected and NOT result sets with multiple rows. We shall update the documentation http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsqlfromsparql , to emphasise this point ...

Is there a specific reason/need you have for result sets to be returned ?

@galgonek
Copy link
Author

galgonek commented Sep 1, 2015

Thank you for the answer.

Is there a specific reason/need you have for result sets to be returned?

We have a SQL stored procedure that searches for similar chemical compounds. The procedure has several parameters and we try to find a way how to integrate this procedure into SPARQL queries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants