|
Hello all, I would like to ask a question about the OPTIONAL clause. Suppose we have this graph pattern:
Even in this case, where the variables are not the same, so they are not "joined", if there are no triples that match for example the third triple pattern, then the whole query is going to give me nothing as result. How is it possible that the triples are connected, even though they have nothing in common? I would imagine that even if there is nothing in the ?email variable I would get a cross product for the three variables that would contain something like NULL or empty string for the ?email. This problem happens also when I am not SELECTing the ?email variable. If there are no triples that match, I get no answer for all the SELECTed variables. Of course, one would say to use OPTIONAL for every triple pattern so that to be sure that I get results back. And yes, when I am using it I get results, even if the last triple pattern match no triples. However, I would prefer to find a way not to use the OPTIONAL clause. Any ideas? Thank you very much for your time! |


Can you clarify why you don't want to use
OPTIONALin your question?I just want to remark that it seems to me that the way in which you are going about querying is very odd (and bound to cause you performance problems). Why are you formulating a single query that is about three completely separate subjects?