Left join sparql query

Oct 6, 2014 at 3:59 PM
Edited Oct 6, 2014 at 4:00 PM
Hi there,

I am trying to run a 'left join' sparql query on BSD, but the query just hangs.

basically I have the following two queries:
select ?p ?o 
{<http://example.org/productions/9949976d-9f26-4e16-8fc0-8402944141f2> ?p ?o }

select ?p ?o ?resourceName
 where {<http://example.org/productions/9949976d-9f26-4e16-8fc0-8402944141f2> ?p ?o .
?o <http://www.mydomain.com/types/resourceName> ?resourceName
I would like to combine them to get the following three columns:
?p ?o ?resourceName (could be empty)

I have tried the following query:
select ?p ?o ?resourceName 
{<http://example.org/productions/9949976d-9f26-4e16-8fc0-8402944141f2> ?p ?o .
OPTIONAL {?o <http://www.mydomain.com/types/resourceName> ?resourceName.}
which looks correct according to the documentation, but when I run it through the web app it just hangs.

I am not sure whether the query is correct, and BSD hangs, or whether the query is incorrect.

Any ideas?

Oct 7, 2014 at 1:55 PM

I can confirm that I have reproduced the bug with some very simple test data so I'll set about making a unit test and see if I can get a fix for this.


Oct 7, 2014 at 2:13 PM
Thank you :-)
Oct 7, 2014 at 4:58 PM
It turned out to be a problem with the HTML rendering for the SPARQL result - the query was running fine it was just that the template wasn't handling a NULL value in the SPARQL results set and Nancy then got stuck while trying to render its error page. I've pushed a fix for this to the github repo.
Marked as answer by techquila on 10/9/2014 at 12:17 PM
Oct 9, 2014 at 9:49 AM
Perfect, thanks, that worked! :-)
Oct 9, 2014 at 7:17 PM