Template:SDC statement has value
Template documentation​view · edit · history ·purge ]
This documentation is transcluded from Template:SDC statement has value/doc.
Uses Lua:
Template for adding tracking categories based on SDC statements. It tests if SDC "property" is used in a statement and if the value matches "value"; if so then "matching_category" is added, if a different value is used then "mismatching_category" is added, and if the statement does not exist than "missing_category" is added. It should by used by other templates to verify if the expected SDC statement exists.
Usage
{{SDC_statement_has_value
 |property             =
 |value                =
 |matching_category    =
 |mismatching_category =
 |missing_category     =
}}
Template parameters
ParameterDescriptionDefaultStatus
propertyproperty IDProperty ID to be tested: "P7482" for source of file (P7482), or "P170" for creator (P170)emptyrequired
valuevalueValue which should be used in the statement using "property", can a Wikidata item ID or a stringemptyrequired
matching_categorymatching categoryCategory name (without "Category:" prefix) to add if an SDC statement with "property" exists and any of its values matches "value"emptyoptional
mismatching_categorymismatching categoryCategory name (without "Category:" prefix) to add if an SDC statement with "property" exists and none of its values match "value"emptyoptional
missing_categorymissing categoryCategory name (without "Category:" prefix) to add if no SDC statement using "property" existsemptyoptional
 Parameter text is empty
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData
TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.
Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template.
‎<nowiki>
-tags can be wrapped around the arguments, if required, to avoid templates being expanded.
Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw
‎<templatedata>
-tags into the Wikitext of the template, as described in various Wikipediae.
Template for adding tracking categories based on Structured data for Commons (SDC) statements. It tests if SDC "property" is used in a statement and if the value matches "value"; if so then "matching_category" is added, if a different value is used then "mismatching_category" is added, and if the statement does not exist than "missing_category" is added. It should by used by other templates to verify if the expected SDC statement exists.
Template parameters
This template prefers block formatting of parameters.
ParameterDescriptionTypeStatus
matching categorymatching_categoryCategory name (without "Category:" prefix) to add if an SDC statement with "property" exists and any of its values matches "value"Page nameoptional
mismatching categorymismatching_categoryCategory name (without "Category:" prefix) to add if an SDC statement with "property" exists and none of its values match "value"Page nameoptional
missing categorymissing_categoryCategory name (without "Category:" prefix) to add if no SDC statement using "property" existsPage nameoptional
property IDpropertyProperty ID to be tested, like "P7482" or "P170"Linerequired
valuevalueValue which should be used in the statement using "property", can a Wikidata item ID or a stringStringrequired
Additional information
The template is intended to be used in the following namespaces: the Template namespace
The template is intended to be used by the following user groups: no user group specified
Relies on:
Module:SDC tracking
See also
{{SDC statement exist}}
Last edited on 13 August 2020, at 02:27
Wikimedia Commons
Files are available under licenses specified on their description page. All structured data from the file namespace is available under the Creative Commons CC0 License; all unstructured text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and the Privacy Policy.
Privacy policy
Terms of Use
Desktop
HomeRandom Nearby Log in Settings DonateAbout Wikimedia CommonsDisclaimers
LanguageWatchEdit