Documentation

formatter URL
web page URL; URI template from which "$1" can be automatically replaced with the effective property value on items. If the site goes offline, set it to deprecated rank. If the formatter URL changes, add a new statement with preferred rank.
Descriptiona URL-like string, such as "http://viaf.org/viaf/$1/", from which "$1" can be automatically replaced with the effective property value on items. For errors in proposals, see Category:Invalid formatter URL.
RepresentsURL (Q42253), URL format string (Q114728334)
Data typeString
Domain When possible, data should only be stored as statements
Allowed values.+:.*\$1.*|.+:.+|(https?://|info|irc|skype|spotify|steam://|tel|urn)[!-~ЁäåèëöА-я]*\$[1-9][!-~ЁäåèëöА-я]*
Usage notesuse in statements on properties to generate links for external-identifiers and string properties;
ExampleWikidata (Q2013) → https://www.wikidata.org/wiki/$1
English Wikipedia (Q328) → https://en.wikipedia.org/wiki/$1
VIAF ID (P214) → https://viaf.org/viaf/$1
IMDb ID (P345) → https://wikidata-externalid-url.toolforge.org/?p=345&url_prefix=https://www.imdb.com/&id=$1
DOI (P356) → https://dx.doi.org/$1
Internet Content Provider Registration Record ID (P7477) → http://icp.chinaz.com/$1
Format and edit filter validationAbuse filter #73
Robot and gadget jobsAuthorityControl.js could use this property, instead of internal settings, to format a property value on items' pages
Tracking: differencesCategory:Maintenance:URL formatting differs from Wikidata (Q22162660)
Tracking: usageCategory:Pages using Wikidata property P1630 (Q98131439)
See alsomobile formatter URL (P7250), URN formatter (P7470), ARK formatter (P8054), applies if regular expression matches (P8460), third-party formatter URL (P3303), formatter URI for RDF resource (P1921), URL match pattern (P8966), source website for the property (P1896)
Lists
Proposal discussionProposal discussion
Current uses
Total12,067
Main statement11,40294.5% of uses
Qualifier6535.4% of uses
Reference12<0.1% of uses
Search for values
[create Create a translatable help page (preferably in English) for this property to be included here]
Type “Wikidata property for an identifier (Q19847637), unique identifier (Q6545185), Wikimedia template (Q11266439), Wikidata property to indicate a location (Q18615777), Wikidata property with datatype string that is not an external identifier (Q21099935), query (Q3428776), markup language (Q37045), Wikidata property for linking to a representative image (Q26940804), Wikidata property to link to Commons (Q18610173): item must contain property “instance of (P31)” with classes “Wikidata property for an identifier (Q19847637), unique identifier (Q6545185), Wikimedia template (Q11266439), Wikidata property to indicate a location (Q18615777), Wikidata property with datatype string that is not an external identifier (Q21099935), query (Q3428776), markup language (Q37045), Wikidata property for linking to a representative image (Q26940804), Wikidata property to link to Commons (Q18610173)” or their subclasses (defined using subclass of (P279)). (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P1630#Type Q19847637, Q6545185, Q11266439, Q18615777, Q21099935, Q3428776, Q37045, Q26940804, Q18610173, SPARQL
Format “.+:.*\$1.*|: value must be formatted using this pattern (PCRE syntax). (Help)
List of violations of this constraint: Database reports/Constraint violations/P1630#Format, hourly updated report, SPARQL
Format “.+:.+|: value must be formatted using this pattern (PCRE syntax). (Help)
List of violations of this constraint: Database reports/Constraint violations/P1630#Format, hourly updated report, SPARQL
Format “(https?://|info|irc|skype|spotify|steam://|tel|urn)[!-~ЁäåèëöА-я]*\$[1-9][!-~ЁäåèëöА-я]*: value must be formatted using this pattern (PCRE syntax). (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P1630#Format, SPARQL
Allowed entity types are Wikibase item (Q29934200), Wikibase property (Q29934218): the property may only be used on a certain entity type (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P1630#Entity types
Scope is as main value (Q54828448), as qualifier (Q54828449): the property must be used by specified way only (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P1630#Scope, SPARQL
Single best value: this property generally contains a single value. If there are several, one would have preferred rank (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P1630#single best value, SPARQL
Required qualifier “language of work or name (P407): this property should be used with the listed qualifier. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P1630#mandatory qualifier, SPARQL
 
Items that use "wd" in formatter URLs should have URL match pattern
wd in formatter URLs is commonly used to indicate arbitrary values. To allow backward conversion from such URLs into identifiers (for tools like Entity Explosion (Q98398855)), property also should have a hand-crafted URL match pattern (P8966). (Help)
Violations query: SELECT ?item WHERE { ?item a wikibase:Property ; wdt:P1630 ?formatter . FILTER(REGEX(?formatter, "https:\\/\\/[^\\/]+\\/.*\\bwd\\b")) . FILTER NOT EXISTS { ?item wdt:P8966 [] } }
List of this constraint violations: Database reports/Complex constraint violations/P1630#Items that use "wd" in formatter URLs should have URL match pattern

// protocol edit

Please do not use URLs like "//www.freebase.com". Use "https://www.freebase.com" instead. "//" is Wikimedia`s invention as I know. But this property will be used by external users too. This strange construction will confuse these users. Wikidata usage must not be thorny path. — Ivan A. Krestinin (talk) 21:09, 25 December 2014 (UTC)Reply

Protocol relative URLs (//) are not a Wikimedia invention. They are defined in RFC 3986. --Fomafix (talk) 21:54, 25 December 2014 (UTC)Reply
@Fomafix: Interesting standard, but a bit cryptic: it states "If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character. If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//"). In addition, a URI reference (Section 4.1) may be a relative-path reference, in which case the first path segment cannot contain a colon (":") character." This does not suggests that relative paths may begin with two slashes; other sections about relative references (section 5.1) also do not show a path starting with two slashes either. Can you quote a piece of that text clarifying such syntax? -- LaddΩ chat ;) 22:50, 25 December 2014 (UTC)Reply
Section 4.2:
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
relative-part = "//" authority path-abempty
--Fomafix (talk) 07:40, 26 December 2014 (UTC)Reply
@Ivan A. Krestinin: Why should protocol relative URLs not used? They are well standardized and supported. --Fomafix (talk) 22:42, 29 December 2014 (UTC)Reply
You are right, this syntax is standardized. Some difficult cases: for example I have pages:
file://my_server/my_page.html
ftp://my_server/my_page.html

Links like '//www.freebase.com' will resolved to 'file://www.freebase.com' and 'ftp://www.freebase.com'. — Ivan A. Krestinin (talk) 06:45, 2 January 2015 (UTC)Reply

Wikidata is only accessible via HTTP and HTTPs. Protocol relative links only reference these two protocols. Where do you see this problem? --Fomafix (talk) 10:28, 2 January 2015 (UTC)Reply
Wikidata is open project. Data can be accessible using any protocol via third-party data clients. — Ivan A. Krestinin (talk) 10:35, 2 January 2015 (UTC)Reply
Is this a real problem or a theoretical problem? The values from P1630 are not usable directly. They have to converted with the value of the wanted property. This convertation can also add the wanted protocol HTTP or HTTPS. --Fomafix (talk) 11:34, 2 January 2015 (UTC)Reply
I meet this issue for locally saved reports of my bot. Conversation can be included to processing algorithms. But it must be included to the most algorithms. E. g. increasing data model complexity causes growing processing algorithms complexity. I think data model must be as simple as it possible. This makes data usage more simple. More simple usage — more clients count. — Ivan A. Krestinin (talk) 16:38, 2 January 2015 (UTC)Reply
Protocol relative links are simpler than handling two separate links for HTTP and HTTPS. --Fomafix (talk) 17:20, 2 January 2015 (UTC)Reply
Is there some applications that needs HTTP link? — Ivan A. Krestinin (talk) 17:24, 2 January 2015 (UTC)Reply
If somebody cannot use HTTPS because of firewalls then keeping the current protocol improves the accessibility. --Fomafix (talk) 17:28, 2 January 2015 (UTC)Reply
HTTPS is used by too many Internet resources. HTTPS blocking was possible some years ago. But not now as I think. — Ivan A. Krestinin (talk) 17:42, 2 January 2015 (UTC)Reply

Handling of qualifiers edit

I noticed that the properties examples given for P1900 do not show proper URL formatting and thus played around with it in the sandbox, which suggests that the formatting works fine for statements but not qualifiers. Don't know how to fix that. --Daniel Mietchen (talk) 12:00, 14 July 2015 (UTC)Reply

$ edit

The current format pattern doesn't allow to have $ besides $1. Is there a reason for this? And what should we do with the formatter URL's on ZVG number (P679) and HSDB ID (P2062) which have $ in the URL. --Pasleim (talk) 11:54, 28 September 2015 (UTC)Reply

I added them to the exceptions for now. --- Jura 12:06, 3 October 2015 (UTC)Reply
(Hijacking an old thread) Eventually one probably have to reimplement the functionality in the lines of RFC 6570 - URI Template]. -- Gymel (talk) 10:54, 2 April 2016 (UTC)Reply

https or http edit

There is some discussion at Property talk:P214 about whether to use http (suggested by some users) or https (preferred by WMF). --- Jura 09:52, 13 December 2015 (UTC)Reply


Qualifier used by (P1535) = Q22348290 edit

For formatter URL that have special code in MediaWiki:Gadget-AuthorityControl.js, I added the above to the statements.
--- Jura 10:56, 1 February 2016 (UTC)Reply

Dofollow links to proprietary and for-profit targets edit

I discovered today that Wikidata identifier links don't respect nofollow configuration. I wonder if users knew this when they set certain IDs to link for-profit, proprietary websites. --Nemo 06:01, 7 September 2017 (UTC)Reply

Distinct values constraint edit

This property has correctly the constraint "Distinct values". Recently two properties has been created with the same URL formatter: P4767 (P4767) and cinematografo.it name or company ID (P4768). This doesn't make sense for me and I think they should be merged. Indeed for the website www.cinematografo.it there is no way for representing a company and a person with the same ID, instead we can, allowing P4767 and P4768 in the same item, that it's wrong. --Rotpunkt (talk) 13:02, 23 January 2018 (UTC)Reply

It's a nonmandatory constraint. We use nonmandatory constrains when most of the values are expected to not violate the constraint. We use mandatory constraints when we don't want any value to be entered that violates the constraint. ChristianKl13:23, 23 January 2018 (UTC)Reply
I based my request of creation of property on the content of the template page in Italian wiki that don't reflect the site, when @Rotpunkt: warned me, I thought I still had some time, but property was created this morning so it's too late. Now if none has problem we can deprecate P4767 and use only P4768 for name and company. (@ديفيد عادل وهبة خليل 2, Jura1, Mahir256:) --ValterVB (talk) 19:03, 23 January 2018 (UTC)Reply

Using from within WDQS edit

A rather nice code fragment from User:Multichill for using this within a WDQS query:

?item wdt:Pnnn ?value .
  wd:Pnnn wdt:P1630 ?fmt .
  BIND(IRI(REPLACE(?value,  CONCAT('(',?value,')'), ?fmt)) AS ?url) .
Try it!

Jheald (talk) 13:10, 19 February 2018 (UTC)Reply

Or, alternatively, a slightly more straightforward approach:
?item wdt:Pnnn ?value .
  wd:Pnnn wdt:P1630 ?fmt .
  BIND(IRI(REPLACE(?fmt, '\\$1'  , ?value)) AS ?url) .
Try it!
Jheald (talk) 13:14, 19 February 2018 (UTC)Reply
Or, alternatively again:
?item wdt:Pnnn ?id .
  wd:Pnnn wdt:P1630 ?fmt .
  BIND(IRI(REPLACE(?id, '(^.*)', ?fmt)) AS ?url) .
Try it!
Jheald (talk) 17:23, 29 October 2019 (UTC)Reply

Removing advice on use of wd in URLs edit

After a short discussion, User:Thierry Caro added the following advice to this property: "You may use 'wd' whenever some part of the URL is needed but can be randomly set without breaking the link.".

Elsewhere it's been pointed out that this is possibly harmful from a privacy POV; it in effect stamps URLs as 'from wikidata', for no obviously good reason, and frustrates the intentions of users whose user agents do not send an HTTP referer ID.

I'd like us to change the advice such that we use a more neutral string. I appreciate the whole issue is somewhat marginal, but still... --Tagishsimon (talk) 16:35, 29 April 2018 (UTC)Reply

Does Wikidata have a policy for affiliate, tracking, or referral links? Would it be useful for companies and organizations to know users are coming from Wikidata? Should we add ?utm_source=wikidata so Google Analytics and Piwik can attribute us as the referral source? This might make organizations more willing to partner with us. —Dispenser (talk) 10:48, 2 May 2018 (UTC)Reply
I'm sure it would be useful for companies. Would it be useful for users? I hear facebook is hiring, Dispenser. --Tagishsimon (talk) 13:16, 2 May 2018 (UTC)Reply

Varying URL edit

The National Academy of Sciences helpfully changes the URLs for deceased members, without leaving a redirect. E.g., Carl Woese (Q310067) is at http://www.nasonline.org/member-directory/deceased-members/8899.html, but the formatter on National Academy of Sciences member ID (P5380) goes to http://www.nasonline.org/member-directory/members/8899.html. I assume there's no way to fix it, short of changing all the identifiers to something like "deceased-members/8899"? Ghouston (talk) 05:18, 14 August 2018 (UTC)Reply

This property was only recently added, so there aren't actually many values to change, but it wouldn't look right. Ghouston (talk) 05:23, 14 August 2018 (UTC)Reply
I changed the formatter URL into a search on their website instead. Ghouston (talk) 01:39, 18 August 2018 (UTC)Reply

Alternative URL's based on regex match edit

I noticed that in cases where a property has multiple formatter URL's based on a regex match, the selection doesn't actually work.

E.g. in ISIL (P791), the first alternative in the list is for DE-.*, and it works correctly (German Music Archive (Q27901)). But as far I can see, the other alternatives don't actually format the URL if there's a match, e.g. US-.* in Library of Congress (Q131454), JP-.* in Noboribetsushiritsu Library Anisubunkan (Q61901152) or IT-.* in Biblioteca Gaetano Badii (Q3639588). How is it supposed to work? --Alicia Fagerving (WMSE) (talk) 12:18, 27 June 2019 (UTC)Reply

Escaping special characters edit

99% Invisible (Q16001236) has a Commons category (P373) of "99% Invisible", which produces this broken URL: https://commons.wikimedia.org/wiki/Category:99%%20Invisible. The correct URL is https://commons.wikimedia.org/wiki/Category:99%25%20Invisible, i.e. with % escaped to %25.

This URL would work, however: https://commons.wikimedia.org/w/index.php?action=view&title=Category:99%%20Invisible — with the exact same string as a query parameter instead of a path segment.

Should the formatter URL of commons category be changed (since it works in this particular case)? Or does formatter URL need to learn how to provide url-safe variants of $1? --jleedev (talk) 20:54, 18 September 2019 (UTC)Reply

I'd say the % character should be escaped when converting to a URL, and this would affect other properties besides P373. Ghouston (talk) 02:46, 19 September 2019 (UTC)Reply
Some characters are now escaped; as a result the formatter for Heritage Gateway ID (P8169) doesn't work. Peter James (talk) 21:45, 2 July 2020 (UTC)Reply
I would suggest that maybe we should be able to define a substitution for a given use of P1630 (perhaps using regex), that way we can fix a specific URL, for example for P8966 the [+] needs to be replaced with %2b for it to work on the destination site Back ache (talk) 08:59, 4 October 2021 (UTC)Reply

How to add the formatter URL if two different language versions have different url? edit

How to add the formatter URL If two languages have different URLs and both are the main sources. Should only one must been added to the property formatter URL. Can anyone check on this property GRY-Online company ID (P7997)-❙❚❚❙❙ JinOy ❚❙❚❙❙ 07:09, 20 March 2020 (UTC)Reply

Same problem for the Canadian Encyclopedia : Property:P5395#P1630. Can the URL format can be automatically selected with the qualifier P407 added to a particular id? As here: Q4671432#P5395. Simon Villeneuve (talk) 12:52, 24 September 2023 (UTC)Reply

Escaping spaces to _ instead of + edit

Property:P2000 was originally defined as data type String, and was recently changed to data type External identifier. With that change, the formatter URL is no longer working, because now it converts any space in the parameter $1 into a + sign instead of an underscore (or a space, %20). How can I fix this? —capmo (talk) 15:25, 23 March 2020 (UTC)Reply

Yes, I think the '+' escape can be used in forms, but not always in URLs, where %20 is correct. I suppose it's under the control of software and needs to be raised on Phabricator. Ghouston (talk) 21:19, 23 March 2020 (UTC)Reply
It's mentioned in phabricator:T160281. Ghouston (talk) 21:27, 23 March 2020 (UTC)Reply
Hi, thanks for the phabricator link, and for reporting this issue there! Until we have a definitive solution, I'll resort to using the wmflabs tool wikidata-externalid-url, as suggested in that thread. —capmo (talk) 14:02, 25 March 2020 (UTC)Reply

Phab: Replace https://tools.wmflabs.org/wikidata-externalid-url by providing improved handling for external id formatter urls (November 2016) edit

See phab:T150939 --- Jura 07:49, 1 October 2020 (UTC)Reply

Phab: URL-encoding of external-id values in Wikidata frontend breaks (some) links (March 2017) edit

See phab:T160281 --- Jura 07:49, 1 October 2020 (UTC)Reply

Phab: Allow own Wikidata ID to be used inside the Formatter URL (March 2019) edit

See phab:T218749 --- Jura 07:49, 1 October 2020 (UTC)Reply

Phab: Support multilingual formatter url on Wikidata (August 2020) edit

See phab:T259801 --- Jura 07:49, 1 October 2020 (UTC)Reply

External identifier with two parameters edit

Hi, could i create external identifier which has two parameters? We are created Kramerius of Moravian Library UUID (P8752), but only for one digital library. In the Czech Republic we have more digital libraries with same identifier style. Some in same url of https://www.digitalniknihovna.cz/$2, where $2 is digital library code. Some on different URLs. And result with one external identifier (with UUID of scan and code of library) will be helpfull, but i don't know how to do. Skim (talk) 15:50, 29 October 2020 (UTC)Reply

I don't think that this is possible directly, since the link is created by passing a single statement value to the formatter, substituting $1. The Usual alternative would be to create a separate property for each digital library. There's another method which could be used in theory, which is to use a property value which combines all of the information (library id and item id), and with a url formatter which goes to a custom service on Toolforge which would redirect to the right location. Ghouston (talk) 23:03, 29 October 2020 (UTC)Reply

"Should have search formatter URL" constraint violations edit

Should this really be a constraint? There are a myriad of different sites that have formatter URLs without search formatter URLs. Enforcing this as a constraint seems a bit much. Elliot321 (talk) 01:17, 10 February 2021 (UTC)Reply

Qualifier for redirects edit

For my application I need a way to distinguish between formatter urls that only a resolve an ID using a redirect and the ones that directly link to the correct url. I therefore propose to use the qualifier:

 has characteristic (P1552)URL redirection (Q1236807)

as in Fandom article ID. Do you have a better Idea? --Shisma (talk) 12:02, 7 March 2021 (UTC)Reply

Qualifier for archive urls edit

For my application I need a way to distinguish between formatter urls that only a resolve an ID to an archived version of website and a regular website. I therefore propose to use the qualifier:

 has characteristic (P1552)archive URL (Q105809893)

as in Mixer game ID. Do you have a better Idea? --Shisma (talk) 12:02, 7 March 2021 (UTC)Reply

Scope edit

This property is currently only allowed for other properties. But there are cases when an element of an external DB acts as a property value, and a key value in this base acts as a qualifier. The most obvious examples: stock exchange (P414)/ticker symbol (P249) and website account on (P553)/website username or ID (P554). In such cases, it would be much more convenient to have the formatter in the items. It definitely can be done in the property with a qualifier like applies to part (P518), but the lists of such values ​​are potentially not limited, so this can create inconvenience. I propose to extend the scope to some classes of items: database (Q8513), exchange (Q179076), social networking service (Q3220391), etc. —putnik 12:13, 20 March 2021 (UTC)Reply

Formatter URL cached edit

Lucas Werkmeister indicated on Telegram that "IIRC the formatter URL of a property is cached for up to 24 hours, and then after that all the item pages using the property also need to be purged (or edited)".

Alternatively you can use the script https://github.com/generalist/wikidata-misc, but to use this you need to wait 24 hours after updating the formatter URL in the property. Romaine (talk) 17:49, 28 November 2021 (UTC)Reply

Software resource for formatter URL edit

I'm proposing to add software resource (Q110832782) as a valid type for this property. This would allow items like Instagram post (Q84497003) to have formatter URLs like https://www.instagram.com/p/$1/. This would need to be a subclass constraint instead of an instance constraint. AntisocialRyan (Talk) 13:10, 21 April 2022 (UTC)Reply

Name change edit

Should this not be called "URL formatter", as it formats the URL? If it was a formatter URL, it would be a URL itself, which it specifically isn't. Same for the other properties like search formatter URL (P4354). -wd-Ryan (Talk/Edits) 03:30, 7 December 2022 (UTC)Reply

@Push-f: Thoughts on this? You're good at semantics -wd-Ryan (Talk/Edits) 20:21, 11 December 2022 (UTC)Reply
Thanks for bringing this up ... I had previously also noticed the awkward wording but couldn't be bothered to start a discussion about this.
I agree with your observation that the order in "formatter URL" is wrong. However I would also argue that "formatter" doesn't belong into the label at all.
Wiktionary defines formatter as:

One who or that which formats.

formatter URL (P1630) is a property ... a property doesn't do anything: a property gets used but it does not perform any actions (like formatting) since it has no agency.
So I would suggest the property to be relabeled to "URL format string" (or probably rather "URL format" for short).
"format string" is an established term, defined by wiktionary as:

A string of text characters serving as a template for other strings, such as dd/MM/yyyy for a date.

which I think fits perfectly. (Sidenote we even have format string (Q3748135) because the Italian Wikipedia has an article about format strings).
Cheers, --Push-f (talk) 20:39, 11 December 2022 (UTC)Reply
I agree with "URL format string" because it is similar to what we're used to. Another option would be like "URL template string".
Also, I recently made format string (Q114771387), should it be merged with format string (Q3748135)? -wd-Ryan (Talk/Edits) 20:41, 11 December 2022 (UTC)Reply
Yes I just merged it. I think "URL format" would suffice: I don't think including the datatype in the label is necessary since we don't have any other "URL format" properties of other datatypes.
--Push-f (talk) 20:44, 11 December 2022 (UTC)Reply
There's also this item URL format string (Q114728334). If we change the property name it should be updated as well. -wd-Ryan (Talk/Edits) 20:46, 11 December 2022 (UTC)Reply
I just updated that item. Sidenote: I don't think that we should create a same-named item for every URL format string property we have ... I think instead we should create the items for the URLs that are the result of the string formatting, e.g:
So URL format string (Q114728334) would end up being linked to all of our URL format string properties, which I think makes the most sense.
--Push-f (talk) 21:09, 11 December 2022 (UTC)Reply
"URL format" sounds a bit ambiguous to me, I think either "URL format string" or "URL formatter" would be best. -wd-Ryan (Talk/Edits) 20:49, 11 December 2022 (UTC)Reply
"URL formatter" is wrong semantically as I explained.
You do however have a point that "URL format" is ambiguous ... I didn't consider that but you might be tempted to qualify url formatclean URL (Q6451799) (we don't have such a property yet but it's not unthinkable).
So yes with that in mind I agree that "URL format string" would be best.
--Push-f (talk) 20:53, 11 December 2022 (UTC)Reply
Alright nice, we agree but its a lot to rename (Items and Properties) so I'll wait for somebody else's opinion. Thanks! -wd-Ryan (Talk/Edits) 23:51, 11 December 2022 (UTC)Reply

Separators added edit

I have added applies if regular expression matches (P8460) and language of work or name (P407) as separators to the single best-value constraint, because sometimes the value of a property, as well as the language being used, can change the URL format outside the actual property value as embedded in the URL, even if only slightly. This applies in Statistics Canada Geographic code (P3012), because the length of a code does just that, and no geography type is "preferred" over any other:

Geography type Example P3012 value URL (P3012 value in bold type) Applicable P3012 regex
province or territory of Canada (Q2879) Ontario (Q1904) 35 https://www12.statcan.gc.ca/census-recensement/2021/dp-pd/prof/details/page.cfm?Lang=E&DGUIDlist=2021A000235 ^(1[0-3]|24|35|4[6-8]|59|6[0-2])$
census division of Canada (Q18810091) Ottawa (Q1930) 3506 https://www12.statcan.gc.ca/census-recensement/2021/dp-pd/prof/details/page.cfm?Lang=E&DGUIDlist=2021A00033506 ^(1[0-3]|24|35|4[6-8]|59|6[0-2])\d{2}$
federal electoral district of Canada (Q17202187) Ottawa Centre (Q3357743) 35075 https://www12.statcan.gc.ca/census-recensement/2021/dp-pd/prof/details/page.cfm?Lang=E&DGUIDlist=2013A000435075 ^(1[0-3]|24|35|4[6-8]|59|6[0-2])\d{3}$
designated place of Canada (Q956318) Chalk River (Q5068811) 350066 https://www12.statcan.gc.ca/census-recensement/2021/dp-pd/prof/details/page.cfm?Lang=E&DGUIDlist=2021A0006350066 ^(1[0-3]|24|35|4[6-8]|59|6[0-2])\d{4}$
census subdivision (Q17457753) Ottawa (Q1930) 3506008 https://www12.statcan.gc.ca/census-recensement/2021/dp-pd/prof/details/page.cfm?Lang=E&DGUIDlist=2021A00053506008 ^(1[0-3]|24|35|4[6-8]|59|6[0-2])\d{5}$

And if a French-speaking user accesses this, then "Lang=E" in the URL would be expected to be replaced by "Lang=F", and neither language is "preferred" over the other in general. By specifying a regex and noting what language in which the user wants to access the URL, the URL format can be reliably selected. - Denelson83 (talk) 08:12, 5 January 2023 (UTC)Reply

Two-part question for aircraft registration (P426) edit

Hello! For aircraft registration (P426), I updated the FAA URL as the old one no longer functions, but the update doesn't seem to be propagating. Is there something else I should be doing to make the new URL work?

As for the UK Civil Aviation Authority URL, it too no longer points to a functioning URL. The new search page is at https://www.caa.co.uk/aircraft-register/g-info/search-g-info/, but I have no idea how to determine what parameter(s) need to be passed for it to work. I was hoping someone might have a suggestion.

Thanks! Huntster (t @ c) 23:25, 6 January 2023 (UTC)Reply

@Huntster: applies if regular expression matches (P8460) is not recognized by the Wikidata UI so it wouldn't do anything automatically - on the other hand aircraft registration (P426) has string datatype (not external-id) so the Wikidata UI also won't automatically apply a formatter URL for it. So I don't believe this would ever have worked, unless it's with some gadget that's not part of the standard UI. ArthurPSmith (talk) 16:49, 9 January 2023 (UTC)Reply
@ArthurPSmith: So how is it being recognized when used in items like NASA 905 (Q116082679) or N103US (Q21043167)? Regardless, it does work, so why would the URL not be updating on item pages? Huntster (t @ c) 17:37, 9 January 2023 (UTC)Reply
@Huntster: doesn't work for me, there's no link that I see on the P426 values. You probably have the AuthorityControl gadget enabled, which does this all with javascript somehow. I don't think it looks at P1630 values. ArthurPSmith (talk) 17:56, 9 January 2023 (UTC)Reply
@ArthurPSmith: Thank you for explaining that. You are correct, it is AuthorityControl. It's pretty incredible the added value that that one tool adds to the user experience, so much so that I forgot what the default experience was like. I see where the problem lies now.
Any ideas on the second part of the question, by chance? Huntster (t @ c) 21:59, 9 January 2023 (UTC)Reply

Using Wikidata label as parameter edit

I guess the answer is no but, is there any way for using an element label when creating the URL? I think could be useful in cases where the only alternative in the destination website is through their web search feature. —Ismael Olea (talk) 10:39, 20 July 2023 (UTC)Reply

Return to "P1630" page.