Wikidata is a free knowledge base that you can edit! It can be read and edited by humans and machines alike and you can go to any item page now and add to this ever-growing database!
Need some help getting started? Here are some pages you can familiarize yourself with:
Tools – A collection of user-developed tools to allow for easier completion of some tasks.
Please remember to sign your messages on talk pages by typing four tildes (~~~~); this will automatically insert your username and the date.
If you have any questions, don't hesitate to ask on Project chat. If you want to try out editing, you can use the sandbox to try. Once again, welcome, and I hope you quickly feel comfortable here, and become an active editor for Wikidata.
Latest comment: 11 years ago3 comments2 people in discussion
In this change you claimed that William Harbord was born 25 April 1635 in the Gregorian calendar, and that the date comes from the English Wikipedia. But the English Wikipedia states that he was born 25 April 1635, with no calendar being specified. The normal practice of historians writing about that period in England, and also the practice called for in en:Wikipedia:Manual of Style/Dates and numbers#Julian and Gregorian calendars, is to use the Julian calendar, which was the calendar in force at that time in England. Thus the date should be interpreted as being in the Julian calendar, and converted to the Gregorian calendar before adding to Wikidata. Jc3s5h (talk) 02:23, 23 August 2014 (UTC)Reply
Hi, thank you for pointing out my error. I have corrected it for William Harbord, but I may also have done similar errors while inserting other dates. I will try to be more aware of the used calendar in future edits. Regards, Dipsacus fullonum (talk) 05:55, 23 August 2014 (UTC)Reply
Latest comment: 8 years ago2 comments2 people in discussion
Vil du se på mine rettelser idag, jeg har måttet indgå en række kompromisser. Tre personer, far, søn og datter, fik to forskellige efternavne: Elena Baltacha (Q232680), Sergei Baltacha (Q4076889) og faderen Sergei Baltacha (Q552337), translitterationen ændrededes i vist nok 1991, og samtidigt har børnene boet i England/Scotland i adskillige år. Så de har sikkert officielt skiftet navn til en translitteration. På artiklen om da:Elena Baltacha på da wiki, har jeg indsat de forskellige navne i brødteksten. Og om P. Jurgenson (Q20054933) måtte jeg også indgå et kompromis, grundlæggeren af forlaget var en estisk-svensker, der var født i Tallinn, hvor han sikkert fik det svenske navn. Samtidigt er der en artikel om ham på sv wiki, derfor valgte jeg at sætte aka Musikforlaget P.I. Jürgenson. Han er selv indsat som Peter Jürgenson, mens hans søn og barnebarn begge har fået den danske translit af det russiske efternavn, Jurgenson, da de sikkert havde droppet deres svenske navn. Jeg vil blive glad hvis du forholder dig til navnene. Ligesådan vil jeg gerne høre hvad du mener om "kandidat nauk" = "Ph.D." efter du har set mine link. PerV (talk) 09:51, 24 March 2017 (UTC)Reply
Forbehold: Jeg er ikke kompetent inden for translitteration, og har ikke kendskab til hvordan emnerne tidligere er omtalt på dansk. De fleste ser umiddelbart rimelige ud. Sergei Baltacha (Q4076889) er tilsyneladende vokset op Skotland, så jeg ville skrive hans navn som på engelsk med Jr. med stort J. Higher school of politics (Q2535586) - det er ikke almindeligt for dansktalende at forstå tjekkisk, så jeg vil foretrække en ordret oversættelse. Det bør måske afklares principielt hvornår navne på institutioner mv. skal oversættes. Riemann's Music Dictionary (Q27680201) - parentesen med årstal ser ikke ud til at være en del af navnet, så ville flytte udgivelsesår til beskrivelsen i stedet. Cairo University (Q194445) ville jeg skrive Cairo Universitet med stort jf. retskrivningsreglerne § 12.7 da det ser ud til at være universitets navn oversat til dansk. Jeg kan ikke læse arabisk, men de har en hjemmeside på engelsk hvor de omtaler sig som "Cairo Univeristy". Meal of the Amsterdam militia (Q17342532) - Hvorfor skal "Rot L" ikke oversættes når resten af titlen er oversat? Jeg er ikke god til hollandsk, men måske "Måltid for Atten Amsterdamske Skytter i Enhed L"? Årstal bør stå i beskrivelsen, og hvad det også er kendt som skal stå under aliaser. Meal of 14 militia guardsmen (Q17541505) - jeg er igen usikker på den hollandske betydning, men måske "Skytter i Enhed G". Mvh. Dipsacus fullonum (talk) 10:57, 24 March 2017 (UTC)Reply
Hej PerV. Tak for beskeden, men jeg vil ikke blande mig i hvordan man laver infobokse på dansk Wikipedia. Jeg deltager ikke længere i det projekt fordi jeg er træt af at nogle brugere uhindret kan svine andre brugere til uden at det har konsekvenser. Jeg så at Dannebrog Spy lavede en rammende beskrivelse af situationen i indlægget w:da:speciel:diff/9004545 på Landsbybrønden. Mvh. Dipsacus fullonum (talk) 09:20, 9 April 2017 (UTC)Reply
Tak for din besked, og nu hærger Rodejong så videre med infoboksene. Jeg gider iøvrigt heller ikke at blande mig. Jeg har tænkt mig at opdatere samtlige russiske byer med nyeste indbyggertal, indsætte borgmester osv. (de oplysninger vi på da wiki har hentet, med kilder), her på wikidata. I forbindelse med det, forestiller jeg mig, som allerede nævnt, at det vil være smart at komme i kontakt med en russisk bruger her på wikidata. Vil du hjælpe mig med det. Du kender helt sikkert wd langt bedre end jeg! PerV (talk) 09:51, 9 April 2017 (UTC)Reply
Så har du helt åbentlyst ikke set den seneste redigering af Infoboks Wikidata person, helt uden forudgående diskussion. Redigeringen betød blandt andet at Aleksandr Dugins infoboks blev tømt for akademiske grader. Men det skal man vel bare vende sig til. Du kan evt. også se hans seneste redigeringer af labels her på wikidata. Det er ihvertfald ikke danske labels han sætter ind. PerV (talk) 11:09, 9 April 2017 (UTC)Reply
Det var ikke uden forudgående diskussion. Der var en meget diskuteret ændring, som bl.a. jeg har været stor fortaler for, som betyder at man kan i infoboksene kan vælge hvilke oplysninger der er hentes fra Wikidata. Dugins akademiske grader forsvandt, fordi de ikke er tilvalgt i infoboksen. Jeg er ikke altid enig med Rodejongs redigeringer, men netop denne bør han have ros for. Ja, der er nogle stavefejl mv. i de indsatte titler på malerier her på Wikidata. Lad os rette dem i stedet for at skælde ud på manden. Mvh. Dipsacus fullonum (talk) 11:34, 9 April 2017 (UTC)Reply
Latest comment: 8 years ago2 comments2 people in discussion
Hej Kartebolle, jeg hopper bare ind for at hører om du helt har opgivet os på Wikipedia på dansk, eller om man skulle være så heldig at du kom tilbage efter påsken ---Zoizit (talk) 12:21, 9 April 2017 (UTC)Reply
Hej Zoizit. Ja, jeg har opgivet dansk Wikipedia og har ingen planer om at vende tilbage dertil foreløbig. Der er ingen glæde ved at deltage som tingene fungerer i øjeblikket. Jeg vil genoverveje det hvis man på et tidspunkt skifter praksis så der gribes ind overfor grove personangreb. Mvh. Dipsacus fullonum (talk) 19:39, 9 April 2017 (UTC)Reply
birth name (P1477) er ens fulde navne som man hed da man blev født. Det bør kaldes "fødenavn" (ikke "fødselsnavn") i en infoboks. Betegnelsen "fulde navn" vil blive forstået som ens nuværende fulde navn hvilket kan være noget andet.
official name (P1448) er det officielle navn på et officielt sprog. Det kan bruges hvis det officielle sprog skrives med latinske bogstaver. Men for russere, kinesere, grækere osv. vil det officielle navn være skrevet med kyriliske bogstaver, kinesiske tegn, græske bogstaver osv. Der er ikke nogen Wikidata-property der kan bruges til "fulde navn på dansk".
Det kan gøres med Wikidata-tal, men alle brugte valuta-enheder skal indsættes i en tabel i w:da:Modul:Brug Wikidata. Gå til modulet og find tabellen:
-- Units used for quantity values. For each give name to display, conversion factor,
local wd_units = {
-- area units
Q712226 = { name = 'km2', show_as = 'km<sup>2</sup>', conv = 1e6, type = 'area' },
Q25343 = { name = 'm2', show_as = 'm<sup>2</sup>', conv = 1, type = 'area' },
Q232291 = { name = 'mi2', show_as = 'mi<sup>2</sup>', conv_to = 'km2', conv = 2589988.110336, type = 'area'},
-- length units
Q11573 = { name = 'm', show_as = 'm', conv = 1, type = 'length' },
Q828224 = { name = 'km', show_as = 'km', conv = 1e3, type = 'length' },
Q253276 = { name = 'mile', show_as = 'mi', conv_to = 'km', conv = 1609.344, type = 'length' },
Q174728 = { name = 'cm', show_as = 'cm', conv = 0.01, type = 'length' },
-- mass units
Q11570 = { name = 'kg', show_as = 'kg', conv = 1, type = 'mass' },
-- time units
Q11574 = { name = 's', show_as = 's', conv = 1, type = 'time' },
Q7727 = { name = 'minut', show_as = 'min.', conv = 60, type ='time' },
Q25235 = { name = 'time', show_as = 't', conv = 3600, type = 'time' },
-- speed units
Q180154 = { name = 'km/t', show_as = 'km/t', conv = 0.2777777777777777778, type = 'speed' }
}
For hver valuta skal der indsættes en ny linje. For danske kroner og amerikanske dollar kan linjerne for eksempel se sådan her ud:
-- currency units
Q25417 = { name = 'DKK', show_as = "danske kroner", conv = 1, type = 'currency' },
Q4917 = { name= 'USD', show_as = "amerikanske dollar", conv = 1, type = 'currency' },
Q25417 og Q4917 er Wikidata-emnerne for valutaerne. Teksten efter "show_as" bestemmer hvordan valutaenhed vises. Man kan vælge det fulde navn eller en forkortelse som man synes. Man kan også indsætte wikikode, for eksempel et link til artiklen om valutaen.
Linjer med "--" er kommentarer i Lua
Hvis man vil omregne automatisk mellem forskellige valutaer, skal man indsætte omregningsfaktorer (valutakurser) i feltet "conv", samt også tilføje linjer til tabellen "wanted_units". Hvis der ikke skal omregnes, er dette ikke nødvendigt.
Vigtigt: Alle linjer med enheder i tabellen, på nær den sidste, skal slutte med et komma. Hvis der tilføjes flere linjer til sidst i tabellen, skal linjen for km/t som nu er den sidste, også have et komma. Hvis man glemmer dette, kommer der en syntaksfejl, og modulet vil ikke virke længere. Jeg anbefaler kraftigt at teste alle ændringer i modulet i en sandkasse.
Hvis der mangler valutaer eller andre enheder i tabellen, vil det ses i kategorien w:da:Kategori:Enhed for størrelse på Wikidata ikke genkendt. Jeg ser at foruden artikler med valutaenheder, er der lige nu også artiklen w:da:Roy Williams i kategorien. Hans vægt er opgivet i amerikanske pund. For at få hans vægt vist i kg, skal linjen:
Q100995 = { name = 'lb', show_as = "lb", conv = 0.45359237, type = 'mass' },
Jeg har gjort det som du beskrev her. Og det virker fint. Dog er der 3 artikler der ikke forsvinder fra kategorien. Det kan selvfølgelig være sync der er forsinket, så jeg checker i morgen igen om de stadig er der. Dog kunne jeg se at Microsoft og Google direkte forsvandt. Hvis ikke - så melder jeg tilbage. Jeg takker for din tydelige beskrivelse. Kind regards, Rodejong💬✉️22:12, 20 April 2017 (UTC)Reply
Dine ændringer ser OK ud. Det er før set at nogle artikler først forsvinder fra sporingskategorier mange timer efter en ændring, mens andre forsvinder med det samme. Jeg har ingen forklaring på dette. Mvh. Dipsacus fullonum (talk) 22:39, 20 April 2017 (UTC)Reply
Latest comment: 8 years ago1 comment1 person in discussion
Your bot has been listed at Wikidata:Requests for permissions/Removal/Inactive bot accounts as being inactive for over two years. As a housekeeping measure it's proposed to remove the bot flag from inactive bot accounts, unless you expect the bot will be operated again in the near future. If you consent to the removal of the bot flag (or do not reply on the deflag page) you can rerequest the bot flag at Wikidata:Requests for permissions/Bot should you need it again. Of course, You may request retaining your bot flag here if you need the bot flag. Regards--GZWDer (talk) 12:34, 26 June 2017 (UTC)Reply
Feil i Module:Cycling race – Norge med språkkode i resultatlistene
Latest comment: 7 years ago8 comments2 people in discussion
Hei! Det er utrolig bra at du har satt igang arbeidet med å forbedre denne modulen. Jeg kopierte nettopp over den nye modulen til nowiki for å teste, og da kom jeg til å se at det er en liten feil i opplistingene av land. For der hvor Norge er med i listene så blir navnet etterfulgt av språkkoden. Det vises altså som "Norge (nb)". Se for eksempel her: no:Tour of Norway 2018. Jeg vil anta at dette har noe med det faktum at vi i Norge har to språkformer, og nowiki bruker språkform nb (mens nnwiki bruker språkform nn). Bergenga (talk) 13:16, 18 July 2018 (UTC)Reply
Takk! Da ser det ut til at det ble fikset nå ja. Jeg så denne feilen med tooltip også, men tenkte ikke at den var så viktig at den var verdt å fikse enda. Tooltip-feilen finnes stadig på infoboks for etappe, men dette er vel ikke en del av koden som du har optimalisert, så da er det ingen hastverk med å få det fikset før du kommer så langt. Bergenga (talk) 18:31, 18 July 2018 (UTC)Reply
Nej, jeg har ikke ændret koden til at lave infobokse endnu, så fejlen med engelsk navn på trøjer i infobokse har været der hele tiden. Du kan rette det ved at søge efter "entity_jersey:getLabel(wiki)" og ændre det til "entity_jersey:getLabel(wikilang)". --Dipsacus fullonum (talk) 19:04, 18 July 2018 (UTC)Reply
Takk! Jeg hadde egentlig tenkt at feilen var så ubetydelig at det ikke var noen grunn til å fikse den nå, men siden du faktisk gav meg hele løsningen så måtte jeg jo bare gjøre det. :-) Bergenga (talk) 20:52, 18 July 2018 (UTC)Reply
Latest comment: 7 years ago5 comments2 people in discussion
Hi friend. The new function lost some functionality for teams as stage winners. Currently you can datafill as winner the team of the season or you can datafill the main element for the team. The name you should see is the official name (present in the season or present in the main element of team) and if there is article from the team season the link should go to this or as default show the article of main element. Please see BMC as winner of stage 3 at Tour de France en "es" (previous code) es:Tour de Francia 2018 and Tour de France in "da" (new code) da:Tour de France 2018. Repf72 (talk) 02:33, 31 July 2018 (UTC)Reply
@Repf72: National teams are included in listofwinners if they win the general classification, and they are included in listofstages if they win a stage. I still have not worked on the infobox, but will make sure to include them in the infobox when I do. --Dipsacus fullonum (talk) 13:32, 31 July 2018 (UTC)Reply
Latest comment: 7 years ago1 comment1 person in discussion
Hi friend @Dipsacus fullonum:. If you click on "wikidata icon" at any table generated with "Cycling race/listofstages" there is not working the link to "Qxxx - #P527". Instead of it you are linked to see the wikidata icon: "File:Wikidata-logo_S.svg". Repf72 (talk) 01:58, 1 August 2018 (UTC)Reply
@Repf72: Hi, That was because someone had marked stage 10 as the preferred stage of the race. It was done in this edit Special:Diff/361730932 back in 2016, even before the start of the race. I have reverted that edit. If some stages are ranked as "preferred", only those will be used. I could change that to always include the "normal" rank, but a stage should never be preferred for any reason that I can think of. --Dipsacus fullonum (talk) 05:50, 1 August 2018 (UTC)Reply
@Repf72: That may be. Anyway I will make sure to include all stages in the next version, even if some of them should be marked as preferred. I know what the problem is when the Wikidata logo links to Commons instead of to the Wikidata entity, and will also fix that in the next version. I don't feel that it is urgent, so it will not be immediately as I am working on infoboxes right now. I hope that is OK. Best regards, --Dipsacus fullonum (talk) 12:28, 1 August 2018 (UTC)Reply
@Dipsacus fullonum: Excellent that you are working on infoboxes. Really your improvements has been the best of the module since it creation. Some others wikipedias like italian did not want to use the module due early problems and bugs, may be we can try to convence them later due your exellent work. Kind regards. Repf72 (talk) 12:37, 1 August 2018 (UTC)Reply
Latest comment: 7 years ago3 comments2 people in discussion
Hello Dipsacus fullonum, many thanks first for the changes you made in the code, they are much appreciated. I just wanted to know, if you are still working on it. I have a bit of time in September/October, I could try to perform similar changes as you did on the function calendar first (I am not sure that it will be as good, but you can correct afterward :D). Psemdel (talk) 20:02, 10 September 2018 (UTC)Reply
@Psemdel: Sorry for the late reply. I have been busy with other things this week. I am not actively working on the cycling module at the moment, but I have plans to do more later. Now there is a lot of duplicated functionality because I made new functions to work with IDs to replace the existing functions working with entities. But the fuctions working with entities cannot be removed yet, becuase there are still in use. So I would like to clean it up by converting the remaining functions at some point. I would also like to move translations and local configuration to a submodule. But I have a lot of things on my todo-list and limited time, so it would fine if you work on the calendar function. You should be able to reuse the functions I made to find and display winners of the races in the calendar. If you have trouble finding out how to use them, I will try to document the new functions better. You are also always welcome to ask me for advice. Regards, Dipsacus fullonum (talk) 17:10, 14 September 2018 (UTC)Reply
No problem, we all have the right to have a life outside wikidata/wikipedia ;). Of course, we first have to convert everything before deleting the old stuff, don't worry for that. And of course also, it won't happen in one day. Ok, so I correct calendar with your functions (Actually I already corrected 2 infoboxes on WP:fr with your functions, so I know round about how they work) when I can. We have the whole winter to do that peacefully. Psemdel (talk) 18:19, 14 September 2018 (UTC)Reply
Latest comment: 6 years ago2 comments2 people in discussion
Hej. Jeg kan se du genbruger forrige periode i position held (P39) for folketingsmedlemmer. Jeg kan se at praksis for valgte normalt er at lave et nyt udsagn for hver valgperiode. Det har jeg fulgt med de andre folketingsmedlemmer. Det vil være rart at bruge samme praksis også for den nye valgperiode. --Steenth (talk) 09:22, 6 June 2019 (UTC)Reply
Jeg tænkte at det ville være en fordel ved genvalg idet start time (P580) og end time (P582) så kan give en sammenhængende periode uden at man skal til at stykke flere valgperioder sammen. Det vil sikkert gøre det nemmere at håndtere hvis værdierne skal bruges i infobokse. Men det andet kan også klares, så jeg følger din opfordring. --Dipsacus fullonum (talk) 14:17, 6 June 2019 (UTC)Reply
Latest comment: 5 years ago2 comments2 people in discussion
I see you are also working on using Familysearch. I run a query looking for people with only a birth year, and no date (only in the US for now, born between 1880 and 1920) and I use Familysearch to add in the full dates from the two draft registrations. All good stuff, good to see someone else using an amazing free resource! --RAN (talk) 21:35, 22 February 2020 (UTC)Reply
Hello RAN. I guess that I have to disappoint you. I'm not using Familysearch. I fact I don't know what it is. I just helped another user who do use it with a related SPARQL query. --Dipsacus fullonum (talk) 09:22, 23 February 2020 (UTC)Reply
Latest comment: 5 years ago2 comments2 people in discussion
Please refrain from such accusations and attempt to express your difference of opinion in another way. The solution with MINUS that someone else added is still missing and is not what you provided. --- Jura13:17, 1 March 2020 (UTC)Reply
@Jura1: It doesn't matter if a query uses MINUS or OPTIONAL. In my eyes it is misinformation saying that a sample is missing, when one has been provided. If the technical details matter to you, then change the description from "with MINUS" to "with OPTIONAL and COALESCE" (even though it also could have been made with MINUS). It is also not OK saying without any form of argumentation, that it will likely timeout. You can argue against the proposed qualifier for next level in hierarchy (you already did), but please don't say unfounded information about it. I reserve the right to call misleading or wrong information for misinformation. --Dipsacus fullonum (talk) 14:36, 1 March 2020 (UTC)Reply
Regarding "How to deal with time limit constraints?" in Wikidata: Request A Query
Can I check then, is there any way I can retrieve all the results to a query that will have a timeout error?
In theory you could split the query into a series of queries that will each give a subset of the result and then combine the results of all these queries manually. Each query in the series should limit the result using a key that is fast to use (some indexed value), but I doubt that it is possible to find a good key in this case. Another option is to download a database dump from Wikidata and analyze it. --Dipsacus fullonum (talk) 07:53, 13 April 2020 (UTC)Reply
Hi Bouzinac. I suppose you mean the MINUS part in the query. That has no effect at all because it doesn't match any of the results of the query as there are no shared variables. To exclude values of ?time coming from entities that are instances of astronomical transit (Q6888) you need to define ?item in the first part of the query too:
SELECT?timeWHERE{?itemp:P585/psv:P585?fullvalue.?fullvaluewikibase:timePrecision11.# Precision is date?fullvaluewikibase:timeValue?time.MINUS{?item(wdt:P31/wdt:P279*)wd:Q6888.}# exclude transit astronomiques}GROUP BY?timeORDER BYDESC(?time)
@Bouzinac: First I no see reason for "GROUP BY" with no aggregation functions and probably only one result in each group with very few exceptions. There are also two more reasons for the timeout: 1) The filter adds a comparison for 299,907 results and probably don't remove very many of them, so the filter uses much time with little gain. 2) The label for ?item. It is impossible to get labels for 299,907 items in a query even if it didn't do anything else. You need to either drop the labels or limit the number of results, and it must happen in a subquery as the label service will else be applied before filtering and limiting. A solution with labels but only 10,000 results can be:
SELECT?item?itemLabel?timeWHERE{{SELECT?item?timeWHERE{?itemp:P585/psv:P585?fullvalue.?fullvaluewikibase:timePrecision11.# Precision is date?fullvaluewikibase:timeValue?time.hint:Priorhint:rangeSafetrue.MINUS{?item(wdt:P31/wdt:P279*)wd:Q6888.}# exclude transit astronomiques}ORDER BYDESC(?time)LIMIT10000}SERVICEwikibase:label{bd:serviceParamwikibase:language"fr".}}
Huh? GROUP BY ?time means you only have one date ? so logically no duplicates…. ?
@Bouzinac: No, COUNT(?time) will count the number of values for each date. The error was "ps:P585" instead of "p:P585". The query below is better and gives the number of duplicates for each date:
SELECT?item?time?countWITH{SELECT?time(COUNT(?time)AS?count)WHERE{?itemp:P585/psv:P585?fullvalue.?fullvaluewikibase:timePrecision11.# Precision is date?fullvaluewikibase:timeValue?time.MINUS{?item(wdt:P31/wdt:P279*)wd:Q6888.}# exclude transit astronomiques}GROUP BY?timeHAVING(?count>1)}AS%get_duplicate_timesWHERE{INCLUDE%get_duplicate_times?itemp:P585/psv:P585?fullvalue.?fullvaluewikibase:timePrecision11.# Precision is date?fullvaluewikibase:timeValue?time.MINUS{?item(wdt:P31/wdt:P279*)wd:Q6888.}# exclude transit astronomiques}
@Dipsacus fullonum: the latter is very great, found a duplicate at first try! Lot of job ... By curiosity, why duplicating the MINUS { ?item (wdt:P31/wdt:P279*) wd:Q6888. } # exclude transit astronomiques MINUS { ?item (wdt:P31/wdt:P279*) wd:Q47150325. } # exclude calendar dates in themselves in the WITH and in the second where ? Bouzinac (talk) 08:50, 1 July 2020 (UTC)Reply
@Bouzinac: The subquery finds and counts duplicates values and has the MINUS parts to find and count only duplicates that aren't astronomical transits or calendar dates. The main part of the query finds all items with the duplicate dates. It has the MINUS parts in order to avoid to list items for astronomical transits or calendar dates. E.g. if some date has a duplicate count of say 2, it will (most likely) also have a calendar date item which aren't included in the count. That item is removed by the second set of MINUS. --Dipsacus fullonum (talk) 09:05, 1 July 2020 (UTC)Reply
Do you see why I am having false duplicates there ?
SELECT?item?time?countWITH{SELECT?time(COUNT(?time)AS?count)WHERE{?itemp:P585/psv:P585?fullvalue.?fullvaluewikibase:timePrecision11.# Precision is date?fullvaluewikibase:timeValue?time.# FILTER ((?time < "1900-01-01"^^xsd:dateTime))MINUS{?item(wdt:P31/wdt:P279*)wd:Q6888.}# exclude transit astronomiquesMINUS{?item(wdt:P31/wdt:P279*)wd:Q47150325.}# exclude calendar dates in themselvesMINUS{?item(wdt:P31/wdt:P279*)wd:Q14795564.}# exclude OTHER calendar dates MINUS{?item(wdt:P31/wdt:P279*)wd:Q2334719.}# exclude trials?item(wdt:P31/wdt:P279*)wd:Q141022.#éclipses}GROUP BY?timeHAVING(?count>1)}AS%get_duplicate_timesWHERE{INCLUDE%get_duplicate_times?itemp:P585/psv:P585?fullvalue.?fullvaluewikibase:timePrecision11.# Precision is date?fullvaluewikibase:timeValue?time.# FILTER ((?time < "1900-01-01"^^xsd:dateTime))MINUS{?item(wdt:P31/wdt:P279*)wd:Q6888.}# exclude transit astronomiquesMINUS{?item(wdt:P31/wdt:P279*)wd:Q47150325.}# exclude calendar dates in themselvesMINUS{?item(wdt:P31/wdt:P279*)wd:Q14795564.}# exclude OTHER calendar dates MINUS{?item(wdt:P31/wdt:P279*)wd:Q2334719.}# exclude trials?item(wdt:P31/wdt:P279*)wd:Q141022.#éclipses }order by?time
@Bouzinac: Yes, it is because there are multiple matches for the same items in the graph pattern ?item (wdt:P31/wdt:P279*) wd:Q141022.#éclipses" like e.g.
Latest comment: 5 years ago3 comments2 people in discussion
Hello. Sorry for writing in your talk page and not in Request a query page. Is just a small change. How can this query search for both P27 -> Q229 or Q41.
Latest comment: 5 years ago3 comments2 people in discussion
Hello. Can you change the query show in the results will be a column with the Wikipedia article (if wikibase:language "en" then English Wikipedia, if wikibase:language "el" the Greek Wikipedia).
Latest comment: 5 years ago4 comments2 people in discussion
Hello Dipsacus fullonum,
I asked your help some weeks ago about a query to get value, qualifiers, unit, etc.
My main purpose was to solve an issue with the query currently used in the python library WikidataIntegrator.
I tried to implement your query, but I have a performance issue when asking for a property widely used (like P31) that I don't have with the old query. It's possible to optimize the query? I tried to understand the difference between the two queries and adapt to the new one, without succes.
The query currently used in WikidataIntegrator: this one
Your query but adapted to WikidataIntegrator: this one
Thank you for your help,
Best Regards, Myst (talk) 08:06, 3 October 2020 (UTC)Reply
Hi Myst. I see that there is a problem with ?property used out of scope in the query I made. Sorry about that.
When the query is made by a program there are some optimizations that can be done by the program: The VALUE assignments with one value are superfluous as the program can just insert the value where needed instead of a variable (which will also fix the scope problem), and triples like ?property wikibase:claim ?claim . and ?property wikibase:statementValue ?statementValue . are superfluous because the program can construct the value of ?claim to be <http://www.wikidata.org/prop/P31> and the value of ?propertyStatement to be <http://www.wikidata.org/prop/statement/P31> like it is already done in the currently used query linked above.
You can also optimize the query by looking up the property type first and then make different queries depending on if the property type is amount (having a unit) or something else. Going this way, you can also make specialzed queries for other property types like geting precision and calendar model for time values etc. --Dipsacus fullonum (talk) 06:35, 5 October 2020 (UTC)Reply
@Myst: Yes, I think that the query is correct, but I haven't tested it extensively. It may (or may not) be faster to avoid the first UNION and instead use same construct as used in https://w.wiki/evA, like this:
#Tool: wbi_fastrun _query_dataSELECT?sid?item?v?unit?pq?qval?qunitWHERE{?item<http://www.wikidata.org/prop/direct/P699>?zzP699.# Get statement ID and the simple value for the statements?item<http://www.wikidata.org/prop/P31>?sid.?sid<http://www.wikidata.org/prop/statement/P31>?v.# Get the optional unit for statements with a quantity valueOPTIONAL{?sid<http://www.wikidata.org/prop/statement/value/P31>/wikibase:quantityUnit?unit.}# Get qualifiersOPTIONAL{{# Get simple values for qualifiers which are not of type quantity?sid?propQualifier?qval.?pqwikibase:qualifier?propQualifier.?pqwikibase:propertyType?qualifer_property_type.FILTER(?qualifer_property_type!=wikibase:Quantity)}UNION{# Get amount and unit for qualifiers of type quantity?sid?pqv[wikibase:quantityAmount?qval;wikibase:quantityUnit?qunit].?pqwikibase:qualifierValue?pqv.}}}ORDER BY?sidOFFSET0LIMIT10000
It may also be faster to move the 3 first triples to a subquery with the LIMIT and OFFSET, and then drop these from the main query. But by doing so, you can have more than 10000 results as there is a result for each qualifier of a statement. (The same is true for https://w.wiki/evA). If that isn't a problem the query could be:
#Tool: wbi_fastrun _query_dataSELECT?sid?item?v?unit?pq?qval?qunitWHERE{{SELECT?item?sid?vWHERE{?item<http://www.wikidata.org/prop/direct/P699>?zzP699.# Get statement ID and the simple value for the statements?item<http://www.wikidata.org/prop/P31>?sid.?sid<http://www.wikidata.org/prop/statement/P31>?v.}ORDER BY?sidOFFSET0LIMIT10000}# Get the optional unit for statements with a quantity valueOPTIONAL{?sid<http://www.wikidata.org/prop/statement/value/P31>/wikibase:quantityUnit?unit.}# Get qualifiersOPTIONAL{{# Get simple values for qualifiers which are not of type quantity?sid?propQualifier?qval.?pqwikibase:qualifier?propQualifier.?pqwikibase:propertyType?qualifer_property_type.FILTER(?qualifer_property_type!=wikibase:Quantity)}UNION{# Get amount and unit for qualifiers of type quantity?sid?pqv[wikibase:quantityAmount?qval;wikibase:quantityUnit?qunit].?pqwikibase:qualifierValue?pqv.}}}
I don't think it possible to avoid the UNION for getting qualifiers in a similar way because some qualifiers (depending on property type) don'ẗ have nodes for full values, but only simple values. --Dipsacus fullonum (talk) 21:09, 8 October 2020 (UTC)Reply
Wikidata common service | Mass editing of local language caption
Latest comment: 5 years ago3 comments2 people in discussion
A copied message from Request page.
Is there any ways to add captions for images in commons which has captions in English not in Arabic. Can we find out those particular category images and add captions.
There are over 1.5 million captions in English and less than 19,000 captions in Arabic, so making a list of all images with English caption and no Arabic caption will timeout as the list would be too big. You need to somehow limit the group of images you are working with. --Dipsacus fullonum (talk) 20:19, 25 October 2020 (UTC)Reply
Latest comment: 4 years ago13 comments2 people in discussion
Hi, I noticed at Wikidata:Request_a_query/Archive/2020/10#Querry_for_Wikimedia_Commons that you understand Wikimedia Commons + Wikidata federation (at least better than I do). I was trying to do some federated query but failed. The goal was to find uploaders of pictures linked to Czech municipalities via image (P18). The query went like this:
Hi Vojtěch Dostál. I think that is possible, but the query you outline will not find the uploader. It will find the creator if they happen to have a Wikimedia username. That may be someone else than the uploader. You can find the uploader for all images by using the MWAPI service to call Commons Mediawiki API although I'm not sure that it is possible for all 6328 images in one query without timeout. So do you want creator or uploader for images? --Dipsacus fullonum (talk) 22:45, 15 November 2020 (UTC)Reply
Hi! Yeah, sorry, I should have made myself clearer, although the uploader will be the same as creator in most of these cases. Anyway, querying for "creator" would be just fine for this :). Thank you very much, Vojtěch Dostál (talk) 06:46, 16 November 2020 (UTC)Reply
@Vojtěch Dostál: I read the documentation at mw:Extension:WikibaseMediaInfo/RDF mapping and thought that I easily could make a query for you. However it turned out that the documentation is wrong, and it seems that there are no triples in WCQS to go from filenames to the media objects (M-numbers). I asked for help yesterday at the documentation talk page at mediawiki.org. If I don't get an answer from the development team today I will try at Phabricator. I will return when I know more. --Dipsacus fullonum (talk) 09:44, 17 November 2020 (UTC)Reply
However another problem is that it seems to me that many images are missing in WCQS. The Wikidata federated call gives 6328 distinct values for ?image, but the query only has 1013 values of ?file. All constructed values of ?contentUrl seems to be good so I don't think these are the problem. An example of a missing file in WCQS is sdc:M47869727. This query has no results:
Thank you, that is extremely useful! I can apply the same approach to similar queries in future. The missing files are really weird, I see it too when I drop the aggregation from the query above. Maybe we could try to ask Lucas Werkmeister, who commented at mw:Topic:Vxuqddsgciypooid, for his thoughts on this? Vojtěch Dostál (talk) 13:34, 2 December 2020 (UTC)Reply
@Vojtěch Dostál: How do you get the number 4462? If I modify the query to count the images I get 6326 images found at Wikidata and 6317 files found at WCQS. The small difference of 9 can be images without structured data or new images since the last weekly update of WCQS:
Latest comment: 5 years ago2 comments2 people in discussion
Hello, sorry to bother you again, hope you'll get a better year 2021 than 2020!
I'm having a difficulty when airport data has multiples monthly source. Eg with Cape Town International Airport (Q854130), and with that query, you'll see that when there is multiples statements for same month+year : they are added instead of being sampled.
I wonder if I change the (SUM(?numberperperiod) AS ?number) to (MAX(?numberperperiod) AS ?number) would have any drawbacks/side effects.
SELECT?year?item?itemLabel(MAX(?number)AS?passengers)(SAMPLE(COALESCE(?reference_URL,?monthly_reference_URL2))AS?sample_reference_URL)WITH{SELECT?item?statement?year?timevalue?numberperperiod?reference_URLWHERE{?itemwdt:P238?airport_codeVALUES?airport_code{"CPT"}?itemp:P3872?statement.?statementpqv:P585?timevalue;ps:P3872?numberperperiod.?timevaluewikibase:timeValue?date.OPTIONAL{?statementpq:P518?applies.}OPTIONAL{?statementprov:wasDerivedFrom/(pr:P854|pr:P4656)?reference_URL.}FILTER(BOUND(?applies)=false||?applies=wd:Q2165236)MINUS{?statementwikibase:rankwikibase:DeprecatedRank}BIND(YEAR(?date)AS?year)FILTER(?year>1949).FILTER(?year<YEAR(NOW()))}}AS%airportWHERE{{# Get the sum of monthly values within a yearSELECT?item?year(SUM(?numberperperiod)AS?number)(SAMPLE(?monthly_reference_URL)AS?monthly_reference_URL2)WHERE{# Get a sample reference URL for each monthly value{SELECT?item?year?numberperperiod(SAMPLE(?reference_URL)AS?monthly_reference_URL)WHERE{INCLUDE%airport?timevaluewikibase:timePrecision?prec.FILTER(?prec>9)}GROUP BY?item?statement?year?numberperperiod# Include ?statement in the GROUP BY because ?numberperperiod may not be unique}}GROUP BY?item?year}UNION{?timevaluewikibase:timePrecision9.BIND(?numberperperiodAS?number)BIND(?reference_URLAS?sample_reference_URL)INCLUDE%airport}SERVICEwikibase:label{bd:serviceParamwikibase:language"fr".}}GROUP BY?item?itemLabel?yearORDER BY?itemDESC(?year)
But it happens at other airports. This query gives a list of not-deprecated multiple values for months:
SELECT?item?itemLabel?date?count{{SELECT?item?date(COUNT(?timevalue)AS?count)WHERE{?itemwdt:P238?airport_code.?itemp:P3872?statement.?statementpqv:P585?timevalue.?statementps:P3872?numberperperiod.VALUES?rank{wikibase:NormalRankwikibase:PreferredRank}?statementwikibase:rank?rank.?timevaluewikibase:timeValue?date.?timevaluewikibase:timePrecision10.# Precicison is month}GROUP BY?item?itemLabel?dateHAVING(?count>1)}SERVICEwikibase:label{bd:serviceParamwikibase:language"fr".}}
If you just change SUM(?numberperperiod) to MAX(?numberperperiod), you will not get the sum for 12 months but only the highest monthly value for each year. E.g. for 2019 you will get the value 1072884 for Cape Town International Airport (Q854130) – the value for December 2019 which was the month with most passengers that year. When there are multiple values for some months for an airport, you have to first group by month and year to get just one number for each month, and then group by year to get the sum for 12 months. I have modified the query below to do that:
SELECT?year?item?itemLabel(MAX(?number)AS?passengers)(SAMPLE(COALESCE(?reference_URL,?monthly_reference_URL2))AS?sample_reference_URL)WITH{SELECT?item?statement?date?year?timevalue?numberperperiod?reference_URLWHERE{?itemwdt:P238?airport_codeVALUES?airport_code{"CPT"}?itemp:P3872?statement.?statementpqv:P585?timevalue;ps:P3872?numberperperiod.?timevaluewikibase:timeValue?date.OPTIONAL{?statementpq:P518?applies.}OPTIONAL{?statementprov:wasDerivedFrom/(pr:P854|pr:P4656)?reference_URL.}FILTER(BOUND(?applies)=false||?applies=wd:Q2165236)MINUS{?statementwikibase:rankwikibase:DeprecatedRank}BIND(YEAR(?date)AS?year)FILTER(?year>1949).FILTER(?year<YEAR(NOW()))}}AS%airportWHERE{{# Get the sum of monthly values within a yearSELECT?item?year(SUM(?max_numberperperiod)AS?number)(SAMPLE(?monthly_reference_URL)AS?monthly_reference_URL2)WHERE{# Get the maximal value and a sample reference URL for each month{SELECT?item?year(MAX(?numberperperiod)AS?max_numberperperiod)(SAMPLE(?reference_URL)AS?monthly_reference_URL)WHERE{INCLUDE%airport?timevaluewikibase:timePrecision?prec.FILTER(?prec>9)}GROUP BY?item?year?date}}GROUP BY?item?year}UNION{?timevaluewikibase:timePrecision9.BIND(?numberperperiodAS?number)BIND(?reference_URLAS?sample_reference_URL)INCLUDE%airport}SERVICEwikibase:label{bd:serviceParamwikibase:language"fr".}}GROUP BY?item?itemLabel?yearORDER BY?itemDESC(?year)
Yes Matěj Suchánek's bot did compress duplicated identical values so the CPT problem did get solve, thanks to his bot. Now your correction will be useful, say, for two different sources one saying X for same month and saying X' for same month. Now, I'll check if there are other sides effect of your correction, with, say airports having bizarre months (for instance having international and domestic statistics) that needs to sum up. Checking in progress :) Thanks Dipsacus fullonum
Latest comment: 4 years ago2 comments2 people in discussion
Hello dude, thank you again for your help on the queries. Here's another request if you could help? The need would simply to know the ranks of airport for, say, 2020.
SELECT?year?item?itemLabel(MAX(?number)AS?passengers)(SAMPLE(COALESCE(?reference_URL,?monthly_reference_URL2))AS?sample_reference_URL)WITH{SELECT?item?statement?date?year?timevalue?numberperperiod?reference_URLWHERE{?item(wdt:P31/wdt:P279*)wd:Q62447.?itemp:P3872?statement.?statementpqv:P585?timevalue;ps:P3872?numberperperiod.?timevaluewikibase:timeValue?date.OPTIONAL{?statementpq:P518?applies.}OPTIONAL{?statementprov:wasDerivedFrom/(pr:P854|pr:P4656)?reference_URL.}FILTER(BOUND(?applies)=false||?applies=wd:Q2165236)MINUS{?statementwikibase:rankwikibase:DeprecatedRank}BIND(YEAR(?date)AS?year)FILTER(?year=2020).}}AS%airportWHERE{{# Get the sum of monthly values within a yearSELECT?item?year(SUM(?max_numberperperiod)AS?number)(SAMPLE(?monthly_reference_URL)AS?monthly_reference_URL2)WHERE{# Get the maximal value and a sample reference URL for each unique month{SELECT?item?year(MAX(?numberperperiod)AS?max_numberperperiod)(SAMPLE(?reference_URL)AS?monthly_reference_URL)WHERE{INCLUDE%airport?timevaluewikibase:timePrecision?prec.FILTER(?prec>9)# precision more precise or equal to month}GROUP BY?item?year?date}}GROUP BY?item?year}UNION{?timevaluewikibase:timePrecision9.BIND(?numberperperiodAS?number)BIND(?reference_URLAS?sample_reference_URL)INCLUDE%airport}SERVICEwikibase:label{bd:serviceParamwikibase:language"fr".}}GROUP BY?item?itemLabel?yearORDER BYdesc(?passengers)LIMIT50
The pb is that, for instance Tokyo International Airport (Q204853) has data only from january to november. Would it be possible to show that either the airport has data for whole year ("2020") or (till this month (max of montlhy values) ? Thus it would help saying that HND is yet to be updated. Thanks again! Bouzinac💬●✒️●💛21:25, 3 February 2021 (UTC)Reply
@Bouzinac: This query lists all airports with some monthly passenger values for 2020 but not for all months. Some of these also have a number for the year. These are indicated with the ?have_value_for_year variable. It is not always the last months of the year that is missing. In some cases it is the first months. You can see that in the variables ?number_of_months, ?first_month and ?last_month. Any airports not in the list have either no monthly values or values for all 12 months.
SELECT?year?item?itemLabel?number_of_months?first_month?last_month?have_value_for_yearWITH{SELECT?item?statement?date?year?timevalue?numberperperiod?reference_URLWHERE{?item(wdt:P31/wdt:P279*)wd:Q62447.?itemp:P3872?statement.?statementpqv:P585?timevalue;ps:P3872?numberperperiod.?timevaluewikibase:timeValue?date.OPTIONAL{?statementpq:P518?applies.}OPTIONAL{?statementprov:wasDerivedFrom/(pr:P854|pr:P4656)?reference_URL.}FILTER(BOUND(?applies)=false||?applies=wd:Q2165236)MINUS{?statementwikibase:rankwikibase:DeprecatedRank}BIND(YEAR(?date)AS?year)FILTER(?year=2020).}}AS%airportWHERE{{SELECT?item(COUNT(DISTINCT?date)AS?number_of_months)(MAX(?date)AS?last_month)(MIN(?date)AS?first_month)WHERE{INCLUDE%airport?timevaluewikibase:timePrecision10.# Precicision is month}GROUP BY?itemHAVING(?number_of_months!=12)}OPTIONAL{{SELECT?itemWHERE{INCLUDE%airport?timevaluewikibase:timePrecision9.# Precicision is year}GROUP BY?item}BIND("yes"AS?have_value_for_year)}SERVICEwikibase:label{bd:serviceParamwikibase:language"fr".}}
@Trade: This will work if the number of subcategories doesn't exceed 256. It will only return the film items and not any items for the subcategories. (That can also be done but with a different query). As always for MWAPI calls max 10000 results are returned.
Latest comment: 4 years ago1 comment1 person in discussion
Dear Dipsacus fullonum,
I hope you are doing good,
I am Kholoud, a researcher at King’s College London, and I work on a project as part of my PhD research that develops a personalized recommendation system to suggest Wikidata items for the editors based on their interests and preferences. I am collaborating on this project with Elena Simperl and Miaojing Shi.
I would love to talk with you to know about your current ways to choose the items you work on in Wikidata and understand the factors that might influence such a decision. Your cooperation will give us valuable insights into building a recommender system that can help improve your editing experience.
Participation is completely voluntary. You have the option to withdraw at any time. Your data will be processed under the terms of UK data protection law (including the UK General Data Protection Regulation (UK GDPR) and the Data Protection Act 2018). The information and data that you provide will remain confidential; it will only be stored on the password-protected computer of the researchers. We will use the results anonymized to provide insights into the practices of the editors in item selection processes for editing and publish the results of the study to a research venue. If you decide to take part, we will ask you to sign a consent form, and you will be given a copy of this consent form to keep.
Latest comment: 4 years ago5 comments2 people in discussion
Hello Dipsacus, only you can help me, with your immense experience with WCQS :) The query below is probably crap but somewhat works. Yet I think it only displays results from only SOME subcategories of a given category. Where is the mistake? I'd especially love if it only showed pictures from categories which are NOT connected to Wikidata yet, because it would tip me off about images which can be used to geo-localize the Commons category.
Hi Vojtěch Dostál. The query does the opposite of what you want. The federated query to WDQS in the named subquery %images begins with the triple
?outschema:name?title.
In other words, the query uses Wikidata to go from the full URI for a category to the title, and that means that all categories not connected to Wikidata are discarded in that step. You have to extract the category title without using Wikidata. --Dipsacus fullonum (talk) 21:01, 5 January 2022 (UTC)Reply
Ah, well. I actually don't need the titles of the categories, I just need all images that are inside those categories :-/. Are all wikibase-prefixed lines going to be a problem? Is there a way to circumvent Wikidata and still obtain a list of images inside a category tree? Thank you. Vojtěch Dostál (talk) 16:18, 6 January 2022 (UTC)Reply
@Vojtěch Dostál: Yes, you do need the titles of the categories for the MWAPI service call to get category members. Fortunately, the title is easy derive from the URI by using
I made that change, and also corrected how ?contentUrl is constructed below (the former code did not work for filenames with non-ASCII characters) and did a few other changes:
Latest comment: 3 years ago5 comments2 people in discussion
Hello! I once asked a query and you responded very well https://w.wiki/4wS7. May I ask you why Yeongtong Station (Q218354) (and some other) is a false positive ? I don't get it since I wish to find only stations whose P197/P1192 are in a mess (not clearing stating which ligne with which neighbour). Your help would be appreciated much. Cheers Bouzinac💬●✒️●💛13:25, 11 March 2022 (UTC)Reply
where the | sign means both qualifiers can be used for ?line1 and ?line2. If I understand correctly, that is an error, and you should remove pq:P81| from the query. --Dipsacus fullonum (talk) 17:52, 11 March 2022 (UTC)Reply
Hi Игорь Темиров. I can not make the query to include all items which have statements with P1087 because there are too many. The query below finds revisions IDs for 100 items and takes ca. 8 seconds to run, so the limit to avoid timeout is probably below 1000 items. You can change the subquery to select the items you want, but it can not be too many.
Latest comment: 3 years ago3 comments2 people in discussion
How are you? May I ask you to amend that query so that I can spot the bad items that haven't got correct qualifyers (that is no ?subwayLine_predLabel or no ?towardsLabel). Thanks !
SELECT?station?stationLabel?subwayLine_predLabel?predLabel?towardsLabelWHERE{VALUES?search{wd:Q462201#critère de recherche de système de métro}?searchwdt:P527?lignes.#quelles sont les lignes de ce métro?ligneswdt:P559?termini.#quels sont les terminus de ce métro?stationwdt:P31/wdt:P279*wd:Q928830;#station de métrowdt:P361|wdt:P16?search;#qui font partie du réseau recherchéwdt:P81|wdt:P1192?subwayLine;wdt:P197?pred.?predwdt:P625?coords_pred;wdt:P81|wdt:P1192?subwayLine_pred.?stationp:P197_:b1._:b1ps:P197?pred;pq:P5051?towards;pq:P81|pq:P1192?line_pq.FILTER(?subwayLine_pred=?lignes)#on ne prend les LIGNES que si la correspondance est sur la même ligneFILTER(?subwayLine=?lignes)FILTER(?towards=?termini)MINUS{?station(wdt:P576|wdt:P582|wdt:P3999)?dispar.}#on ne veut pas les stations disparuesMINUS{?stationwdt:P5817|wdt:P5816?interdit.VALUES?interdit{wd:Q811683wd:Q63065035wd:Q12377751wd:Q97317113wd:Q55653430wd:Q30108381wd:Q55570340wd:Q11639308wd:Q104664889wd:Q110713763}}#on ne veut pas les cas particuliers, en construction etc?predp:P625?node_pred.?node_predawikibase:BestRank.?stationp:P625?node_station.?node_stationawikibase:BestRank.SERVICEwikibase:label{bd:serviceParamwikibase:language"[AUTO_LANGUAGE],en,fr".?subwayLinerdfs:label?layer.?predrdfs:label?predLabel.?subwayLine_predrdfs:label?subwayLine_predLabel.?towardsrdfs:label?towardsLabel.?stationrdfs:label?stationLabel.}}GROUP BY?station?stationLabel?subwayLine_predLabel?predLabel?towardsLabel
In other words, they all should be having a P197 with both qualifyers and I'd like to find/correct that don't have both qualifyers. Bouzinac💬●✒️●💛11:37, 21 April 2022 (UTC)Reply
How can I make it so that if there are two wives, they are displayed not in a separate line, but in the spouses field separated by commas? With thanks Игорь Темиров (talk) 19:51, 11 May 2022 (UTC)Reply
@Игорь Темиров: By using the GROUP_CONCAT aggregation function for ?spouse and/or ?spouseLabel, and use GROUP BY for the other variables in the SELECT. To aggregate over a label, you also need to use the manual version of the label service:
Latest comment: 3 years ago5 comments2 people in discussion
Jeg har lige ved hjælp af et hjemmestrikket Bash/Perl/Gawk script tilladt mig at importere 35 af de artikler om folketingsmedlemmer du har oprettet den seneste tid. Jeg vil gerne høre om du har kommentarer til det.
Scriptet er pt ikke specielt letlæseligt, men er som følger:
wdpolitikerDK(){curl-d"format=tsv"-d"psid=22269697""https://petscan.wmflabs.org/"|sed'1d; s/_/ /g'|gawk-F'\t'-vi="1"'BEGIN{print "qid,P31,P27,P106,P39,Sdawiki,Dda,Lda,Ada,P569,P570"} FNR==NR{m[$1]=i; i++; next;} {cmd = "wikiget.awk -p -l da -w \"" $2 "\" | perl -n -e \47if ($_ =~ /([a-zA-Z æøåÆØÅ]+) \\(født ([0-9.]+ [a-z]+ [0-9]{4}).+, død ([0-9.]+ [a-z]+ [0-9]{4}).+\\) var en ([a-z æøå]+)/) {print \"$1#$2#$3#$4\"};\47"; cmd | getline p;if (p ~ /#/) {n=$2; sub(/ \(.+/,"",n); OFS=","; split(p,a,"#"); split(a[2],f," "); split(a[3],d," "); print ",Q5,Q756617,Q82955,Q12311817,#" $2 "#,#" a[4] sprintf(" \(%4d-%4d\)#,", f[3], d[3]) n, a[1], sprintf("+%4d-%02d-%02dT00:00:00Z/11,+%4d-%02d-%02dT00:00:00Z/11", f[3], m[f[2]], f[1], d[3], m[d[2]], d[1])}; p=""}'<(printf"januar februar marts april maj juni juli august september oktober november december"|tr" ""\n")-|tr'#''"'}
Interessant. Jeg vidste ikke at petscan kan bruges ikke-interaktivt. Jeg har en ide om hvad der sker, men mit kendskab til perl og awk er for begrænset til at jeg kan følge detaljerne. Jeg formoder at wikiget.awk henter artiklernes wikitekst. Hvorfor bruge awk til det? Jeg ville nok bruge curl til at lave et API-kald til det. Men jeg kan ikke se noget som importerer de udtrukne data fødsels- og dødsdato til Wikidata. --Dipsacus fullonum (talk) 15:34, 12 June 2022 (UTC)Reply
@Dipsacus fullonum Jeg har brugt awk rigtig meget til forskellige opgaver i forbindelse med wikidata. Det er en standardkomponent i Linux, og man kan nemt eksperimentere med det direkte fra kommandolinjen indtil man finder ud af hvordan man kommer frem til et ønsket resultat, og er faktisk et ret snu værktøj til mange forholdsvist simple opgaver. Jeg har mange gange downloaded en wikidata søgning og lokalt kørt en masse iterationer af forskellige scripts. I starten brugte jeg det primært til at fixe etiketter. Nu bruger jeg det til import af bygninger og gader m.m. og alle mulige forskellige maintenanceopgaver. Wikiget har jeg fundet på https://github.com/greencardamom/Wikiget og bruger det her til at hente artikeltekster minus markup. Perls regexp er snu til at pille bestemte data ud af en tekst. Scriptet importerer ikke direkte til Wikidata, men formaterer blot data, så de er klar til at indsætte i Quickstatements, hvor jeg så lige kigger på data inden jeg klikker "Run". Hjart (talk) 16:56, 12 June 2022 (UTC)Reply
Awks store styrke er tabeller og transformationer af data i disse. En simpelt script jeg har mange gange har kørt er f.eks.
Den køres på en downloaded søgning med 2 kolonner (emner + etiketter på f.eks. personer), finder etiketter med paranteser og laver ændringsforslag uden paranteser. Sed er en anelse mere snu til fjernelse af headers og dele af kolonner som bare er i vejen. Hjart (talk) 18:39, 12 June 2022 (UTC)Reply
Følgende oneliner brugte jeg til at finde og merge 437 dubletter af svenske kirker baseret på 2 forskellige søgninger:
::wdStrip"query(40).tsv"|gawk-F'\t''FNR==NR{a[$2]=$1; b[$2]=$3; next;} $2 ~ /kyrka$/ && $2 in a && $3 == b[$2] {print "MERGE\t" $1 "\t" a[$2]}'<(wdStrip"query(39).tsv")-|xclip
::
Kirkenavn og kommune i den ene fil læses ind i 2 arrays, hvorefter der løbes gennem de tilsvarende data i den anden fil og sammenlignes.
Den næste kører en Petscan på commons:Category:Listed buildings in Ribe, finder underkategorier på formen "gadenavn nummer" og formaterer data til oprettelse af huse der ikke allerede er repræsenteret i wikidata. Filen "gaderRibe.tsv" er "Qxxx,gadenavn", så scriptet selv kan finde gadernes Qværdier og oprette located on street (P669). Dette script er noget mere overskueligt end det med politikerne på dawiki, fordi der ikke er behov for at læse artikeltekster.
::wdfrededeRibe(){
::wdPetscan22105285|gawk-F'\t''BEGIN {print "qid,P31,P17,P131,P276,Dda,Den,Lda,Len,Scommonswiki,P669,qal670"} FNR==NR{a[$2]=$1; next;} $2 ~ /[1-9]/ {hus = $2; sub(/ \(.+/,"",hus); gade = hus; sub(/ [0-9].+/,"",gade); no = hus; sub(/.+ /,"",no); print ",Q41176,Q35,Q645747,Q322361,fredet bygning i Ribe,#listed building in Ribe, Denmark#," hus "," hus ",\"Category:" $2 "\"," a[gade] ",###" no "###"}'gaderRibe.tsv-|tr'#''"'
::}
::
Latest comment: 3 years ago1 comment1 person in discussion
I think you may have accidentally left Renè hanging (in the request a query forum). I find request involving the use of the mwapi extension annoying and thus I flat out ignore those, even if they pop up like maybe 50% of the time, I'm quite happy to leave those to someone else.
I had an idea here the other day; Constructing a graph made from the metadata available in the washed SQL dumps. This would make dealing with metadata a lot more pleasant, but what are the chances we could push the WMDE to do this? Like I said, the request for metadata shows up very often. Infrastruktur (talk) 19:42, 22 June 2022 (UTC)Reply
Latest comment: 3 years ago7 comments3 people in discussion
You wrote: I propose this solution to get headers with gender specific words:
In Module:Cycling race/l10n, add these new the tables for languages where it is needed due to gender specific wording: startlist_translate_women, startlisttable_translate_women, infobox_translate_women, headoftable_translate_women, headoftableII_translate_women, calendar_translate_women, victories_translate_women.
In Module:Cycling race in function translate, if called on a woman race and if a _translate_women table exists, then return the translation from that table. Otherwise use the _translate table as now.
It would take as much time to make a complete description as to do the work myself, and it would probably not be useful anyway for someone who has no experience with the programming language lua and modules in Wikimedia projects. Wait for discussion/comments from experienced users. This is very complex program so bigger changes should be considered carefully. --Dipsacus fullonum (talk) 15:16, 31 July 2022 (UTC)Reply
And if you think I am pinging @Tommes: you just to remind you, you would be correct. Some times things do need to be rubbed in, because it would not sink in otherwise. Have an otherwise great day! Infrastruktur (talk) 22:11, 15 September 2022 (UTC)Reply
I guess there is a misunderstanding. I am not an english native speaker. "This is a pity" or "What a pity!" shall express that I would like to have to issue solved or anything improved, find someone who knows how to do and shows the solution, but I can't implement the solution. It is just an expression of regret. Dipsacus fullonum, Infrastruktur --Tommes (talk) 16:25, 20 September 2022 (UTC)Reply
Latest comment: 3 years ago3 comments2 people in discussion
I figure it would be hard to come up with new contests that are novel. Buuut I have an idea that I think would be appropriate for December. Ever done a puzzle-run as a kid? Figured a fun exercise would be to do a couple of riddles that tell you where to find the next one. And we'll keep the difficulty down for this one. It might involve a problem where you have to find something specific that is within distance of something else. Not so much challenging at it will be charming I guess, but for this kind of contest it should not be hard. Infrastruktur (talk) 19:49, 15 September 2022 (UTC)Reply
Good idea stretching it out. Maybe something like an easter-quiz (påskenøtter), where you get say 7 or 10 small tasks in the days leading up to Christmas, that each will give you a word of X letters and you combine a single letter from each of those to get the the final word which is the solution. The individual things will all be found on Wikidata, but could be found by other means as well, it could be train stations/airports, locations, famous people, something from pop-culture etc. Infrastruktur (talk) 11:50, 16 September 2022 (UTC)Reply
But the countries are not listed in the order they appear in the wikidata, but first with the preferred rank, then with the normal rank.
Please help me make a request for the output in the order they appear on the wikidata.
With gratitude Igor Игорь Темиров (talk) 14:04, 5 November 2022 (UTC)Reply
Call for participation in a task-based online experiment
Latest comment: 2 years ago1 comment1 person in discussion
Dear Dipsacus_fullonum,
I hope you are doing well,
I am Kholoud, a researcher at King's College London, and I am working on a project as part of my PhD research, in which I have developed a personalised recommender model that suggests Wikidata items for the editors based on their past edits.
I am inviting you to a task-based study that will ask you to provide your judgments about the relevance of the items suggested by our model based on your previous edits.
Participation is completely voluntary, and your cooperation will enable us to evaluate the accuracy of the recommender system in suggesting relevant items to you. We will analyse the results anonymised, and they will be published to a research venue.
Then, I will contact you with the link to start the study.
For more information about the study, please read this post: https://www.wikidata.org/wiki/User:Kholoudsaa In case you have further questions or require more information, don't hesitate to contact me through my mentioned email.
Thank you for considering taking part in this research.
Latest comment: 1 year ago2 comments2 people in discussion
You keep posting in it calling my question asking what should be done incomprehensible despite explaining it multiple times. Please stop posting further replies in it. Thank you. Prototyperspective (talk) 18:01, 7 January 2025 (UTC)Reply
The thread is not yours and you have no authority over it. You have not explained yourself many times. Instead, you have repeated many times that you want something done to an item without explaining what you want to achieve. Until you explain this, no one can help you. Dipsacus fullonum (talk) 18:11, 7 January 2025 (UTC)Reply