[07:29:29] Hello all [07:29:43] I'm looking for help with a Sparql query. [07:30:01] Here it is: [07:30:01] https://query.wikidata.org/#SELECT%20DISTINCT%20%3FiRail%20%3FsLabel%20%3FlineLabel%20%28group_concat%28distinct%20%3Fline%20%3B%20separator%20%3D%20%22%2C%20%22%29%20as%20%3Fline%29%20%20WHERE%20%7B%0A%20%20%3Fs%20wdt%3AP31%20wd%3AQ55488.%0A%20%20%20%20%3Fs%20wdt%3AP17%20wd%3AQ31.%0A%20%20%3Fs%20wdt%3AP2888%20%3FiRail.%0A%20%20OPTIONAL%7B%3Fs%20wdt%3AP81%20%3Fline.%20%7D%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%2 [07:30:01] 0%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20.%0A%20%20%7D%0A%7D%20GROUP%20BY%20%3Fline [07:30:12] I'm unable to group contact a particular field. [07:30:35] The error is: Query is malformed: Bad aggregate [07:31:01] I tried many solution, I'm still unable to get it working... a help is welcome. [07:42:11] The best I get so far is this: [07:42:11] https://query.wikidata.org/#SELECT%20DISTINCT%20%0A%20%20%3FiRail%0A%20%20%3FsLabel%0A%20%20%28GROUP_CONCAT%28DISTINCT%20%3Fline%3B%20SEPARATOR%20%3D%20%22%2C%20%22%29%20AS%20%3Fline%29%0AWHERE%20%7B%0A%20%20%3Fs%20wdt%3AP31%20wd%3AQ55488.%0A%20%20%3Fs%20wdt%3AP17%20wd%3AQ31.%0A%20%20%3Fs%20wdt%3AP2888%20%3FiRail.%0A%20%20OPTIONAL%20%7B%20%3Fs%20wdt%3AP81%20%3Fline.%20%7D%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd [07:42:11] %3AserviceParam%20wikibase%3Alanguage%20%22en%22.%20%7D%0A%7D%0AGROUP%20BY%20%3FiRail%20%3FlineLabel%20%3FsLabel%0AORDER%20BY%20%3FiRail [07:42:27] But I'm unable to use ?lineLabel as aggregated value. [07:50:34] Unable to get the lineLabel aggregated, I'm almost there: [07:50:34] https://query.wikidata.org/#SELECT%20DISTINCT%20%3FiRail%20%3FsLabel%20%28GROUP_CONCAT%28DISTINCT%20%3FlineLabel%3B%20SEPARATOR%20%3D%20%22%2C%20%22%29%20AS%20%3FlineLabel%29%20%28GROUP_CONCAT%28DISTINCT%20%3Fline%3B%20SEPARATOR%20%3D%20%22%2C%20%22%29%20AS%20%3Fline%29%20%28GROUP_CONCAT%28DISTINCT%20%3FlineLabel%3B%20SEPARATOR%20%3D%20%22%2C%20%22%29%20AS%20%3Fplop%29%20WHERE%20%7B%0A%20%20%3Fs%20wdt%3AP31%20wd%3AQ5 [07:50:34] 5488.%0A%20%20%20%20%3Fs%20wdt%3AP17%20wd%3AQ31.%0A%20%20%3Fs%20wdt%3AP2888%20%3FiRail.%0A%20%20OPTIONAL%7B%3Fs%20wdt%3AP81%20%3Fline.%20%7D%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20.%0A%20%20%7D%0A%7D%20GROUP%20BY%20%3FiRail%20%3FsLabel%0AORDER%20BY%20%3FiRail [08:14:00] I have something now! [08:14:00] https://query.wikidata.org/#SELECT%20DISTINCT%20%0A%20%20%3FiRail%20%0A%20%20%3FsLabel%0A%20%20%28GROUP_CONCAT%28DISTINCT%20%3FlineLabel%3B%20SEPARATOR%20%3D%20%22%7C%22%29%20AS%20%3FlineLabels%29%0AWHERE%20%7B%0A%20%20%3Fs%20wdt%3AP31%20wd%3AQ55488.%0A%20%20%20%20%3Fs%20wdt%3AP17%20wd%3AQ31.%0A%20%20%3Fs%20wdt%3AP2888%20%3FiRail.%0A%20%20OPTIONAL%7B%3Fs%20wdt%3AP81%20%3Fline.%20%7D%0A%20%20SERVICE%20wikibase%3Alabel [08:14:01] %20%7B%0A%20%20%20%20bd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20.%0A%20%20%20%20%3Fline%20rdfs%3Alabel%20%3FlineLabel%20.%0A%20%20%7D%0A%7D%20GROUP%20BY%20%3FsLabel%20%3FiRail%0AORDER%20BY%20%3FiRail now I need to display the stations names too and I'm done :) [10:21:05] drupol: next time just paste the shortened link :D [10:21:19] reosarevok: sorry :-) [10:21:32] Do you still need any help? [10:21:33] reosarevok: I haven't found a way to display station name :( [10:21:42] Ok let me see if I can figure it out :) [10:21:47] http://tinyurl.com/y9awvrus [10:22:39] I would like to display the Station name too, but I'm unable to do that, the column is alway blank. [10:25:31] @reosarevok maybe this will help: http://tinyurl.com/yd254agl [10:26:46] drupol: http://tinyurl.com/yadw5xfs [10:26:58] Checking. [10:27:15] o_0 [10:27:22] it took you less than 5 minutes... [10:27:28] it's been hours that I'm that... [10:27:32] *on that [10:27:49] :) If it had been Lucas_WDME it would have taken him 5 seconds instead [10:28:01] OMFG... thanks man... [10:28:08] Impressive. [10:28:12] np! glad I could help [10:29:00] Sure you helped me [10:29:03] It will be included in here: [10:29:10] https://www.npmjs.com/package/irail-api [10:29:40] :) Neat [10:29:43] Real world uses [10:29:48] I like those :D [10:30:13] yep :) [10:30:18] we'll see if it's used [11:03:44] ping [11:07:45] ping someone, specifically? :p [12:34:22] Hello! I am writing a terminal based database browser. Would like to include a test database with some public domain data. Any ideas what to use? [12:50:25] maxlath[m]: :D [12:50:33] where does your wd-clie tool store its config? [12:51:52] aaah... wd config path tells me [17:14:37] sjoerddebruin: https://www.wikidata.org/wiki/Special:Contributions/Thierry_Caro <- Wat vind jij hier nu van? Voegt overal imported from als source toe.... [17:15:09] Onzin. [17:15:36] https://www.wikidata.org/wiki/User_talk:Thierry_Caro#Imported_from_is_not_a_reference want dit is wat ik terug krijg [17:16:17] Misschien was je iets te vaag in het begin. [17:28:18] Tja, wellicht [17:28:47] reosarevok: ping? [17:34:57] drupol: pongish [17:35:19] On a phone but :) what is it? [17:35:46] I need you for a couple of seconds once again... what if I want to get the URL to the station in the result: http://tinyurl.com/yadw5xfs [17:35:54] (that's the one you did earlier) [17:36:01] Oh if you're busy it can wait.. [17:36:05] I don't mind at all [17:37:20] You mean the Wikidata URL? [17:37:35] Yes [17:37:55] I made a small dashboard: https://young-cliffs-90300.herokuapp.com/web [17:38:10] Where are I can see which stations are ok and which one are not. [17:38:22] I'd like to have a link to WD inside the popup. [17:38:27] So I can fix that issue quicker. [17:40:26] Just selecting ?s would give you a link of course but not one that works for just copying the results I guess [17:42:00] I just need the URL to wikidata, I'll build the link myself [17:42:10] I'll test with ?s [17:42:10] But BIND(SUBSTR(STR(?item), STRLEN(STR(wd:)) + 1) AS ?itemQID) gives you the bare id [17:42:53] Well, ?s not ?item for you. So from that you can build the link, if that's better than just ?s [17:43:02] Ooh it works :-) http://tinyurl.com/yahcapaj [17:43:06] Can't do more from phone but maybe someone else here can if needed :) [17:43:14] Thanks man :-) [17:43:17] reosarevok++ [20:24:00] I have seen somewhere the list of all language codes supported by Wikidata. Is there someone here who remind where it is? [20:25:23] Tpt[m]: https://stackoverflow.com/questions/46507037/how-to-get-all-allowed-languages-for-wikidata/46562061#46562061 maybe? [20:26:05] pintoch: thank you. Id does the job [20:26:23] "It seems as though the list for allowed languages for MonolingualText is different and not accessible today." [20:28:13] dummy language codes are listed at https://www.wikidata.org/w/api.php?action=query&meta=siteinfo&siprop=languages&utf8=1 [20:32:20] Nemo_bis: what do you mean by "dummy"? [20:41:23] pintoch: https://www.mediawiki.org/wiki/Manual:$wgDummyLanguageCodes [20:43:51] Nemo_bis: Retrieving the list build from the wbsetlabel API documentation is probably safer because it is the one internaly used by Wikibase [20:44:39] but maybe both are the same [22:54:32] Uh oh, getting a bunch of read-only warnings