Property talk:P1630

From Wikidata
Jump to: navigation, search


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.
Description a URL-like string, such as "$1/", from which "$1" can be automatically replaced with the effective property value on items. For errors in proposals, see Category:Invalid formatter URL.
Data type String
According to statements in the property:
Wikidata property (Q18616576) and unique identifier (Q6545185)
When possible, data should only be stored as statements
Allowed values (https?:\/\/|steam:\/\/|info|urn|skype|tel)[\wè\d\-\.,\/\?=&:_%+#~;!А-яåЁё()@|\[\]\*{}]*\$1[\w\d\-\.,\/\?=&:_%+#~;!А-яåЁё()@|\[\](){}]*
Usage notes use in statements on properties
You may use 'wd' whenever some part of the URL is needed but can be randomly set without breaking the link.
Example VIAF ID (P214) →$1
Format and edit filter validation Abuse filter #73
Robot and gadget jobs AuthorityControl.js could use this property, instead of internal settings, to format a property value on items' pages
Tracking: differences no label (Q22162660)
See also third-party formatter URL (P3303), formatter URI of the RDF resources (P1921)
Proposal discussion Property proposal/Archive/27#P1630
Current uses 2,348
[create] Create a translatable help page (preferably in English) for this property to be included here
Type “Wikidata property (Q18616576), unique identifier (Q6545185): element must contain property “instance of (P31)” with classes “Wikidata property (Q18616576), unique identifier (Q6545185)” or their subclasses (defined using subclass of (P279)).
Exceptions are possible as rare values may exist. Known exceptions: Wikidata identifier (Q43649390)
List of this constraint violations: Database reports/Constraint violations/P1630#Type Q18616576, Q6545185, SPARQL
Format “(https?:\/\/|steam:\/\/|info|urn|skype|tel)[\wè\d\-\.,\/\?=&:_%+#~;!А-яåЁё()@|\[\]\*{}]*\$1[\w\d\-\.,\/\?=&:_%+#~;!А-яåЁё()@|\[\](){}]*”: value must be formatted using this pattern (PCRE syntax).
Exceptions are possible as rare values may exist.
List of this constraint violations: Database reports/Constraint violations/P1630#Format, SPARQL
Distinct values: this property likely contains a value that is different from all other items.
Exceptions are possible as rare values may exist.
List of this constraint violations: Database reports/Constraint violations/P1630#distinct values, SPARQL (every item), SPARQL (by value)

// protocol[edit]

Please do not use URLs like "//". Use "" 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)

Protocol relative URLs (//) are not a Wikimedia invention. They are defined in RFC 3986. --Fomafix (talk) 21:54, 25 December 2014 (UTC)
@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)
Section 4.2:
relative-ref  = relative-part [ "?" query ] [ "#" fragment ]
relative-part = "//" authority path-abempty
--Fomafix (talk) 07:40, 26 December 2014 (UTC)
@Ivan A. Krestinin: Why should protocol relative URLs not used? They are well standardized and supported. --Fomafix (talk) 22:42, 29 December 2014 (UTC)
You are right, this syntax is standardized. Some difficult cases: for example I have pages:

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

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)
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)
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)
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)
Protocol relative links are simpler than handling two separate links for HTTP and HTTPS. --Fomafix (talk) 17:20, 2 January 2015 (UTC)
Is there some applications that needs HTTP link? — Ivan A. Krestinin (talk) 17:24, 2 January 2015 (UTC)
If somebody cannot use HTTPS because of firewalls then keeping the current protocol improves the accessibility. --Fomafix (talk) 17:28, 2 January 2015 (UTC)
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)

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)


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)

I added them to the exceptions for now. --- Jura 12:06, 3 October 2015 (UTC)
(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)

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)

Qualifier used by (P1535) = AuthorityControl gadget (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)

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)

Distinct values constraint[edit]

This property has correctly the constraint "Distinct values". Recently two properties has been created with the same URL formatter: no label (P4767) and cinematografo name or company ID (P4768). This doesn't make sense for me and I think they should be merged. Indeed for the website 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)

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. ChristianKl❫ 13:23, 23 January 2018 (UTC)
  • It's possible to have the same formatter, but it might be a sign that we should have the same property. If the identifier are in the same numbers range, I think we should have just one. @ديفيد عادل وهبة خليل 2, ValterVB, Mahir256: who participated in its creation.
    --- Jura 13:39, 23 January 2018 (UTC)
  • Sure, I’ve no objections to merging the two. Guess we shouldn’t have overlooked the common formatter URL, but I leave to @ValterVB: if different ‘categoria’ values in itwiki’s ‘Cinematografo’ template cause the other fields within the template to be sufficiently different to warrant two Wikidata properties. Mahir256 (talk) 13:50, 23 January 2018 (UTC)
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)

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)

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)