Commons:Machine-readable data/mk

Shortcut: COM:MRD

Многу метаподатоци на Ризницата (вклучувајќи ги оние за лиценца и автор) не се машински читливи. Постои приложен модул iiprop=extmetadata со кој може да се добијат некои вредности (пример), но ова не работи баш најсовршено бидејќи информациите се внесуваат како слободен текст во самата описна страница. Планираме метаподатоците да се преместат во базата на податоци$ref, но ова нема да се случи во скоро време.

In the meantime, 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.

Машински читливи податоци

Машински читлив податочен збир по инфокутии

These are several standard infobox templates tagging different elements of the template with different tags to allow parsing of the information. Several different styles of tags are used:

  • Microformat tags follow industry standards and can be parsed by already existing tools.
  • <td> id attributes (identifiers) are custom markings which allow more complete tags, which have to be read by custom tools. Most universal infoboxes have two column structure: column #1 holds name of the field and column #2 holds the value
    • Traditionally <td> id attributes were used to tag the name call in the first column in a row. To get the data, you would need to get the contents of the following <td> cell in the second column.
    • {{Creator}} and {{Institution}} templates have more complicated structure, so the cells with the actual data are tagged with attributes using magenta background.
Предлошка Назив на предложниот параметар Опис атрибут за назнака <td> Микроформат Коментар
{{Information}}descriptionопис на податотекатаfileinfotpl_deschProduct.description.Often contains multiple languages annotated with {{Lang}}.
{{Information}}dateкога е создадено изворното делоfileinfotpl_datehCalendar vevent.dtstartПонекогаш воедно стои и датум на објавување, или само тој. Овие два датума имаат различно значење за авторските права. Кога се користи, {{Date context}} може да ја укаже разликата. Микроформатот се става со предлошката {{Date}}
{{Information}}sourceизвор на податотекатаfileinfotpl_srcOften 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автор на податотекатаfileinfotpl_autThis can be author, creator and/or copyright holder and is used mixed. Often contains the {{Creator}} template which is described below.
{{Information}}permissionдозвола/лиценца за податотекатаfileinfotpl_perm
{{Information}}other versionsдруги верзии на податотекатаfileinfotpl_ver
{{Artwork}}descriptionопис на уметничкото делоfileinfotpl_deschProduct.description
{{Artwork}}dateкога е создадено изворното уметничко делоfileinfotpl_datehCalendar vevent.dtstartmicroformat added by {{Date}} template
{{Artwork}}sourceизвор на податотекатаfileinfotpl_src
{{Artwork}}artistтворец на уметничкото делоfileinfotpl_aut"hProduct.fn value"
{{Artwork}}authorавтор на уметничкото делоfileinfotpl_aut"hProduct.fn value"
{{Artwork}}permissionдозвола/лиценца за податотеката и уметничкото делоfileinfotpl_perm
{{Artwork}}other versionsдруги верзии на податотекатаfileinfotpl_ver
{{Artwork}}titleнаслов на уметничкото делоfileinfotpl_art_titlehProduct.fn
{{Artwork}}object typeтип на објект на уметничкото делоfileinfotpl_art_object_type
{{Artwork}}mediumтехника или медиум на уметничкото делоfileinfotpl_art_medium
{{Artwork}}dimensionsдимензии на уметничкото делоfileinfotpl_art_dimensions
{{Artwork}}galleryустановата во која се чува уметничкото делоfileinfotpl_art_gallery
{{Artwork}}locationнаоѓалиште на уметничкото дело во рамките на установатаfileinfotpl_art_locationhProduct.locality
{{Artwork}}accession numberприемен број на уметничкото делоfileinfotpl_art_idhProduct.identifier
{{Artwork}}object historyисторија на уметничкото делоfileinfotpl_art_object_history
{{Artwork}}exhibition historyизложбена историја на уметничкото делоfileinfotpl_art_exhibition_history
{{Artwork}}credit lineнабавно потекло на делотоfileinfotpl_art_credit_line
{{Artwork}}inscriptionsнатписи на уметничкото делоfileinfotpl_art_inscriptions
{{Artwork}}notesбелешки за уметничкото делоfileinfotpl_art_notes
{{Artwork}}referencesнаводи што се однесуваат на уметничкото делоfileinfotpl_art_references
{{Book}}Authorавтор на книгатаfileinfotpl_author
{{Book}}Editorуредник на книгатаfileinfotpl_book_editor
{{Book}}Translatorпреведувач на книгатаfileinfotpl_book_translator
{{Book}}Illustratorилустратор на книгатаfileinfotpl_book_illustrator
{{Book}}Titleнаслов на книгатаfileinfotpl_book_title
{{Book}}Subtitleподнаслов на книгатаfileinfotpl_book_subtitle
{{Book}}Series titleсериски наслов на книгатаfileinfotpl_book_series-title
{{Book}}Authority fileподатоци за нормативна контролаfileinfotpl_book_authority
{{Book}}Publisherиздавач на книгатаfileinfotpl_book_publisher
{{Book}}Printerпечатар на книгатаfileinfotpl_book_printer
{{Book}}Year of publicationдатум или година на извадање на книгатаfileinfotpl_date
{{Book}}Place of publicationместо на издавање на книгатаfileinfotpl_book_place-of-publication
{{Book}}Languageјазик на книгатаfileinfotpl_book_language
{{Book}}Descriptionопис на книгатаfileinfotpl_desc
{{Creator}}NameИме на творецотcreatorvCard.fn
{{Creator}}Alternative namesДруги имиња на творецотfileinfotpl_creator_alt-name_valuevCard.nickname
{{Creator}}DescriptionНационалност и занимање/а на творецотfileinfotpl_creator_desc_valuevCard.note
{{Creator}}Date of deathДатум на смрт на творецотfileinfotpl_creator_deathdate_value
{{Creator}}Date of birthДатум на раѓање на творецотfileinfotpl_creator_birthdate_valuevCard.bday
{{Creator}}Location of birth/deathМесто на смрт на творецотfileinfotpl_creator_deathloc_value
{{Creator}}Location of birthМесто на раѓање на творецотfileinfotpl_creator_birthloc_value
{{Creator}}Work periodПериод на дејност на творецотfileinfotpl_creator_work-period_value
{{Creator}}Work locationМесто на дејност на творецотfileinfotpl_creator_work-location_valuev
{{Creator}}Imageпортрет или фотографија на која е прикажан творецотfileinfotpl_creator_image
{{Creator}}Authority fileНормативна контрола што се однесува на творецотfileinfotpl_creator_authority_value


{{FileContentsByBot}}(разно)зависи. вид. {{FileContentsByBot}}(various)hproduct-by-botголем податочен збир кој и понатаму расте. вид. {{FileContentsByBot}}
{{Photograph}}titleнаслов на фотографијатаfileinfotpl_art_titlehProduct.fn
{{Photograph}}descriptionопис на фотографијатаfileinfotpl_deschProduct.description
{{Photograph}}original descriptionизворен архивски опис на фотографијатаfileinfotpl_deschProduct.description
{{Photograph}}dateдатум на создаавање на изворното уметничко делоfileinfotpl_datehCalendar vevent.dtstartmicroformat added by {{Date}} template
{{Photograph}}mediumтехника или медиум на фотографијатаfileinfotpl_art_medium
{{Photograph}}dimensionsдимензии на фотографијатаfileinfotpl_art_dimensions
{{Photograph}}artistтворец на фотографијатаfileinfotpl_aut"hProduct.fn value"
{{Photograph}}institutionустановата во која се чува уметничкото делоfileinfotpl_art_gallery
{{Photograph}}locationнаоѓалиште на фотографијата во рамките на установатаfileinfotpl_art_locationhProduct.locality
{{Photograph}}sourceизвор на податотекатаfileinfotpl_src
{{Photograph}}permissionдозвола/лиценца за податотеката и уметничкото делоfileinfotpl_perm
{{Photograph}}other versionsдруги верзии на податотекатаfileinfotpl_ver
{{Photograph}}accession numberприемен број на фотографијатаhProduct.identifier

Alternative format for 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).

Машински читлив податочен збир по лиценцни предлошки

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

licensetpl
An element identifying a license. Wraps the entire license code and should be a SINGLE license, not a multi license.
licensetpl_short
Short name of the license: “Public domain”, “CC BY-SA 3.0”, “CC by 2.0 fr”, etc.
licensetpl_long
Long name of the license: “Public domain”, “Creative Commons Attribution-Share Alike 3.0”,
licensetpl_attr_req
Whether attribution is required. “true” or “false”.
licensetpl_attr
The requested attribution: Free text.
licensetpl_link_req
Whether a link to the license is required for this license. “true” or “false”.
licensetpl_link
The link to the license deed. “www.creativecommons.org/licenses/by-sa/XXX/YYY”
licensetpl_nonfree
“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 this information

  • Templates setting licensetpl include:

{{PD-Layout}}, {{Cc-by-sa-3.0-migrated}}, {{Cc-by-layout}}, {{Cc-by-sa-layout}}, {{Cc-zero}}, {{FAL}}, {{GFDL}}, {{GFDL-1.2}}, {{GPL}} и {{LGPL}}.

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.

Предлошка Намена назив на класата
{{Restriction-Layout}} се користи во ознаките за ограничувања restrictiontemplate
{{FoP-Layout}} се користи во ознаките за слобода на панорама foptemplate
{{Partnership-Layout}} се користи во предлошките за партнерство partnershiptemplate
{{Source-Layout}} се користи во општонаменски предлошки за извори sourcetemplate
{{Created with}} се користи во предлошки „Создадено со ...“ createdwithtemplate

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

Предлошки Намена назив на класата
{{Trademarked}} Слики со заштитни знаци restriction-trademarked
{{Copydesign}} Ликовни решенија под авторски права restriction-design
{{Communist symbol}} Комунистички симболи restriction-communist
{{Italy-MiBAC-disclaimer}} {{Soprintendenza}} Културни добра на Италија restriction-ita-mibac
{{Australian Commonwealth reserve}} Резервати во Австрија restriction-aus-reserve
{{Personality rights}} {{Romania personality rights}} Права на личноста restriction-personality
{{2257}} Child Protection and Obscenity Enforcement Act warning (United States) restriction-2257
{{Costume}} Костими restriction-costume
{{Fan art}} Обожавателска уметност restriction-fan-art
{{Currency}} Валути restriction-currency
{{IHL Symbol}} Симболи ограничени од меѓународното хуманитарно право restriction-ihl
{{Nazi symbol}} Нацистички и фашистички симболи restriction-nazi
{{Insignia}} Службени обележја restriction-insignia

Машински читлив податочен збир по дадени предлошки

More machine-readable data are set. Here is a non-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> (latitude 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.

Usage

MediaWiki API

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

External tools

Поврзано

Defining new machine readable data

  • 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 license name, 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.

Problems

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

  • Derivative works
  • Works included in works. See also Category:FoP_templates
  • licenses derivates or works included in works are a mess.
  • Author vs. Copyright holder
  • usernames vs 'real names'
  • Catalogue IDs etc
  • VRTS permissions
  • Publication date vs creation date
Category:Commons help/mk
Category:Commons help/mk