[00:27:50] mittenchopper : i answered [00:29:58] ... [00:31:24] https://www.youtube.com/watch?v=kiiGJq4IFvo#t=6.8s [00:31:29] oh wait, i'm already home [04:30:37] I know that if I'm here: https://en.wikipedia.org/wiki/Irvine,_California I can get to the wikidata entity, Q49219, by clicking on the link in the sidebar, that says "wikidata Item." How do I do the inverse? What's the property that I can use to find an en wikipedia page given a wikidata node? [04:46:45] mittenchopper: I don't think sitelinks are considered "properties" [04:50:49] @Glaisher, when I'm here: https://www.wikidata.org/wiki/Q49219 I see in the lower left the Wikipedia (46 entries). Is there something in wikidata that populates or links to that? [04:51:51] mittenchopper: sitelinks are stored on wikidata itself [05:00:15] Thanks, @Glaisher. The word "sitelink" helped, and I found: http://opendata.stackexchange.com/questions/6050/get-wikipedia-urls-sitelinks-in-wikidata-sparql-query [07:52:15] Anyone to answer my question from half a day ago? [07:53:02] 22:17 UTC [13:16:46] can someone help me get to grips with petscan [13:18:33] I want a working example where a category is used for a university (educated at) and where Wikidata has it that there is no statement for educated at the university [13:18:49] Thanks [13:30:36] GerardM : "Categories" tab, in the "Categories" field, put "Harvard University alumni" ; "Other sources" tab, in the "SPARQL" field, put SELECT ?item WHERE { ?item wdt:P69 wd:Q13371 . } ; and still in the same tab, in the "Combination" field, put "categories NOT sparql" [13:30:42] then click "do it" [13:31:04] only works for one category (so university/school/institute/whatever) at a time [13:31:14] Q13371 is the item for harvard U [13:31:16] it is what I am seeking :) [13:32:05] enjoy :) [13:40:39] where do I then add the statement I want to add ? [13:43:33] Alphos I modified the list for SELECT ?item WHERE { ?item wdt:P69 wd:Q1706859 . } the Hampshire College alumni and there is a box where I can add the statement I want added but it does do nothing [13:45:17] can this be because it needs Authorisation [13:48:30] GerardM categories go in the first tab, sparql queries in the fourth tab ;) [13:48:46] that I did [13:49:33] and if you only need "educated at", you just need to change the wd:Q part to wd:Q [13:49:34] it is that I cannot process the addition of new statements [13:49:45] what other statements do you want for instance ? [13:50:06] something along the lines of "born before 1870" ? [13:50:24] the petscan query has people who are in the category but do not have a statement, [13:50:31] that is what I want to add [13:50:35] oooooooooh ! [13:50:40] I need them to be human as well [13:51:27] darn, you and your weird requirements for students to be human ! :p [13:52:38] if you want only the human students, add "?item wdt:P31 wd:Q5 ." inside the WHERE clause of your sparql [13:53:55] SELECT ?item WHERE { ?item wdt:P31 wd:Q5 ?item wdt:P69 wd:Q1706859 . } ?? [13:54:01] you're missing a dot [13:54:17] SELECT ?item WHERE { ?item wdt:P31 wd:Q5 . ?item wdt:P69 wd:Q1706859 . } [13:54:21] dots are important ! [13:54:24] don't forget your dots ! [13:54:40] yeah ... [13:54:43] they are [13:55:13] this is my query https://petscan.wmflabs.org/?psid=123980 [13:55:31] as for actually adding the "Q P69 wd:Q" statement to the Q item, i don't know if petscan can do it, i've only used it for scanning, not for writing [13:56:23] so how do I process the "P69:Q1706859" [14:02:17] in the "Wikidata" tab, tick "Add items, where available" ; then from the "output" tab, grab a CSV, open it in your favorite spreadsheet editor (not directly, first download it or you won't be able to edit it), remove all columns but the second, the one with "title" as its header (which will become the first column) [14:02:56] That seems rather devious. [14:03:22] then in the (now empty) second column, add P69 on the entire height of the column, first element to last ; and in the (now empty) third column, add Q, in your case Q1706859 [14:03:41] then export to TSV, shove it in quick statements, and sip a glass of juice :) [14:04:55] oh wait, i just noticed ! [14:05:06] there's a tiny command list down there at the bottom ! [14:05:09] yes [14:05:13] * Alphos zooms back >_> [14:05:32] you only need to include P and Q before the numbers though ;) [14:05:52] that is it [14:05:59] so just shove P69:Q1706859 in there, click the "Check All" button" and "Process command" [14:06:08] (once you have the list, i imagine) [14:06:20] indeed [14:06:34] what can i say, i'm just a QS groupie :p [14:06:50] i'm guessing 99% of my edits are through QS ^^° [14:07:12] Petscan can process most of the item datatype statements easily, you need QS for most of the others. [14:07:59] how petscan handle refs ? [14:08:24] not to mention other qualifiers :x [14:08:27] I used Autolist 2 and replacing it with Petscan is fine [14:08:38] but I hate to lose Autolist [14:08:55] autolist is way too slow >_< [14:08:57] it is really versatile when you manually work on a large subset of data [14:09:17] ask for a list, go for coffee just doesn't do it for me ^^' [14:09:20] Alphos: yeah, it's only useful for easy stuff [14:10:57] The thing I use is Reasonator / Petscan has no link to it [14:11:11] it does not break it in chunks of fifty [14:13:28] How quickly should SPARQL update ? [14:13:58] Mostly 5 minutes. [14:22:09] Ok another issue [14:22:13] I have a list of items [14:22:29] and I only want the items that are human and did not win the award [14:22:36] usally less than 5 minutes though [14:22:43] sometimes as little as 10 seconds ^^ [14:23:23] SELECT ?item WHERE { ?item wdt:P31 wd:Q5 . ?item wdt:P166 wd:Q7970020) . } this is the award [14:23:28] one moment [14:23:56] the list is based on the article using linked items [14:23:58] Wikidata tab > User items/props > P166 and select none [14:24:17] p166 is any award [14:24:17] GerardM SELECT ?item WHERE { ?item wdt:P31 wd:Q5 . FILTER NOT EXISTS { ?item wdt:P1411 wd:Q } } [14:24:42] oh, or P166 [14:25:19] yeah that will do [14:25:27] alphos that goes in the other sources SPARQL part ? [14:29:14] GerardM yes, but you have to remove the "Combination" field in the "other sources" tab (so it falls back to default, which is AND-ALL) [14:29:31] (or just replace it with "categories AND sparql" without the double quotes) [14:30:23] bbiaf, hopefully >_> [14:31:24] Rather disappointing. https://www.wikidata.org/wiki/Q504331 [14:35:12] ^^' [14:40:29] SELECT ?item WHERE { ?item wdt:P31 wd:Q5 . FILTER NOT EXISTS { ?item wdt:P166 wd:Q7970020 } } gets me a SPARQL error [15:05:35] GerardM https://petscan.wmflabs.org/?language=en&project=wikipedia&categories=Hampshire%20College%20alumni&ns%5B0%5D=1&sparql=SELECT%20%3Fitem%20WHERE%20%7B%20%3Fitem%20wdt%3AP31%20wd%3AQ5%20.%20%3Fitem%20wdt%3AP166%20wd%3AQ7970020%20.%20%7D&source_combination=categories%20NOT%20sparql&wikidata_item=any&interface_language=en&active_tab=tab_output&doit= [15:42:44] http://tinyurl.com/zdsbxmn https://www.rio2016.com/en/medal-count-country hmmm [22:14:42] hey people ! i want to add an example query : http://tinyurl.com/z8cc6yq [22:15:11] it lists which properties are used in statements pointing to a given item, and how many times they're used [22:15:28] i'd like to say it would help a lot with deciding on ontologies :) [22:41:37] well, if you don't like it, you can simply remove it if you want :) https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries#More_examples [22:48:12] by the way, in quite a few examples, there are BIND clauses that are plain unnecessary. instead of http://tinyurl.com/hnb226m (12170 ms), why not replace the bound values where needed ? http://tinyurl.com/zgvywop (same results, 1656 ms)