TomT0m created this task. TomT0m added a project: Wikidata-Query-Service. Restricted Application added a subscriber: Aklapper. Restricted Application added a project: Wikidata.
TASK DESCRIPTION This query using label variables from the query service ( ?profLabel ) with the aggregation function works fine. But I had to explicitely name the ?profLabel variable in the wkibase:label call. I’d had expected the next query to work also (same without doing the explicit naming) but it does not work, blazegraph seem to not pick up the autonamed variables to work in agregation functions. sparql select ?personne ?nombre_profession ?personneLabel (group_concat(?profLabel;separator=" ; ") as ?professions) with { select ?personne (count(?prof) as ?nombre_profession) { ?personne wdt:P106 ?prof . service bd:sample { ?personne wdt:P31 wd:Q5 . # optional service params for the sample bd:serviceParam bd:sample.limit 100000 . #bd:serviceParam bd:sample.seed 0 . bd:serviceParam bd:sample.sampleType "RANDOM" . } } group by ?personne having (?nombre_profession > 3) } as %sample with { select ?personne ?personneLabel ?nombre_profession ?prof ?profLabel { include %sample ?personne wdt:P106 ?prof . #?personne rdf:laber ?personneLabel filter (lang(?personneLabel) = "fr" or lang(?personneLabel) = "en" ) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?prof rdfs:label ?profLabel . ?personne rdfs:label ?personneLabel . } } } as %labelled_sample { include %labelled_sample } group by ?personne ?personneLabel ?nombre_profession order by desc(?nombre_profession) sparql select ?personne ?nombre_profession ?personneLabel (group_concat(?profLabel;separator=" ; ") as ?professions) with { select ?personne (count(?prof) as ?nombre_profession) { ?personne wdt:P106 ?prof . service bd:sample { ?personne wdt:P31 wd:Q5 . # optional service params for the sample bd:serviceParam bd:sample.limit 100000 . #bd:serviceParam bd:sample.seed 0 . bd:serviceParam bd:sample.sampleType "RANDOM" . } } group by ?personne having (?nombre_profession > 3) } as %sample with { select ?personne ?personneLabel ?nombre_profession ?prof ?profLabel { include %sample ?personne wdt:P106 ?prof . #?personne rdf:laber ?personneLabel filter (lang(?personneLabel) = "fr" or lang(?personneLabel) = "en" ) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } } as %labelled_sample { include %labelled_sample } group by ?personne ?personneLabel ?nombre_profession order by desc(?nombre_profession) TASK DETAIL https://phabricator.wikimedia.org/T244924 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: TomT0m Cc: Wikidata-bugs, Aklapper, TomT0m, darthmon_wmde, Nandana, Lahi, Gq86, Lucas_Werkmeister_WMDE, GoranSMilovanovic, QZanden, EBjune, merbst, LawExplorer, _jensen, rosalieper, Scott_WUaS, Jonas, Xmlizer, jkroll, Smalyshev, Jdouglas, aude, Tobias1984, Manybubbles, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs