|
Hello all. I would like to ask about the semantics that the GROUP_CONCAT function comes with. I experimented a little bit with Jena and if I use UNIONs and GROUP_CONCAT then I am getting an error. I know that UNION would also give for multiple variables a lot of null values. I thought that GROUP_CONCAT would have to problem to take them and do something like: (null, null, dbpedia:Peter). Can't UNION and G_C exist and work together? I always have to use joins (.) to connect triple patterns? Example is:
An alternative of course whould be to join the triple patterns. However, the problem using joins of triple patterns is that if a variable returns nothing as result, even if the variables are not practically joined with each other since they have nothing in common, then the whole query returns a null value as a result. P.S.: One would suggest to use OPTIONAL. I already asked a question about OPTIONAL and I don't want to use it for some reasons. I want to use a set of UNIONs however together with GROUP_CONCAT since this function is very helpful for me. |
|
and look at the rows. Now when the whole thing gets aggregated (you have an aggregation in the Try pushing the GROUP_CONCAT into the UNION:
Thats a very good idea! Thanks I will check it tonight and see what results I get. I have one question though, the * will make the query do the computation also for the variables that are not inside the GROUP_CONCAT. Isn't this an overhead since I don't care about those. I have a feeling that if I specify what variables I want, I will cause a Jena error Unused variables are free in Jena. but anyway the only variable coming out of
is ?var2. Aggregation will hide the ?variable2 aand anything else inside the group (it's a group of the whole pattern in this case - no GROUP BY) |

