User:Zache/P180fromCategory
Suggested depicts (P180) values for photos in this category: Turku (Q38511) , municipality of Finland (Q856076) , city (Q515)
Concept[edit]
The template is designed to try and derive suggested {{Q[P180}} values for images in a category by reading the wikidata items associated with those categories. The derived P180 values can then be used as proposed values for images in the category in a normalized way. Derived values can be used in conjunction with other methods, such as crowdsourcing, machine vision, and machine learning, to improve the accuracy of the final values used in photos.
In the proof-of-concept phase, the template will generate a hidden URL that can be read using SQL or an application programming interface (API).
- Errors
In case of incorrect values, the user can try to fix error values by adding a wikidata item to the category and defining instance of (P31) category's main topic (P301), {P|P971}} values or reporting the errors on the talk page.
Usage[edit]
{{User:Zache/P180fromCategory|pagetitle|namespace}}
Parameters[edit]
- {{{1|}}}
- target pagetitle, default value is current page
- {{{2|}}}
- target namespace, default value is current namespace if
{{{1}}}
is not defined. If{{{1}}}
is defined then default value iscategory
.
Example[edit]
{{User:Zache/P180fromCategory}}
- Without parameters
- Suggested depicts (P180) values for photos in this category:
- With pagetitle and namespace
{{User:Zache/P180fromCategory|Turku|0}}
- Suggested depicts (P180) values for photos in this category: city or town (Q7930989) , Turku (Q38511) , municipality of Finland (Q856076) , city (Q515)
- With pagetitle
{{User:Zache/P180fromCategory|Turku}}
- Suggested depicts (P180) values for photos in this category: Turku (Q38511) , municipality of Finland (Q856076) , city (Q515)
- Examples in pages
- Category:Salt Lake City 1999 Tornado
- Category: Views from Hemakuta temple hill complex
- Category:Bosses of Prieuré Saint-Arnoul de Crépy-en-Valois
- Category: Illustrations of Macroscelidea
- Category:Orthographic projections of Wenninger polyhedra (red, yellow, blue)
- Category:Sanborn Fire Insurance Map from Richmond, Wayne County, Indiana&
Logic[edit]
- Actual logic code is in module: Module:P180fromCategory
Reading data using SQL[edit]
SELECT
page_namespace,
page_id,
el_to
FROM
externallinks,
page
WHERE
page_id=el_from
AND page_namespace=2
AND page_title="Zache/P180fromCategory"
AND el_to LIKE "%#P%=Q%";