This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 | Archive 3 | Archive 4 | Archive 5 |
if not ref:find("Wikipedia") then refs = refs + 1 end
I believe you also have to check and exclude "wmflabs". It appears that a lot Wikidata items are sourced to wmflabs urls which appear to contain information from Wikipedia. Some of these URLs do contain the string "Wikipedia", but not all of them.
Oh crap. I think I just found a bigger problem. Let's say someone goes to one Wikidata item (United States of America), and they find an unsourced claim of relationship to a second wikidata item (capital: New York City, start time 1785, end time 1790). In this case the claim appears to be a true, but let's set that aside. Let's say they then go that second Wikidata item (New York City) and copy the claim (capital of: United States of America, start time 1785, end time 1790).
That's great - so far. However let's say they then add a reference. Stated in: United States of America.
That second claim is "sourced", but it's citing another wikidata item as a reference.
Would I be correct in guessing that attempting to filter out references from one wikidata item to another wikidata item is going to go "boom"?
And no, you can't fix it by deleting this one junk reference. I don't know how widespread the problem is, but I see a pile of references like this. Alsee ( talk) 07:06, 9 October 2017 (UTC)
"...a 'Stated in: OtherWikidataItem' ref is about as reasonable as a 'Stated in: Wikipedia' ref."False equivalence. It's more like including in a citation the link A History of the English-Speaking Peoples or The Guardian. That happens all the time on Wikipedia. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:31, 12 October 2017 (UTC)
From the documentation:
|list=<hlist|ubl>
allows multiple returned values to be displayed as a horizontal list (|list=hlist
), or a vertical unbulleted list (|list=ubl
). These override the separator and do not display the 'pen icon' linked to "Edit at Wikidata"Why not display the pen icon in these cases, it looks odd without it, e.g. at Trudi Canavan you can't easily tell that 'works' is from Wikidata while 'Awards' is locally defined. Thanks. Mike Peel ( talk) 11:26, 25 October 2017 (UTC)
Would it be possible to optionally specify a maximum number of values to retrieve? It would be particularly useful when fetching images and coordinates, where we want a maximum of 1 value to be returned as otherwise redlinks appear or values appear over the top of each other. Although we can use PreferredValue, there's no guarantee that this will only return one value. I don't think it matters *which* value is returned, so long as preferred values are chosen over normal rank ones. Thanks. Mike Peel ( talk) 21:52, 29 September 2017 (UTC)
|maxvals=
, which should do nothing if omitted, or blank or less than 1. See how it works with the
country (P17) for
Geneva (Q71):
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no}}
→ Switzerland,
First French Empire, Republic of Geneva, Republic of Geneva,
French First Republic
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=}}
→ Switzerland,
First French Empire, Republic of Geneva, Republic of Geneva,
French First Republic
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=0}}
→ Switzerland,
First French Empire, Republic of Geneva, Republic of Geneva,
French First Republic
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=1}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=2}}
→ Switzerland,
First French Empire
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=3}}
→ Switzerland,
First French Empire, Republic of Geneva
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=4}}
→ Switzerland,
First French Empire, Republic of Geneva, Republic of Geneva
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=5}}
→ Switzerland,
First French Empire, Republic of Geneva, Republic of Geneva,
French First Republic
{{#invoke:WikidataIB/sandbox |getPreferredValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getPreferredValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getPreferredValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=0}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getPreferredValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=1}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getPreferredValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=2}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getValue |P18 |fetchwikidata=ALL |qid=Q618630 |onlysourced=no |maxvals=1}}
doesn't seem to work though - it returns Goldstone Deep Space Communication Complex - GPN-2000-000506.jpg
- perhaps because it's a different datatype? Thanks.
Mike Peel (
talk) 14:39, 30 September 2017 (UTC)
I am trying to enable the "bishop 1" through "bishop 180" parameters on Template:Ordination to call values from Wikidata. The current structure that I've been experimenting with on Wikidata can be found on Francis (Q450675) under the standaolne property "subject has role". I would like to make it such that the "bishop 1" parameter uses getQualifierValue to call Horacio Ernesto Benites Astoul from the first "principal consecrator" value. Then, "bishop 2" would call Jorge Rubén Lugones from the second "principal consecrator" value. This would continue up to "bishop 180". Can this be done using the module? Also, is there a way so that the values called from WD are called chronologically according to the date entered as qualifiers. @ RexxS: Do you know if this is possible? Ergo Sum 18:15, 25 November 2017 (UTC)
{{#invoke:WikidataIB |getValue |P2868 |onlysourced=false |fetchwikidata=ALL}}
→
principal consecrator,
principal consecrator,
principal consecrator{{#invoke:WikidataIB |getQualifierValue |P2868 |pval=Q18442817 |qual=P642 |onlysourced=false |fetchwikidata=ALL}}
→
Horacio Ernesto Benites Astoul{{#invoke:WikidataIB/sandbox |getQualifierValue |P2868 |pval=Q18442817 |qual=P642 |onlysourced=false |fetchwikidata=ALL}}
→{{#invoke:WikidataIB/sandbox |getQualifierValue |P2868 |pval=Q18442817 |qual=P642 |onlysourced=false |list=hlist |fetchwikidata=ALL}}
→{{#invoke:WikidataIB/sandbox |getQualifierValue |P2868 |pval=Q18442817 |qual=P642 |onlysourced=false |list=ubl |fetchwikidata=ALL}}
→|data1 = [syntax to call first WD item]
, |data2 = [syntax to call second WD item]
, as well as the ability to sort them chronologically, alphabetically, etc.
Ergo Sum 20:16, 3 December 2017 (UTC)
{{#invoke:Wikidata|Dump}}
into an article section and preview it. If you do that in a section of
Pope Francis, you'll see that there are three entries in the property table for ["P2868"] (i.e.
subject has role (P2868)). These represent the three consecrations, and each one has a
point in time (P585) associated with it. So, in this case, it would be perfectly possible to to modify the code so that the point in time was read along with the name of the consecratee, but you're not telling me what you want to do with the date that is read (apart from possibly using it to sort the names). The code in the sandbox returns the names at present, but if you wanted it to do more, you'd have to be more specific about exactly what you want returned from the module. --
RexxS (
talk) 21:32, 3 December 2017 (UTC)I'm trying to set up a new Scientist Infobox. I'd like have have the thesis title linked and with a date like in the normal infoboxes. I managed to get something working in the testcases using getQualifierValue when the url and data is in the qualifier information (e.g. this WikiData entry), but it requires hardcoding the pval. Actually in many cases the information won't be in the qualifying section but in the wikidata entry for the thesis itself (e.g. this WikiData entry). Is there a way to access the URL & date values of a different wikidata entry which is the value of a property? Or to avoid hardcoding the pval? Or to make a link to the WD entry for the property value? D Wells ( talk) 19:51, 9 December 2017 (UTC)
{{#invoke:WikidataIB |getValue |P1026 |fetchwikidata=ALL}}
→[url-of-thesis thesis-name] (thesis-date)
, which is what I guess you want.See the documentation at Template:Emptyor and discussion at Template talk:Infobox scientist/Wikidata #Thesis. -- RexxS ( talk) 02:38, 4 January 2018 (UTC)
@ RexxS: Here's a fun one: trying something like {{#invoke:WikidataIB|getValue|P170|linkprefix=:|name=creator|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|}}}}} at commons:Category:Roman Slave to show a creator link adds the category to another category, rather than creating a link. As cool as that is, is there a way to enforce showing a link, rather than including a category? Thanks. Mike Peel ( talk) 21:17, 22 January 2018 (UTC)
lprefix
is forced to contain a string value, I think that ~= ""
is logically equivalent to > ""
(as a string value can't be less than the empty string). I agree that the the else
clauses on success are redundant. I think that errorOrEntity
is the right variable to pass at that point. Was there anything I missed? Thanks for that. --
RexxS (
talk) 19:34, 23 January 2018 (UTC)
{{#invoke:WikidataIB|getValue|P170|fetchwikidata=ALL|onlysourced=no|qid=Q28796962}}
→
Oscar Pereira da Silva
Hmm, RexxS is correct about the logical equivalence of >
and ~=
when comparing with an empty string, and I see that RexxS has fixed
c:Module:WikidataIB. However, I'll explain what I did. First, I cleaned the whitespace. That was probably a mistake because it complicates diffs. Second, I cleaned the unintended global variables because they often hide typos. The reason I fiddled with the two entity = errorOrEntity
lines is that entity
was a global variable. That was cleaning and would not affect results. The change of property_id
to propertyID
was, I guess, fixing a typo that would affect results if that variable is used. The last global variable was sx
and when I made it local I couldn't resist removing the trick of using #sx == 0
to test for an empty string. That trick was good for certain languages but
pylint has broken my habit of using it, and in fact the straightforward sx == ""
is better in Lua because it only checks if sx is the same object as the object representing an empty string.
Johnuniq (
talk) 03:13, 24 January 2018 (UTC)
property_id
came from, but I hope it wasn't me
. I was to blame for sx
. As for the testing, it's usually a matter of personal choice, but I suppose that whatever is the simplest for others to understand ought to be preferred, so thank you for your cleanup. --
RexxS (
talk) 12:51, 24 January 2018 (UTC)stripToNil
function in
Module:Age/sandbox (that is my most current version). Instead of
local input_parm = mw.text.trim(input_parm or "")
if input_parm and (#input_parm == 0) then input_parm = nil end
local input_parm = stripToNil(input_parm)
...
which I think I ranted about before although I can't find it now. In a stand-alone Lua program, ...
would be set from command-line arguments. However, that does not happen with modules and the attempts to use ...
are misguided. The section could be replaced with the equivalent:require('Module:i18n').loadI18n(mw.getCurrentFrame():getTitle()..'/i18n', i18n)
require('Module:i18n').loadI18n('Module:WikidataIB/i18n', i18n)
if next(out) then
where
Module:WikidataIB/sandbox2 uses if #out > 0 then
. The former is the standard Lua method for determining whether a table is empty. Efficiency does not matter in this case, but in general #out
involves significant effort because Lua has to count the numbered items in the table.stripToNil
function because parameters passed can always be nil, empty-string or string; although sometimes it will be more convenient to convert nil to empty-string, rather than the other way. Maybe a stripToEmpty( s ) -> if not s then s = "" end
would also be generally useful for parameter handling?if s == "" then
, as I'm pretty sure coders coming from other languages are likely to find that more obvious than if #s == 0 then
. Maybe we should be writing a Module Manual of Style
?next(t)
is the standard Lua method to see whether a table is empty or not, because – as you know – #t
returns the value of the highest index in the sequence t. If a table is a simple sequence, then #t
will also be the number of elements in the table (as it is with the out
table), but if t[1]
is nil then #t
will be zero, regardless of other indices. I was surprised to see, after a bit of testing, that my pc can do a billion evaluations of #t
in Lua in 22 sec, but a billion evaluations of next(t)
takes 62 sec. None of that is meaningful in this module, of course, but it does show how efficiently Lua deals with table indexes compared with how it handles even its built-in functions. Cheers --
RexxS (
talk) 21:12, 25 January 2018 (UTC)
|parm=value
and they check various things to determine value which might end up being blank. I've therefore treated blank values as nil and don't recall needing any exceptions for named parameters....
is irritating as it will become secret lore as the way things should be done. In fact, it probably originated from a module where the author tested on a stand-alone system where ...
made sense. If ever wanted, I have better ways of doing that but meanwhile I checked
Module:WikidataIB (Q25714577) to see that the module title is WikidataIB everywhere it is currently used so I removed the complexity. Revert if wanted.
Johnuniq (
talk) 08:19, 26 January 2018 (UTC)
s = frame.args.parm or ""
does that job more simply. It's useful for parameters like lprefix
where I can concatenate it without having to test, as long as I know that it can't be nil. Some of the string-handling functions also give errors when used on a nil argument, so in those sort of cases my instinct is to use ""
as the null value.t = { "alpha", "bravo", "charlie", "delta", "echo"} n = 0 now = os.time() for i = 1, 1e9 do n = next(t) end print( os.time() - now ) -- n = 1 -> 13 sec -- n = #t -> 35 sec -- n = next(t) -> 75 sec
next(t)
if we know we're dealing with sequences.Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |1=}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |wikidata}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |1=wikidata}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |locally supplied description}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |none}} |
Script error: No such module "WikidataIB/sandbox2". |
What I need is a merge of getPreferredValue and getQualifierValue, i.e. the qualifier of a preferred value. Kangaroo caught ( talk) 03:05, 4 February 2018 (UTC)
Following the discussions at
Module talk:WikidataIB/Archive 2 #links to categories, I've updated this module from
Module:WikidataIB/sandbox2 to include: John's cleanup and error fixes; implementation of maxvalues
; addition of getDescription()
; and extending link-pre/postfixes for all values. Please let me know if you spot any problems. --
RexxS (
talk) 13:45, 28 February 2018 (UTC)
I wonder if it's possible to add the capability to call a value of arbitrary rank, e.g. getNormal, and getDeprecated, which would call only values ranked as normal and deprecated, respectively. This would be very helpful in allowing me to make the co-consecrator
parameter on {{
Ordination}} Wikidata-enabled. I'd like it to call only values of normal rank, not preferred.
Ergo Sum 22:22, 23 February 2018 (UTC)
{{#invoke:WikidataIB/sandbox |getNormalValue |P735 |fetchwikidata=ALL |onlysourced=no |qid=Q42}}
→ Script error: The function "getNormalValue" does not exist.I tried using this module on sawiki, but age is giving some error. It says "वाचनिकदोषः : अनपेक्षितम् उद्गारचिह्नम २" which translates somewhat to "Script error: unexpected symbol thrown 2". Can someone please help? @ RexxS: Error cn be viewed at sa:दिशा पटानी Capankajsmilyo ( talk) 00:22, 1 April 2018 (UTC)
* 1>{{#invoke:WikidataIB |getPreferredValue |P569 |name=birth_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced={{{onlysourced|}}} |noicon={{{noicon|}}}|{{{birth_date|}}} |df={{{dateformat|dmy}}} }} * 2>{{#invoke:WikidataIB |getPreferredValue |P570 |name=death_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced={{{onlysourced|}}} |noicon={{{noicon|}}} |{{{death_date|}}} | df={{{dateformat|dmy}}} }} * 3>{{str len|{{wikidata|property||{{{qid|}}}|P569}}}} * 4>{{wikidata|property|raw|{{{qid|}}}|P569}}
|data10
("Born") line of
sa:फलकम्:Infobox person. The fourth line gives me the error फलकम्: Wikidata - with "Template:Wikidata pages not live" on hover.आयुः {{#expr: trunc ({{#time: Y.md}}-{{#time: Y.md|{{#titleparts:{{wikidata|property|raw|{{{qid|}}}|P569}}|1}}}})}}
{{#time: Y.md}}
→ २०१८.०४०१{{#time: Y.md|1992-06-13}}
→ १९९२.०६१३{{#expr: {{#time: Y.md}}-{{#time: Y.md|1992-06-13}} }}
→ Expression error: Unrecognized punctuation character "२".|en
to get the values in English digits. That would give:{{#expr: {{#time: Y.md||en}}-{{#time: Y.md|1992-06-13|en}} }}
I think getQualifierValue should have same capabilities as getValue, i.e., the ability of formatting multiple returned values. In my proposal wikidata:Wikidata:Property proposal/hearing date, it was my understanding that instead of creating a new property taking a date value, I could push these dates into property-qualifier-value tuples. How else can I deal with multiple Item-Property-Qualifier-Value tuples where only the value is different? esbranson ( talk) 00:49, 4 April 2018 (UTC)
@ Esbranson: I now have a version working, I think, in Module:WikidataIB/sandbox
start time (P580) qualifier for significant event (P793) equals construction (Q385378) in South Pole Telescope (Q1513315)
{{#invoke:WikidataIB/sandbox |getQualifierValue |P793 |pval=Q385378 |qual=P580 |fetchwikidata=ALL |onlysourced=no |qid=Q1513315}}
→ November 2006
start time (P580) qualifier for
spouse (P26) equals
Sally Burton (Q3469983) in
Richard Burton (Q151973)
{{#invoke:WikidataIB/sandbox |getQualifierValue |P26 |pval=Q3469983 |qual=P580 |fetchwikidata=ALL |onlysourced=no |qid=Q151973}}
→ 3 July 1983
{{#invoke:WikidataIB/sandbox |getQualifierValue |P26 |pval=Q3469983 |qual=P580 |fetchwikidata=ALL |onlysourced=no |qid=Q151973 |df=mdy}}}
→ July 3, 1983
start time (P580) qualifier for
spouse (P26) equals
Elizabeth Taylor (Q34851) in
Richard Burton (Q151973)
{{#invoke:WikidataIB/sandbox |getQualifierValue |P26 |pval=Q34851 |qual=P580 |fetchwikidata=ALL |onlysourced=no |qid=Q151973}}
→ 15 March 1964, 10 October 1975
{{#invoke:WikidataIB/sandbox |getQualifierValue |P26 |pval=Q34851 |qual=P580 |fetchwikidata=ALL |onlysourced=no |qid=Q151973 |df=mdy}}}
→ March 15, 1964, October 10, 1975
instance of (P31) qualifier for
has part(s) of the class (P2670) equals
telescope mount (Q1205231) in
South Pole Telescope (Q1513315)
{{#invoke:WikidataIB/sandbox |getQualifierValue |P2670 |pval=Q1205231 |qual=P31 |fetchwikidata=ALL |onlysourced=no |qid=Q1513315}}
→
altazimuth mount
I haven't got the handling of multiple values right yet, so I could use some more examples to test on. Do you have any for me? Cheers -- RexxS ( talk) 23:09, 8 April 2018 (UTC)
A major re-write of the module is currently under testing in Module:WikidataIB/sandbox. The main purpose is to reproduce the functionality of other calls in getValue(). Some test cases are in Module talk:WikidataIB/sandbox/testing. In addition, a template {{ wdib}} is available as a wrapper for the getValue function.
Changes include:
|qual=
. This is the property-id of a qualifier that is to be returned in parentheses after the property, if any qualifiers exist for the property. Setting qual=ALL returns all qualifiers. Setting qual=DATES returns start time (P580) and end time (P582) with a date separator.|qsorted=
. This is a true/false switch that enables the sorting of multiple qualifier values within each item. Values no, false and 0 are all false; anything else is true. Default is false.|qsep=
. This customises the string that is used to separate multiple returned qualifier values. Any double-quotes " are stripped out, so that spaces may be passed. Default is ", ".|linked=
. This is a true/false switch that enables the showing of links to articles. Values no, false and 0 are all false; anything else is true. Default is true.|rank=
. When set to "preferred", it returns only preferred values if present, otherwise returns all. When set to "normal", it returns only normal values if present, otherwise returns all. Any parameter value beginning with "p" is "preferred". Any parameter value beginning with "n" is "normal". Default is to return all ranks. This allows getValue to duplicate the functionality of getPreferredValue and getNormalValue which may now be deprecated.Here's an example of (1) all and (2) the preferred values of creator (P170) from Corisca and the Satyr (Q29016906):
{{wdib |P170 |qid=Q29016906 |fwd=ALL |osd=no}}
→
Artemisia Gentileschi,
Aniella di Beltrano,
Massimo Stanzione
{{wdib |P170 |qid=Q29016906 |fwd=ALL |osd=no |rank=p}}
→
Artemisia Gentileschi
The values and date qualifiers for what Geneva was the capital of:
{{wdib |P1376 |fwd=ALL |osd=no |qid=Q71 |qual=DATES}}
→
Canton of Geneva (1815–),
Léman (1798–1813), Republic of Geneva (1534–1798), Republic of Geneva (1813–1815)
{{wdib |P1376 |fwd=ALL |osd=no |qid=Q71 |qual=ALL |sep="; also " |qsep=" to "}}
→
Canton of Geneva (1815–); also
Léman (1798–1813); also Republic of Geneva (1534–1798); also Republic of Geneva (1813–1815)
-- RexxS ( talk) 18:34, 14 April 2018 (UTC)
Hello I was trying to use Wikidata coordinates in
sa:Template:Infobox settlement, but it's getting a lil confusing. I tried the Wikidata code used in {{
Infobox telescope}} but the
sa:Template:Infobox settlement has more than 1 requirement of |coordinates=
. Please help...
Capankajsmilyo (
talk) 09:18, 15 April 2018 (UTC)
@
RexxS: can you please make this module language independent. I mean as we give params like |suppressfield=
, etc, we give language code and output is in that particular language.
hi:Module:अंक परिवर्तन is not a good option to use when output of this module involves pencil and other extra text. And if possible, making the language selection automatic (via looking up which Wikipedia is it) would be an ideal solution.
Capankajsmilyo (
talk) 06:08, 16 April 2018 (UTC)
|name=
, so unless the string.find() function isn't coping with your character set, it should not matter what language you're in for those parameter values. Making a module completely language independent is a difficult task and it's not something I'm keen to try until I'm sure the code is completely stable, and given the major re-write I noted above, that may take some time to be certain of. In the meantime, I'm loathe to take the internationalisation out of the main module because it's simply not necessary. All of the available internationalisation is done in the first 85 lines, so adapting that to a local Wikipedia is the same job, regardless of whether it's in a separate module or not.|noicon=
or the code could be modified for rtl usage, but we'd need an example of what the desired output would be, rather than simply asserting it's "not a good option". As I don't speak Arabic or Hindi, etc. I have no idea of what a "good option" might look like.Hi, I'm struggling with some infobox at ptwiki and need some help in thinking in a solution. See pt:Monumento a Luiz Pereira Barreto. The field "Dimensões" has 4 values (2 for height and 2 for width), but one measure of each is for the sculpture and the remaining are for the pedestal. So, my question is, similar to getQualifierValue, where I can get the value of the qualifier when I know the value for the property, is it possible to make the other way? I mean getting the property value only if they have a "pqal" qualifier. Ping to RexxS because you are a god! Ederporto ( talk) 23:49, 18 April 2018 (UTC)
This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 | Archive 3 | Archive 4 | Archive 5 |
if not ref:find("Wikipedia") then refs = refs + 1 end
I believe you also have to check and exclude "wmflabs". It appears that a lot Wikidata items are sourced to wmflabs urls which appear to contain information from Wikipedia. Some of these URLs do contain the string "Wikipedia", but not all of them.
Oh crap. I think I just found a bigger problem. Let's say someone goes to one Wikidata item (United States of America), and they find an unsourced claim of relationship to a second wikidata item (capital: New York City, start time 1785, end time 1790). In this case the claim appears to be a true, but let's set that aside. Let's say they then go that second Wikidata item (New York City) and copy the claim (capital of: United States of America, start time 1785, end time 1790).
That's great - so far. However let's say they then add a reference. Stated in: United States of America.
That second claim is "sourced", but it's citing another wikidata item as a reference.
Would I be correct in guessing that attempting to filter out references from one wikidata item to another wikidata item is going to go "boom"?
And no, you can't fix it by deleting this one junk reference. I don't know how widespread the problem is, but I see a pile of references like this. Alsee ( talk) 07:06, 9 October 2017 (UTC)
"...a 'Stated in: OtherWikidataItem' ref is about as reasonable as a 'Stated in: Wikipedia' ref."False equivalence. It's more like including in a citation the link A History of the English-Speaking Peoples or The Guardian. That happens all the time on Wikipedia. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:31, 12 October 2017 (UTC)
From the documentation:
|list=<hlist|ubl>
allows multiple returned values to be displayed as a horizontal list (|list=hlist
), or a vertical unbulleted list (|list=ubl
). These override the separator and do not display the 'pen icon' linked to "Edit at Wikidata"Why not display the pen icon in these cases, it looks odd without it, e.g. at Trudi Canavan you can't easily tell that 'works' is from Wikidata while 'Awards' is locally defined. Thanks. Mike Peel ( talk) 11:26, 25 October 2017 (UTC)
Would it be possible to optionally specify a maximum number of values to retrieve? It would be particularly useful when fetching images and coordinates, where we want a maximum of 1 value to be returned as otherwise redlinks appear or values appear over the top of each other. Although we can use PreferredValue, there's no guarantee that this will only return one value. I don't think it matters *which* value is returned, so long as preferred values are chosen over normal rank ones. Thanks. Mike Peel ( talk) 21:52, 29 September 2017 (UTC)
|maxvals=
, which should do nothing if omitted, or blank or less than 1. See how it works with the
country (P17) for
Geneva (Q71):
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no}}
→ Switzerland,
First French Empire, Republic of Geneva, Republic of Geneva,
French First Republic
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=}}
→ Switzerland,
First French Empire, Republic of Geneva, Republic of Geneva,
French First Republic
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=0}}
→ Switzerland,
First French Empire, Republic of Geneva, Republic of Geneva,
French First Republic
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=1}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=2}}
→ Switzerland,
First French Empire
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=3}}
→ Switzerland,
First French Empire, Republic of Geneva
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=4}}
→ Switzerland,
First French Empire, Republic of Geneva, Republic of Geneva
{{#invoke:WikidataIB/sandbox |getValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=5}}
→ Switzerland,
First French Empire, Republic of Geneva, Republic of Geneva,
French First Republic
{{#invoke:WikidataIB/sandbox |getPreferredValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getPreferredValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getPreferredValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=0}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getPreferredValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=1}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getPreferredValue |P17 |fetchwikidata=ALL |qid=Q71 |onlysourced=no |maxvals=2}}
→ Switzerland
{{#invoke:WikidataIB/sandbox |getValue |P18 |fetchwikidata=ALL |qid=Q618630 |onlysourced=no |maxvals=1}}
doesn't seem to work though - it returns Goldstone Deep Space Communication Complex - GPN-2000-000506.jpg
- perhaps because it's a different datatype? Thanks.
Mike Peel (
talk) 14:39, 30 September 2017 (UTC)
I am trying to enable the "bishop 1" through "bishop 180" parameters on Template:Ordination to call values from Wikidata. The current structure that I've been experimenting with on Wikidata can be found on Francis (Q450675) under the standaolne property "subject has role". I would like to make it such that the "bishop 1" parameter uses getQualifierValue to call Horacio Ernesto Benites Astoul from the first "principal consecrator" value. Then, "bishop 2" would call Jorge Rubén Lugones from the second "principal consecrator" value. This would continue up to "bishop 180". Can this be done using the module? Also, is there a way so that the values called from WD are called chronologically according to the date entered as qualifiers. @ RexxS: Do you know if this is possible? Ergo Sum 18:15, 25 November 2017 (UTC)
{{#invoke:WikidataIB |getValue |P2868 |onlysourced=false |fetchwikidata=ALL}}
→
principal consecrator,
principal consecrator,
principal consecrator{{#invoke:WikidataIB |getQualifierValue |P2868 |pval=Q18442817 |qual=P642 |onlysourced=false |fetchwikidata=ALL}}
→
Horacio Ernesto Benites Astoul{{#invoke:WikidataIB/sandbox |getQualifierValue |P2868 |pval=Q18442817 |qual=P642 |onlysourced=false |fetchwikidata=ALL}}
→{{#invoke:WikidataIB/sandbox |getQualifierValue |P2868 |pval=Q18442817 |qual=P642 |onlysourced=false |list=hlist |fetchwikidata=ALL}}
→{{#invoke:WikidataIB/sandbox |getQualifierValue |P2868 |pval=Q18442817 |qual=P642 |onlysourced=false |list=ubl |fetchwikidata=ALL}}
→|data1 = [syntax to call first WD item]
, |data2 = [syntax to call second WD item]
, as well as the ability to sort them chronologically, alphabetically, etc.
Ergo Sum 20:16, 3 December 2017 (UTC)
{{#invoke:Wikidata|Dump}}
into an article section and preview it. If you do that in a section of
Pope Francis, you'll see that there are three entries in the property table for ["P2868"] (i.e.
subject has role (P2868)). These represent the three consecrations, and each one has a
point in time (P585) associated with it. So, in this case, it would be perfectly possible to to modify the code so that the point in time was read along with the name of the consecratee, but you're not telling me what you want to do with the date that is read (apart from possibly using it to sort the names). The code in the sandbox returns the names at present, but if you wanted it to do more, you'd have to be more specific about exactly what you want returned from the module. --
RexxS (
talk) 21:32, 3 December 2017 (UTC)I'm trying to set up a new Scientist Infobox. I'd like have have the thesis title linked and with a date like in the normal infoboxes. I managed to get something working in the testcases using getQualifierValue when the url and data is in the qualifier information (e.g. this WikiData entry), but it requires hardcoding the pval. Actually in many cases the information won't be in the qualifying section but in the wikidata entry for the thesis itself (e.g. this WikiData entry). Is there a way to access the URL & date values of a different wikidata entry which is the value of a property? Or to avoid hardcoding the pval? Or to make a link to the WD entry for the property value? D Wells ( talk) 19:51, 9 December 2017 (UTC)
{{#invoke:WikidataIB |getValue |P1026 |fetchwikidata=ALL}}
→[url-of-thesis thesis-name] (thesis-date)
, which is what I guess you want.See the documentation at Template:Emptyor and discussion at Template talk:Infobox scientist/Wikidata #Thesis. -- RexxS ( talk) 02:38, 4 January 2018 (UTC)
@ RexxS: Here's a fun one: trying something like {{#invoke:WikidataIB|getValue|P170|linkprefix=:|name=creator|qid={{{qid|}}}|suppressfields={{{suppressfields|}}}|fetchwikidata={{{fetchwikidata|ALL}}}|onlysourced={{{onlysourced|}}}}} at commons:Category:Roman Slave to show a creator link adds the category to another category, rather than creating a link. As cool as that is, is there a way to enforce showing a link, rather than including a category? Thanks. Mike Peel ( talk) 21:17, 22 January 2018 (UTC)
lprefix
is forced to contain a string value, I think that ~= ""
is logically equivalent to > ""
(as a string value can't be less than the empty string). I agree that the the else
clauses on success are redundant. I think that errorOrEntity
is the right variable to pass at that point. Was there anything I missed? Thanks for that. --
RexxS (
talk) 19:34, 23 January 2018 (UTC)
{{#invoke:WikidataIB|getValue|P170|fetchwikidata=ALL|onlysourced=no|qid=Q28796962}}
→
Oscar Pereira da Silva
Hmm, RexxS is correct about the logical equivalence of >
and ~=
when comparing with an empty string, and I see that RexxS has fixed
c:Module:WikidataIB. However, I'll explain what I did. First, I cleaned the whitespace. That was probably a mistake because it complicates diffs. Second, I cleaned the unintended global variables because they often hide typos. The reason I fiddled with the two entity = errorOrEntity
lines is that entity
was a global variable. That was cleaning and would not affect results. The change of property_id
to propertyID
was, I guess, fixing a typo that would affect results if that variable is used. The last global variable was sx
and when I made it local I couldn't resist removing the trick of using #sx == 0
to test for an empty string. That trick was good for certain languages but
pylint has broken my habit of using it, and in fact the straightforward sx == ""
is better in Lua because it only checks if sx is the same object as the object representing an empty string.
Johnuniq (
talk) 03:13, 24 January 2018 (UTC)
property_id
came from, but I hope it wasn't me
. I was to blame for sx
. As for the testing, it's usually a matter of personal choice, but I suppose that whatever is the simplest for others to understand ought to be preferred, so thank you for your cleanup. --
RexxS (
talk) 12:51, 24 January 2018 (UTC)stripToNil
function in
Module:Age/sandbox (that is my most current version). Instead of
local input_parm = mw.text.trim(input_parm or "")
if input_parm and (#input_parm == 0) then input_parm = nil end
local input_parm = stripToNil(input_parm)
...
which I think I ranted about before although I can't find it now. In a stand-alone Lua program, ...
would be set from command-line arguments. However, that does not happen with modules and the attempts to use ...
are misguided. The section could be replaced with the equivalent:require('Module:i18n').loadI18n(mw.getCurrentFrame():getTitle()..'/i18n', i18n)
require('Module:i18n').loadI18n('Module:WikidataIB/i18n', i18n)
if next(out) then
where
Module:WikidataIB/sandbox2 uses if #out > 0 then
. The former is the standard Lua method for determining whether a table is empty. Efficiency does not matter in this case, but in general #out
involves significant effort because Lua has to count the numbered items in the table.stripToNil
function because parameters passed can always be nil, empty-string or string; although sometimes it will be more convenient to convert nil to empty-string, rather than the other way. Maybe a stripToEmpty( s ) -> if not s then s = "" end
would also be generally useful for parameter handling?if s == "" then
, as I'm pretty sure coders coming from other languages are likely to find that more obvious than if #s == 0 then
. Maybe we should be writing a Module Manual of Style
?next(t)
is the standard Lua method to see whether a table is empty or not, because – as you know – #t
returns the value of the highest index in the sequence t. If a table is a simple sequence, then #t
will also be the number of elements in the table (as it is with the out
table), but if t[1]
is nil then #t
will be zero, regardless of other indices. I was surprised to see, after a bit of testing, that my pc can do a billion evaluations of #t
in Lua in 22 sec, but a billion evaluations of next(t)
takes 62 sec. None of that is meaningful in this module, of course, but it does show how efficiently Lua deals with table indexes compared with how it handles even its built-in functions. Cheers --
RexxS (
talk) 21:12, 25 January 2018 (UTC)
|parm=value
and they check various things to determine value which might end up being blank. I've therefore treated blank values as nil and don't recall needing any exceptions for named parameters....
is irritating as it will become secret lore as the way things should be done. In fact, it probably originated from a module where the author tested on a stand-alone system where ...
made sense. If ever wanted, I have better ways of doing that but meanwhile I checked
Module:WikidataIB (Q25714577) to see that the module title is WikidataIB everywhere it is currently used so I removed the complexity. Revert if wanted.
Johnuniq (
talk) 08:19, 26 January 2018 (UTC)
s = frame.args.parm or ""
does that job more simply. It's useful for parameters like lprefix
where I can concatenate it without having to test, as long as I know that it can't be nil. Some of the string-handling functions also give errors when used on a nil argument, so in those sort of cases my instinct is to use ""
as the null value.t = { "alpha", "bravo", "charlie", "delta", "echo"} n = 0 now = os.time() for i = 1, 1e9 do n = next(t) end print( os.time() - now ) -- n = 1 -> 13 sec -- n = #t -> 35 sec -- n = next(t) -> 75 sec
next(t)
if we know we're dealing with sequences.Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |1=}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |wikidata}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |1=wikidata}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |locally supplied description}} |
Script error: No such module "WikidataIB/sandbox2". |
Douglas Adams (Q42) | {{#invoke:WikidataIB/sandbox2 |getDescription |qid=Q42 |none}} |
Script error: No such module "WikidataIB/sandbox2". |
What I need is a merge of getPreferredValue and getQualifierValue, i.e. the qualifier of a preferred value. Kangaroo caught ( talk) 03:05, 4 February 2018 (UTC)
Following the discussions at
Module talk:WikidataIB/Archive 2 #links to categories, I've updated this module from
Module:WikidataIB/sandbox2 to include: John's cleanup and error fixes; implementation of maxvalues
; addition of getDescription()
; and extending link-pre/postfixes for all values. Please let me know if you spot any problems. --
RexxS (
talk) 13:45, 28 February 2018 (UTC)
I wonder if it's possible to add the capability to call a value of arbitrary rank, e.g. getNormal, and getDeprecated, which would call only values ranked as normal and deprecated, respectively. This would be very helpful in allowing me to make the co-consecrator
parameter on {{
Ordination}} Wikidata-enabled. I'd like it to call only values of normal rank, not preferred.
Ergo Sum 22:22, 23 February 2018 (UTC)
{{#invoke:WikidataIB/sandbox |getNormalValue |P735 |fetchwikidata=ALL |onlysourced=no |qid=Q42}}
→ Script error: The function "getNormalValue" does not exist.I tried using this module on sawiki, but age is giving some error. It says "वाचनिकदोषः : अनपेक्षितम् उद्गारचिह्नम २" which translates somewhat to "Script error: unexpected symbol thrown 2". Can someone please help? @ RexxS: Error cn be viewed at sa:दिशा पटानी Capankajsmilyo ( talk) 00:22, 1 April 2018 (UTC)
* 1>{{#invoke:WikidataIB |getPreferredValue |P569 |name=birth_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced={{{onlysourced|}}} |noicon={{{noicon|}}}|{{{birth_date|}}} |df={{{dateformat|dmy}}} }} * 2>{{#invoke:WikidataIB |getPreferredValue |P570 |name=death_date |qid={{{qid|}}} |suppressfields={{{suppressfields|}}} |fetchwikidata={{{fetchwikidata|ALL}}} |onlysourced={{{onlysourced|}}} |noicon={{{noicon|}}} |{{{death_date|}}} | df={{{dateformat|dmy}}} }} * 3>{{str len|{{wikidata|property||{{{qid|}}}|P569}}}} * 4>{{wikidata|property|raw|{{{qid|}}}|P569}}
|data10
("Born") line of
sa:फलकम्:Infobox person. The fourth line gives me the error फलकम्: Wikidata - with "Template:Wikidata pages not live" on hover.आयुः {{#expr: trunc ({{#time: Y.md}}-{{#time: Y.md|{{#titleparts:{{wikidata|property|raw|{{{qid|}}}|P569}}|1}}}})}}
{{#time: Y.md}}
→ २०१८.०४०१{{#time: Y.md|1992-06-13}}
→ १९९२.०६१३{{#expr: {{#time: Y.md}}-{{#time: Y.md|1992-06-13}} }}
→ Expression error: Unrecognized punctuation character "२".|en
to get the values in English digits. That would give:{{#expr: {{#time: Y.md||en}}-{{#time: Y.md|1992-06-13|en}} }}
I think getQualifierValue should have same capabilities as getValue, i.e., the ability of formatting multiple returned values. In my proposal wikidata:Wikidata:Property proposal/hearing date, it was my understanding that instead of creating a new property taking a date value, I could push these dates into property-qualifier-value tuples. How else can I deal with multiple Item-Property-Qualifier-Value tuples where only the value is different? esbranson ( talk) 00:49, 4 April 2018 (UTC)
@ Esbranson: I now have a version working, I think, in Module:WikidataIB/sandbox
start time (P580) qualifier for significant event (P793) equals construction (Q385378) in South Pole Telescope (Q1513315)
{{#invoke:WikidataIB/sandbox |getQualifierValue |P793 |pval=Q385378 |qual=P580 |fetchwikidata=ALL |onlysourced=no |qid=Q1513315}}
→ November 2006
start time (P580) qualifier for
spouse (P26) equals
Sally Burton (Q3469983) in
Richard Burton (Q151973)
{{#invoke:WikidataIB/sandbox |getQualifierValue |P26 |pval=Q3469983 |qual=P580 |fetchwikidata=ALL |onlysourced=no |qid=Q151973}}
→ 3 July 1983
{{#invoke:WikidataIB/sandbox |getQualifierValue |P26 |pval=Q3469983 |qual=P580 |fetchwikidata=ALL |onlysourced=no |qid=Q151973 |df=mdy}}}
→ July 3, 1983
start time (P580) qualifier for
spouse (P26) equals
Elizabeth Taylor (Q34851) in
Richard Burton (Q151973)
{{#invoke:WikidataIB/sandbox |getQualifierValue |P26 |pval=Q34851 |qual=P580 |fetchwikidata=ALL |onlysourced=no |qid=Q151973}}
→ 15 March 1964, 10 October 1975
{{#invoke:WikidataIB/sandbox |getQualifierValue |P26 |pval=Q34851 |qual=P580 |fetchwikidata=ALL |onlysourced=no |qid=Q151973 |df=mdy}}}
→ March 15, 1964, October 10, 1975
instance of (P31) qualifier for
has part(s) of the class (P2670) equals
telescope mount (Q1205231) in
South Pole Telescope (Q1513315)
{{#invoke:WikidataIB/sandbox |getQualifierValue |P2670 |pval=Q1205231 |qual=P31 |fetchwikidata=ALL |onlysourced=no |qid=Q1513315}}
→
altazimuth mount
I haven't got the handling of multiple values right yet, so I could use some more examples to test on. Do you have any for me? Cheers -- RexxS ( talk) 23:09, 8 April 2018 (UTC)
A major re-write of the module is currently under testing in Module:WikidataIB/sandbox. The main purpose is to reproduce the functionality of other calls in getValue(). Some test cases are in Module talk:WikidataIB/sandbox/testing. In addition, a template {{ wdib}} is available as a wrapper for the getValue function.
Changes include:
|qual=
. This is the property-id of a qualifier that is to be returned in parentheses after the property, if any qualifiers exist for the property. Setting qual=ALL returns all qualifiers. Setting qual=DATES returns start time (P580) and end time (P582) with a date separator.|qsorted=
. This is a true/false switch that enables the sorting of multiple qualifier values within each item. Values no, false and 0 are all false; anything else is true. Default is false.|qsep=
. This customises the string that is used to separate multiple returned qualifier values. Any double-quotes " are stripped out, so that spaces may be passed. Default is ", ".|linked=
. This is a true/false switch that enables the showing of links to articles. Values no, false and 0 are all false; anything else is true. Default is true.|rank=
. When set to "preferred", it returns only preferred values if present, otherwise returns all. When set to "normal", it returns only normal values if present, otherwise returns all. Any parameter value beginning with "p" is "preferred". Any parameter value beginning with "n" is "normal". Default is to return all ranks. This allows getValue to duplicate the functionality of getPreferredValue and getNormalValue which may now be deprecated.Here's an example of (1) all and (2) the preferred values of creator (P170) from Corisca and the Satyr (Q29016906):
{{wdib |P170 |qid=Q29016906 |fwd=ALL |osd=no}}
→
Artemisia Gentileschi,
Aniella di Beltrano,
Massimo Stanzione
{{wdib |P170 |qid=Q29016906 |fwd=ALL |osd=no |rank=p}}
→
Artemisia Gentileschi
The values and date qualifiers for what Geneva was the capital of:
{{wdib |P1376 |fwd=ALL |osd=no |qid=Q71 |qual=DATES}}
→
Canton of Geneva (1815–),
Léman (1798–1813), Republic of Geneva (1534–1798), Republic of Geneva (1813–1815)
{{wdib |P1376 |fwd=ALL |osd=no |qid=Q71 |qual=ALL |sep="; also " |qsep=" to "}}
→
Canton of Geneva (1815–); also
Léman (1798–1813); also Republic of Geneva (1534–1798); also Republic of Geneva (1813–1815)
-- RexxS ( talk) 18:34, 14 April 2018 (UTC)
Hello I was trying to use Wikidata coordinates in
sa:Template:Infobox settlement, but it's getting a lil confusing. I tried the Wikidata code used in {{
Infobox telescope}} but the
sa:Template:Infobox settlement has more than 1 requirement of |coordinates=
. Please help...
Capankajsmilyo (
talk) 09:18, 15 April 2018 (UTC)
@
RexxS: can you please make this module language independent. I mean as we give params like |suppressfield=
, etc, we give language code and output is in that particular language.
hi:Module:अंक परिवर्तन is not a good option to use when output of this module involves pencil and other extra text. And if possible, making the language selection automatic (via looking up which Wikipedia is it) would be an ideal solution.
Capankajsmilyo (
talk) 06:08, 16 April 2018 (UTC)
|name=
, so unless the string.find() function isn't coping with your character set, it should not matter what language you're in for those parameter values. Making a module completely language independent is a difficult task and it's not something I'm keen to try until I'm sure the code is completely stable, and given the major re-write I noted above, that may take some time to be certain of. In the meantime, I'm loathe to take the internationalisation out of the main module because it's simply not necessary. All of the available internationalisation is done in the first 85 lines, so adapting that to a local Wikipedia is the same job, regardless of whether it's in a separate module or not.|noicon=
or the code could be modified for rtl usage, but we'd need an example of what the desired output would be, rather than simply asserting it's "not a good option". As I don't speak Arabic or Hindi, etc. I have no idea of what a "good option" might look like.Hi, I'm struggling with some infobox at ptwiki and need some help in thinking in a solution. See pt:Monumento a Luiz Pereira Barreto. The field "Dimensões" has 4 values (2 for height and 2 for width), but one measure of each is for the sculpture and the remaining are for the pedestal. So, my question is, similar to getQualifierValue, where I can get the value of the qualifier when I know the value for the property, is it possible to make the other way? I mean getting the property value only if they have a "pqal" qualifier. Ping to RexxS because you are a god! Ederporto ( talk) 23:49, 18 April 2018 (UTC)