Commons:Datos máquina-legibles

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
This page is a translated version of a page Commons:Machine-readable data and the translation is 78% complete. Changes to the translation template, respectively the source language can be submitted through Commons:Machine-readable data and have to be approved by a translation administrator.

Shortcut: COM:MRD

Other languages:
Deutsch • ‎English • ‎Esperanto • ‎dansk • ‎español • ‎français • ‎italiano • ‎magyar • ‎polski • ‎português • ‎македонски • ‎русский • ‎українська • ‎العربية • ‎中文 • ‎日本語

On Wikimedia Commons, a lot of metadata (including license and author) are not machine readable. There is an API module, iiprop=extmetadata which can be used to retrieve some values (example), but as the information is entered as free text into the file description page itself, this is not perfect. There are plans to move the metadata into the database[1], but this will not happen soon.

To make up for this and to ease a transition towards more structured data at a future time, Wikimedia Commons use a set of standard templates which have been made machine-readable in some ways, through HTML elements. Some scripts already make use of that. It is worth noting that this data is available for any wiki using Wikimedia Commons, where it can be read from the html of the File: page just as other local data.

Máquina de datos legibles

Datos de lectura mecánica establecido por Ficha de plantillas

Estos son estándar y varias ficha de plantillas etiquetada en distintos elementos de plantilla con diversas etiquetas para permitir el análisis sintáctico de la información. Se utilizan varios estilos diferentes de etiquetas:

  • Microformatos las etiquetas siguen estándares de la industria y se pueden analizar por herramientas ya existentes
  • <td> atributos id (identificadores) son marcas personalizadas que permiten etiquetas más completas, cuando tienen que ser leídas por las herramientas personalizadas. Muchos de la mayoría de los infoboxes universales tienen dos columnas estructura: Columna #1 tiene el nombre del campo y la columna #2 contiene el valor
    • Tradicionalmente <td> los atributos id se utilizaron para etiquetar la llamada del nombre de la primera columna en una fila. Para obtener los datos, usted tendría la siguiente <td> célula en la segunda columna.
    • {{Creator}} and {{Institution}} templates have more complicated structure, so the cells with the actual data are tagged with attributes using magenta background.
Plantilla Nombre del parámetro de la plantilla Descripción <td> id atributo Microformato Comentario
{{Information}} description Descripción del archivo fileinfotpl_desc hProduct.description. Often contains multiple languages annotated with {{lang}}.
{{Information}} date fecha original de creación de la obra fileinfotpl_date hCalendar vevent.dtstart Sometimes additionally, or only, contains publication date. These two dates have different meanings for copyright. When used {{Date context}} can indicate the difference.microformato añadido por la plantilla {{date}}
{{Information}} source fuente del archivo fileinfotpl_src Often contains entire tables. We have no good way to deal with this source templates yet. Source templates often have references to catalogue IDs, but these are also not machine readable.
{{Information}} author autor del archivo fileinfotpl_aut This can be author, creator and/or copyright holder and is used mixed. Often contains the {{Creator}} template which is described below.
{{Information}} permission permiso/licencia para el archivo fileinfotpl_perm
{{Information}} other versions otras versiones del archivo fileinfotpl_ver
{{Artwork}} description descripción de la obra de arte fileinfotpl_desc hProduct.description
{{Artwork}} date fecha original de creación de la obra de arte fileinfotpl_date hCalendar vevent.dtstart microformat added by {{date}} template
{{Artwork}} source fuente del archivo fileinfotpl_src
{{Artwork}} artist creador de la obra de arte fileinfotpl_aut "hProduct.fn value"
{{Artwork}} author autor de la obra de arte fileinfotpl_aut "hProduct.fn value"
{{Artwork}} permission permiso/licencia para el archivo y la obra de arte fileinfotpl_perm
{{Artwork}} other versions otras versiones del archivo fileinfotpl_ver
{{Artwork}} title título de la obra de arte fileinfotpl_art_title hProduct.fn
{{Artwork}} object type tipo de objeto de la obra de arte fileinfotpl_art_object_type
{{Artwork}} medium técnica o medio de la obra de arte fileinfotpl_art_medium
{{Artwork}} dimensions dimensiones de la obra de arte fileinfotpl_art_dimensions
{{Artwork}} gallery institución que hospeda la obra de arte fileinfotpl_art_gallery
{{Artwork}} location ubicación de la obra de arte dentro de la institución fileinfotpl_art_location hProduct.locality
{{Artwork}} accession number número de accesión de la obra de arte fileinfotpl_art_id hProduct.identifier
{{Artwork}} object history objeto histórico de la obra de arte fileinfotpl_art_object_history
{{Artwork}} exhibition history historial de exhibición de la obra de arte fileinfotpl_art_exhibition_history
{{Artwork}} credit line línea de crédito de la obra de arte fileinfotpl_art_credit_line
{{Artwork}} inscriptions inscripciones de la obra de arte fileinfotpl_art_inscriptions
{{Artwork}} notes notas acerca de la obra de arte fileinfotpl_art_notes
{{Artwork}} references referencias relacionadas a la obra de arte fileinfotpl_art_references
{{Book}} Author autor del libro fileinfotpl_author
{{Book}} Editor editor del libro fileinfotpl_book_editor
{{Book}} Translator traductor del libro fileinfotpl_book_translator
{{Book}} Illustrator ilustrador del libro fileinfotpl_book_illustrator
{{Book}} Title título del libro fileinfotpl_book_title
{{Book}} Subtitle subtítulo del libro fileinfotpl_book_subtitle
{{Book}} Series title título de la serie del libro fileinfotpl_book_series-title
{{Book}} Authority control dato del control de autoridad fileinfotpl_book_authority
{{Book}} Publisher editor del libro fileinfotpl_book_publisher
{{Book}} Printer ilustrador del libro fileinfotpl_book_printer
{{Book}} Year of publication fecha o año de la plublicación del libro fileinfotpl_date
{{Book}} Place of publication sitio o ciudad de la publicación del libro fileinfotpl_book_place-of-publication
{{Book}} Language idioma del libro fileinfotpl_book_language
{{Book}} Description descripción del libro fileinfotpl_desc
{{Creator}} Name Nombre del creador creator vCard.fn
{{Creator}} Alternative names Nombres alternativos del creador fileinfotpl_creator_alt-name_value vCard.nickname
{{Creator}} Description Nacionalidad y ocupación(es) del creador fileinfotpl_creator_desc_value vCard.note
{{Creator}} Date of death Fecha de muerte del creador fileinfotpl_creator_deathdate_value
{{Creator}} Date of birth Fecha de nacimiento del creador fileinfotpl_creator_birthdate_value vCard.bday
{{Creator}} Location of birth/death Lugar de muerte del creador fileinfotpl_creator_deathloc_value
{{Creator}} Location of birth Lugar de nacimiento del creador fileinfotpl_creator_birthloc_value
{{Creator}} Work period Periodo de trabajo del creador fileinfotpl_creator_work-period_value
{{Creator}} Work location Lugar de trabajo del creador fileinfotpl_creator_work-location_valuev
{{Creator}} Image el retrato o foto que muestra al creador fileinfotpl_creator_image
{{Creator}} Authority control Control de autoridad relacionado con el creador fileinfotpl_creator_authority_value

{{FileContentsByBot}} (varios) depende, por favor leer {{FileContentsByBot}} (various) hproduct-by-bot el conjunto de datos es grande y sigue creciendo, por favor leer {{FileContentsByBot}}
{{Photograph}} title título de la fotografía fileinfotpl_art_title hProduct.fn
{{Photograph}} description descripción de la fotografía fileinfotpl_desc hProduct.description
{{Photograph}} original description descripción original archivado de la fotografía fileinfotpl_desc hProduct.description
{{Photograph}} date fecha de creación original de la obra de arte fileinfotpl_date hCalendar vevent.dtstart microformat added by {{date}} template
{{Photograph}} medium técnica o medio de la fotografía fileinfotpl_art_medium
{{Photograph}} dimensions dimensiones de la fotografía fileinfotpl_art_dimensions
{{Photograph}} artist creador de la fotografía fileinfotpl_aut "hProduct.fn value"
{{Photograph}} institution institución que aloja la obra de arte fileinfotpl_art_gallery
{{Photograph}} location ubicación de la fotografía dentro de la institución fileinfotpl_art_location hProduct.locality
{{Photograph}} source fuente del archivo fileinfotpl_src
{{Photograph}} permission permiso/licencia para el archivo y la obra de arte fileinfotpl_perm
{{Photograph}} other versions otras versiones del archivo fileinfotpl_ver
{{Photograph}} accession number número de accesión de la fotografía hProduct.identifier

Formato alternativo para CommonsMetadata

Because the table + id based format proved very hard to add to templates which were not formatted similarly to the Commons information template, CommonsMetadata allows an alternative format, similar to license templates: the whole information template has to be enclosed in a fileinfotpl class and the tag containing the specific information needs to have a fileinfotpl_* class (same names as above, but class, not id).

Machine readable data set by license templates

Introduced in October 2010, using classes <span class="licensetpl_XXX">

An element identifying a license. Wraps the entire license code and should be a SINGLE license, not a multi license.
Short name of the license: “Public domain”, “CC-BY-SA-3.0”, “CC-by-2.0-FR”, etc.
Long name of the license: “Public domain”, “Creative Commons Attribution-Share Alike 3.0”,
Whether attribution is required. “true” or “false”.
The requested attribution: Free text.
Whether a link to the license is required for this license. “true” or “false”.
The link to the license deed. “”
“true“ if this is a non-free license (not used on Commons, only on wikis with an EDP)

Multiple licensetpl blocks for the same work might be wrapped in a block using the class licensetpl_wrapper.

Templates setting these information

Machine readable data set by style formatting templates

Style formatting templates, meant to provide uniform styles to different families of non-license templates, carry machine readable data identifying these families.

Plantilla Propósito nombre de la clase
{{Restriction-Layout}} usado por etiquetas de Restricción restrictiontemplate
{{FoP-Layout}} usado por etiquetas de libertad de panorama foptemplate
{{Partnership-Layout}} usado por plantillas de Sociedades partnershiptemplate
{{Source-Layout}} usado por plantillas Fuentes genéricas sourcetemplate
{{Created with}} usado por Creado por ... plantillas createdwithtemplate

Machine readable data set by non-copyright restriction templates

Templates regarding non-copyright legal restrictions carry these classes to identify specific types of restrictions.

Plantilla(s) Propósito nombre de clase
{{Trademarked}} Trademarked images restriction-trademarked
{{Copydesign}} Copyrighted designs restriction-design
{{Communist symbol}} Símbolos comunistas restriction-communist
{{Italy-MiBAC-disclaimer}} {{Soprintendenza}} Bienes culturales italianos restriction-ita-mibac
{{Australian Commonwealth reserve}} Reservas australianas restriction-aus-reserve
{{Personality rights}} {{Romania personality rights}} Derechos de personalidad restriction-personality
{{2257}} Child Protection and Obscenity Enforcement Act warning (United States) restriction-2257
{{Costume}} Personalizando restriction-costume
{{Fan art}} Seguidor del arte restriction-fan-art
{{Currency}} Currency restriction-currency
{{IHL Symbol}} Symbols restricted by International Humanitarian Law restriction-ihl
{{Nazi symbol}} Símbolos nazis y fascistas restriction-nazi
{{Insignia}} Insignia Oficial restriction-insignia

Machine readable data set by specific templates

More machine-readable data are set. Here is a not exhaustive list:

{{Personality rights}}
<span class="commons-template-name" style="display:none" id="commons-template-personality-rights">Personality rights</span>
{{Credit line}}
<td id="fileinfotpl_credit" class="fileinfo-paramfield fileinfotpl_credit" style=""></td>

Machine-readable data set by location templates

{{Location}} and similar templates add machine-readable geocodes in the following format: <span class="geo">12.34;24.68</span> (latitdude and longitude as floating-point numbers, separated by a semicolon). The coordinates use the en:WGS84 system (same as the GPS and most online maps). See Commons:Geocoding for more details.


API de MediaWiki

The MediaWiki API now serves a limited number of metadata. Consider the following query:


(Open in API Sandbox) that returns some useful parameters such as Credit, Artist, LicenseUrl and Copyrighted and is used by Media Viewer, for example.

Scripts using machine-readable data

Herramientas externas

== Véase también

Definiendo nueva máquina de datos legibles

  • Do NOT use HTML id's, use classes. An ID can only be used once per page and most of these fields can occur multiple times per page. Consider for instance descriptions of derivative works, which can include information about the original and the derivative.
  • When possible, wrap the actual data, not some field header. This last method is historically used for all our Information templates, but much harder to support in the long run.
  • Wrap data, not the way the data is formatted.
  • Expect that formatting is lost when converting to data. Visual dress up is not part of the information.
  • Don't wrap multiple units of information inside one field. There is a difference between a publication date and a creation date. Both are dates, but both are different 'data fields'. Also CC-by-SA-4.0-3.0-2.5 is not a Licensename, those would be 3 licenses with the name CC-by-SA-##.
  • Make sure that the data value has one unit, or outputs one consistent unit.


There are a few things that are currently NOT or badly recognizable. These include:


  1. bugzilla:17503, Commons:Wikidata for media info