Template talk:Wikidata list

Latest comment: 7 months ago by Solidest in topic Killed by OS for overloading memory

Sorting edit

User:Magnus Manske - can one sort by two things? Comma e.g. sort=P1,P2 seems not to work. 91.9.106.71 11:59, 25 May 2016 (UTC)Reply

You can sort by multiple columns with "ORDER BY" syntax in SPARQL queries. --Lockal (talk) 21:28, 25 May 2016 (UTC)Reply

WQS edit

Shouldn’t the “WQS” link above the table read “WDQS”? That seems to be the usual acronym as far as I’m aware. --TweetsFactsAndQueries (talk) 19:48, 4 March 2017 (UTC)Reply

  Done after no one objected for almost a year :) --TweetsFactsAndQueries (talk) 19:50, 24 February 2018 (UTC)Reply

Support entities other than items edit

@Magnus Manske: it would be great if we could also construct lists of other types of entities than just items, e. g. lists of all properties with a certain constraint (example). Currently, only items returned by the query are included in the list, and the properties are discarded. --Lucas Werkmeister (WMDE) (talk) 12:34, 19 May 2017 (UTC)Reply

I ran into this problem and tried to use random items by using RAND() as a workaround, but it is unexpectedly bound only once per query by Blazegraph it seems. Probably more bug than feature. :-/ --Marsupium (talk) 14:32, 15 June 2018 (UTC)Reply
You could use Property:P5176 for workarounds. Personally, I use "subject item", but that isn't necessarily present.
--- Jura 14:50, 15 June 2018 (UTC)Reply
An arbitrary QID can be defined via IRI(CONCAT("http://www.wikidata.org/entity/Q", ...)). Wikidata:WikiProject property constraints/reports/many exceptions gives an more complex example.--GZWDer (talk) 15:22, 21 September 2020 (UTC)Reply

Table width edit

Is it possible to use a custom table width in the auto-generated table? --Cavernia (talk) 12:47, 20 May 2017 (UTC)Reply

At Wikidata:WikiProject Lighthouses/numbers, I placed the tables within a table.
--- Jura 14:47, 20 May 2017 (UTC)Reply
Thanks! --Cavernia (talk) 19:38, 20 May 2017 (UTC)Reply

Local date format edit

Is it possible to present dates in different formats? --Cavernia (talk) 18:59, 23 May 2017 (UTC)Reply

Same for measurements. And is there any possibility to include unit? --Cavernia (talk) 12:42, 26 May 2017 (UTC)Reply

label don't work? edit

User:Magnus Manske Now the resul is like this: <code>[[::d:Q7775214|Категория:Интернет-провайдеры Новосибирска]]</code> double double-point. Can you fix? (example) --ValterVB (talk) 09:19, 19 August 2017 (UTC)Reply

Strange, the problem is only in category items (P31=Q4167836). --ValterVB (talk) 16:14, 19 August 2017 (UTC)Reply
@Magnus Manske: Also Wikidata:Database reports/to delete/empty category items has the same problem. --ValterVB (talk) 16:14, 23 August 2017 (UTC)Reply

Section from a non-direct property edit

Hello,

I try to break this list into sections by a property that is not directly one of the listed items. These are the parameters:

|sparql=
SELECT ?item ?constituency ?party ?localisation
WHERE {
  ?item wdt:P31 wd:Q5 .
  ?item p:P39 ?mandate .
  ?mandate rdf:type wikibase:BestRank ; ps:P39 wd:Q17506823 ; pq:P2937 wd:Q41655079 ; pq:P768 ?constituency .
  OPTIONAL { ?constituency wdt:P131 ?localisation . } .
  OPTIONAL { ?mandate pq:P1268 ?party . } .
}
|sort=family_name
|section=localisation
|min_section=1
|columns=label:Député,?party:Parti politique,?constituency:Circonscription,?localisation:Localisation,P18:Image

I would like to break the list into sections of ?localisation, but it doesn't seem to work. Is is possible? If so, what is the syntax to use?

Envlh (talk) 12:05, 17 November 2017 (UTC)Reply

?
--- Jura 12:10, 17 November 2017 (UTC)Reply
Template:Wikidata list (Q19860885). I don't know if it work. Can you try with |section=?localisation  – The preceding unsigned comment was added by ValterVB (talk • contribs).
Thanks, it works! — Envlh (talk) 12:45, 17 November 2017 (UTC)Reply
"?" is indeed the answer.
--- Jura 12:32, 17 November 2017 (UTC)Reply
:) --ValterVB (talk) 10:01, 18 November 2017 (UTC)Reply

User:Robin van der Vliet/Esperanto/Edziĝoj edit

When I press the update button, I receive the error status code "no items", while the button "WQS" does work as intended. Why is this and how can I solve this? Robin van der Vliet (talk) (contribs) 22:17, 6 January 2018 (UTC)Reply

The query don't return single row for item, but return more rows for an item (ex. Q12078075) If I remember well, Wikidatalist don't work if exist more of one row for the same item. --ValterVB (talk) 09:33, 7 January 2018 (UTC)Reply

I have the same problem in Types of films, I suppose. How can I make this list working? --Infovarius (talk) 13:50, 13 March 2018 (UTC)Reply

No context edit

The documentation for this template fails to describe the context in which one might use it. The primary purpose of Wikidata is to create items, but you can't put this in an item, so what is it for? Jc3s5h (talk) 12:54, 31 May 2018 (UTC)Reply

@Jc3s5h: Here is some context. --Daniel Mietchen (talk) 21:15, 17 August 2018 (UTC)Reply

Results from multiple wikis, possibly in multiple languages? edit

Over at Wikidata:WikiProject Humanitarian Wikidata, I was trying to get a Listeria list for items with sitelinks that have been tagged with the local version of Template:Current (Q5638917):

SELECT ?item ?itemLabel ?type ?typeLabel WHERE {
  {
    SELECT ?item WHERE {
      hint:SubQuery hint:optimizer "None".
      BIND(wd:Q5638917 AS ?template)
      ?templateArticle schema:isPartOf ?wikiProjectUrl;
                       schema:about ?template;
                       schema:name ?templateTitleWithNamespace.
      BIND(STRBEFORE(STRAFTER(?wikiProjectUrl, "https://"), "/") AS ?endpoint)
      BIND(STRAFTER(?templateTitleWithNamespace, ":") AS ?templateTitleWithoutNamespace)
      BIND(CONCAT("hastemplate:\"", ?templateTitleWithoutNamespace, "\"") AS ?gsrsearch)
      SERVICE wikibase:mwapi {
        bd:serviceParam wikibase:endpoint ?endpoint;
                        wikibase:api "Generator";
                        mwapi:generator "search";
                        mwapi:gsrsearch ?gsrsearch;
                        mwapi:gsrlimit "max".
        ?item wikibase:apiOutputItem mwapi:item.
      }
    }
    LIMIT 100
  }
  hint:Prior hint:runFirst "true".
  ?item wdt:P31|wdt:P279 ?type .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
LIMIT 100
Try it!

This does not currently work because the query service expects the endpoint to be a constant rather than a variable (see Phabricator ticket). However, I could imagine Listeria to do the looping over the different endpoints such that the query service would always be called with a constant for each wiki that has a local equivalent of Template:Current (Q5638917). This is not currently the case but if it were, we run into the next problem — how to display results from multiple sites. For instance, the query

SELECT ?item WHERE { ?item schema:about wd:Q5638917 }
Try it!

runs fine on the query service, yet I do not know how to get Listeria to display these results.

Finally, for use in WikiProjects on Wikidata, it would be really useful to have an output mode that makes use of the {{Q}} template to display list content in the interface language set by the user, but I do not see this amongst the existing options. --Daniel Mietchen (talk) 21:32, 17 August 2018 (UTC)Reply

"Other sites" links edit

Hello. How can I have a column with Commons categories? No the Commons category (P373). The link in "Other sites". Xaris333 (talk) 23:45, 25 December 2018 (UTC)Reply

@Xaris333:
?commonsLink schema:about ?item;
    schema:isPartOf <https://commons.wikimedia.org/> .
--Yair rand (talk) 07:31, 5 March 2019 (UTC)Reply

@Yair rand: I wasn't able to apply that. Can you help me. User:Xaris333/replace. Xaris333 (talk) 22:21, 22 December 2019 (UTC)Reply

Monolingual property in sort parameter edit

Hi! I tried to use monolingual property P:P6375 in monuments list but it doesn't work. Is it possible to fix it? --12:21, 15 May 2019 (UTC)

how to display a qualifier? edit

here I tried to display the qualifier time index (P4895) of narrative location (P840) but it only returns Array. what should I do? --Shisma (talk) 16:54, 3 January 2020 (UTC)Reply

With specific qualifier edit

User:Xaris333/replace1. Can the list show the population that have the qualifier point in time (P585) -> 2001? Xaris333 (talk) 22:08, 6 January 2020 (UTC)Reply

language edit

by example, for to have french language (français) we must to write |language=fr

--Antidote2020 (talk) 12:20, 25 April 2020 (UTC)Reply

Change text style based on statement rank edit

Currently, when using a property as a column all values of the property are rendered regardless of rank. Especially with deprecated values this can be problematic. I propose rendering deprecated values with strikethrough and preferred values in bold. ChristianKl15:57, 8 December 2020 (UTC)Reply

Listeria + WikidataList v2 edit

Hello. For WikiDonne, a few years now, I created more than 110 lists using this template and Listeria. At this time, all the lists are unavailable, I get this error Killed by OS for overloading memory (even when the result are 90 articles/items and works perfectly fine on query.wikidata). How is this possible? I know this template is now at v2, is something I need to change, how can I solve this problem? As all the lists are considering to be deleted, loosing the work for years. I also need this list for Wiki Loves Folklore which started on February 1st. This is the list, this is the query, this is how it works. Thank you. --Camelia (talk) 10:42, 3 February 2021 (UTC)Reply

Does it work now? The list on the page you linked show up for me... --Lectrician1 (talk) 14:57, 3 February 2021 (UTC)Reply
I tried now on page it:Progetto:WikiDonne/Liste voci mancanti/Folcloriste and don't work, same error: "Killed by OS for overloading memory." but "Wikidata Query Service" work. You can try yourself: click on "Aggiorna manualmente", it's the same of "Update the list now" of the english template. --ValterVB (talk) 15:04, 3 February 2021 (UTC)Reply
Unfortunately, new Listeria version is more performance demanding. Limiting is necessary to make the tool work. At Wikidata:Lists/corona_virus_deaths it was necessary to decrease the limit from 1000 to 400 (and 350 even further) to make the tool work again. --Jklamo (talk) 18:31, 3 February 2021 (UTC)Reply
@Camelia.boban: I changed the query and now it works. Unfortunately, the issue is understandable: memory overload is probably caused by inclusion of countries (and maybe other territories). Countries have a lot of labels and statements; and when loaded at least with the most intuitive way - by URLs like http://www.wikidata.org/entity/Q30.json - it loads a JSON of >1MB size each, which probably causes memory overload. The solution is extract country-related labels with SPARQL instead of "columns" parameter. --Lockal (talk) 21:02, 3 February 2021 (UTC)Reply
Related issue: https://github.com/magnusmanske/listeria_rs/issues/53. --Lockal (talk) 21:14, 3 February 2021 (UTC)Reply
@Lockal, Jklamo: Thank you, yes, now works, I will review all the other 100 lists. Hovever, the LIMIT was commented, as the final result was only a list of 90 items, so that specific query don't even needed a limit. --Camelia (talk) 02:13, 4 February 2021 (UTC)Reply

Sorting by a qualifier property edit

Any ideas on how to sort by a qualifier property (e.g. |sort=P106/Q3809586/P582)? The example below still seems to just sort by ascending QID (see my sandbox):

{{Wikidata list
|sparql=SELECT ?item ?length WHERE{
  ?item p:P106 ?wir .
  ?wir ps:P106 wd:Q3809586 .
  OPTIONAL { ?wir pq:P582 ?end . ?wir pqv:P582 [ wikibase:timePrecision ?tp_end]  }
  OPTIONAL { ?wir pq:P580 ?start . ?wir pqv:P580 [ wikibase:timePrecision ?tp_start] }
  BIND(IF(?tp_end=?tp_start,
          CONCAT(STR(12*(YEAR(?end)-YEAR(?start))+MONTH(?end)-MONTH(?start)), ' months'),
          'duration: not calculable') AS ?length)
 }
|sort=P106/Q3809586/P582
|sort_order=asc
|columns=label:               Wikimedian   ([[wikidata:Q3809586{{!}}Q3809586]]),
         P106/Q3809586/P108:  Organisation ([[wikidata:property:P106{{!}}P106]]),
         P106/Q3809586/P2699: Link         ([[wikidata:property:P2699{{!}}P2699]]),
         P106/Q3809586/P937:  Location     ([[wikidata:property:P937{{!}}P937]]),
         P106/Q3809586/P580:  Start        ([[wikidata:property:P580{{!}}P580]]),
         P106/Q3809586/P582:  End          ([[wikidata:property:P582{{!}}P582]]),
         ?length:             length
}}
{{Wikidata list end}}

The aim would be to replace this manually updated table of Wikimedians in Residence, and I feel like I'm nearly there. T.Shafee(evo&evo) (talk) 04:22, 19 February 2021 (UTC)Reply

Also known as edit

Is there a way to display aliases, i.e. also known as? --Juandev (talk) 21:36, 6 March 2021 (UTC)Reply

Dynamic Listeria: property return <claims> as value edit

Not sure if this is the right place for question for Dynamic Listeria page. Somehow, some properties do not return value but the term <claims>,e.g., official website (P856), ISNI (P213), see https://listeria.toolforge.org/dynamic.html#list=302. How can this be corrected? Thank you. jshieh (talk) 14:02, 16 March 2021 (UTC)Reply

Autolanguage in Wikidata list? edit

Is there any way set the labels to automaticly change with the user's interface language using {{Q}}? --Sabelöga (talk) 23:52, 17 July 2021 (UTC)Reply

"columns=Number" in combination with "row_template=" no longer works edit

At [1], the bot outputs

| number = style='text-align:right'| 1

Not sure how to use that in the template. It worked before [2]. --- Jura 13:12, 4 November 2021 (UTC)Reply

Creating links from a query edit

here I am trying to link results from the query to a link like: <a href="?stdtUrl">?stdc</a> is this possible somehow? --Loominade (talk) 14:08, 18 March 2022 (UTC)Reply

How to make sections be created at a different depth? edit

I've done an experiment with this template in User:Rdrg109/2/5.

In this specific revision, you can see that even though the template is used in a section with depth 4, the sections for the results, as specified through the section parameter, are created with depth 2.

The behavior I would expect is to create the sections in depth + 1 under the current section. In the context of the example of the revision, the sections should be created at depth 5, because the template is used in a section with depth 4.

I have two questions:

  1. Is this feature currently supported?
  2. Do you know a workaround to accomplish what I mentioned?

(please ping on reply) Rdrg109 (talk) 16:04, 25 July 2022 (UTC)Reply

Killed by OS for overloading memory edit

Error message "Killed by OS for overloading memory". Seems to be a known problem. Does someone knows how to fix it?

--Einsteiger (talk) 16:12, 15 October 2022 (UTC)Reply

See above, the script/server is having problems with labels from large items. Workaroud is not to resolve names of large items (like cities) with Listeria, but use pure SPARQL for this). Jklamo (talk) 10:15, 6 January 2023 (UTC)Reply
Starting ~July 2023 this stopped helping. Even removing the countries column completely does not help now. I suspect that some edits have been made to the code, or there is even less memory allocated for it now. Solidest (talk) 17:55, 27 August 2023 (UTC)Reply
I have tried many different ways to make it work Wikidata:WikiProject Music/Lists/Instance of music genre (removed all external identifiers, removed the countries column, changed subclasses to a variable), but no luck. If anyone has any other ideas - I would be glad for help. Solidest (talk) 15:36, 28 August 2023 (UTC)Reply
Return to "Wikidata list" page.