Extension:CommonsMetadata/ko
출시 상태: 안정 |
|
|---|---|
| 구현 | API |
| 설명 | Attempts at extracting metadata from Commons pages |
| 만든 이 | Brian Wolff (bawolff토론) |
| 호환성 정책 | 스냅샷은 미디어위키와 함께 릴리스됩니다. Master is not backward compatible. |
| MediaWiki | 1.25+ |
| PHP | 5.4+ |
| 데이터베이스 변경 | 아니오 |
|
|
| Licence | GNU General Public License 2.0 or later |
| 다운로드 | |
| CommonsMetadata 확장 기능 번역 (translatewiki.net에서 가능한 경우) | |
| 이슈 | 미해결 작업 · 버그 보고 |
The CommonsMetadata extension is an attempt at extracting metadata from Wikimedia Commons pages but is also available at all other Wikimedia projects. It adds some extra information to the imageinfo API, based on templates and categories in the image description. It is used by several extensions/tools (such as 확장기능:MultimediaViewer, Extension:VisualEditor, 확장기능:모바일 프론트엔드, Mobile-Content-Service (MCS)) to provide better lightboxes or image selection dialogs.
The extension in its current form is intended to be a temporary solution, eventually replaced by Wikidata on Commons.
설치
- 파일을 다운로드하고
CommonsMetadata폴더를extensions/디렉토리에 넣어 주세요.
개발자와 코딩 기여자는 Git을 이용해 확장기능을 다운받는 것이 좋습니다.cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CommonsMetadata
- 아래의 코드를 LocalSettings.php 코드의 마지막에 추가합니다.
wfLoadExtension( 'CommonsMetadata' );
완료 – 위키의 ‘Special:Version’에 이동해서, 확장기능이 올바르게 설치된 것을 확인합니다.
Motivation & design choices
The assumptions of this extension are the following.
- At some point in the future, Wikidata will take over handling metadata at Commons. To avoid disruptive changes, which will soon need to be changed again, the extension should work with common metadata as it currently is (so not introducing new parser functions). Hence, screen scraping.
- The content of many of the fields on a Commons description page includes rich formatting (In particular: Links, italics, bold. In some cases, more complex things like embedded images).
- As a result, the extension outputs parsed html (wikitext sucks, plain text doesn't capture the data).
- Furthermore, the data tends to be formatted for human display rather than (for example) machine-formatted dates. When the date field says something like "circa 1600s", it's hard to convert that to a precise date (many examples can be).
- To carry that forward, also apply formatting to EXIF metadata, which is controlled on the wiki (For example, Commons links the camera name to a Wikipedia article).
- If we can't extract info from the description page, but the file has the author tagged in EXIF/XMP/iptc metadata, we should use that as a fallback.
- Ideally, such a system would be as Commons-specific as possible, with the Commons and non-Commons parts separated.
- Commons description pages have multilingual descriptions. Lots of users probably want one language.
- This implementation applies per language conventions to dates and things. Additionally, for explicitly multi-lingual fields (description), there is an option to return all or just a single language. Even in single language mode, some things are still language-specific (like the thousands separator on numbers).
Configuration
| parameter | default | description |
|---|---|---|
$wgCommonsMetadataSetTrackingCategories
|
false
|
Add the following tracking categories to file pages when the corresponding information is not provided either via templates on the file page of (for some of these) EXIF metadata:
|
$wgCommonsMetadataPublicDomainPageUrl
|
https://commons.wikimedia.org/wiki/Help:Public_domain
|
Link used for 'license' attribute in schema.org markup for files in the public domain. |
$wgCommonsMetadataForceRecalculate
|
false
|
Force calculation of metadata even when the image is from a foreign repository that would provide it. This is meant for local development. |
Testing
When testing with remote images (e.g. Commons images if you have enabled $wgUseInstantCommons), you can set $wgCommonsMetadataForceRecalculate = true; to force CommonsMetadata to parse the description page of the image and extract the metadata (normally, if the remote repository had CommonsMetadata installed as well, it would just copy the API output from there).
Usage
Use the imageinfo API, and include extmetadata as an image info property specified via iiprop.
Example
View this example in the API sandbox:
Returned data
The extension currently provides the following items in the extmetadata field of the response (the field names were chosen, where possible, to follow the IPTC-IIM format used in EXIF headers):
Data based on machine-readable data in the Information template:
ImageDescription– image descriptionArtist– author name (might contain complex HTML, multiple authors, etc)Credit– sourceDateTimeOriginal– time of creation (space-separated ISO 8601 timestamp whenever possible, but can be any other textual description of a date, possibly with HTML mixed in)ObjectName– title (for a book/painting; otherwise just the file name)Permission– contents of the Permission field of the template. It can be a lot of things (license template, OTRS ID, details on how to attribute...)AuthorCount– the number of templates with authors (e.g., Book, Photograph...). The number of actual authors might be higher if a template describes multiple authors in a single string.
Data based on machine-readable data in the Location template:
GPSLatitude– latitudeGPSLongitude– longitudeGPSMapDatum– coordinate type (onlyWGS-84supported for now)
Data based on machine-readable data in the license template:
LicenseShortName– short human-readable license nameLicenseUrlUsageTermsCopyrighted–TrueorFalse(for public domain images)
For multi-licensed images, these values are currently unreliable.
Attribution– custom attribution that should replace Artist + Credit (can also originate from the Information template)AttributionRequired– booleanish (phab:T86726), tells whether there is a legal requirement to attributeNonFree– booleanish, true means the image is not under a free license. (Used for non-Commons images only.)
Other data:
CommonsMedadataExtension– contains the metadata parser version number; mostly for internal useLicense– a best guess at the license of the image (mostly for internal use by MediaViewer, might change; LicenseShortName is probably more reliable)Categories– a|-separated list of the categories of the image.Assessments– a|-separated list of the assessments of the image (currently five values are supported: poty, potd, featured, quality, valued). Based on parsing category names, probably won't work for images not hosted on Commons.Restrictions– reuse restrictions such as trademarks or personality rights; an array of keywords (the class names from this table, without therestriction-prefix). See also the restrict-* icons in MediaViewer.DeletionReason– if set, the template is being considered for deletion. (Based on the nuke template, probably not reliable outside Commons.) It contains a deletion reason, but it is phrased to be applicable for a log entry, so it might be misleading (e.g. past tense when actually it is not yet decided whether the image will be deleted).
같이 보기
- Manual:File metadata handling
- 확장기능:MultimediaViewer - currently the main user of the information provided by CommonsMetadata.
- Request for comment on handling image information
- Template detection on local wikis with locally uploaded files – Describes how to prepare the templates for fetching metadata and thus displaying them when using the MultimediaViewer extension.
| 이 확장 기능은 하나 이상의 위키미디어 프로젝트에서 사용 중입니다. 이것은 아마도 이 확장 기능이 안정적이고 트래픽이 많은 웹 사이트에서 사용할 수 있을 만큼 충분히 잘 작동한다는 것을 의미합니다. 설치된 위치를 확인하려면 위키미디어의 CommonSettings.php 및 InitialiseSettings.php 구성 파일에서 이 확장 기능의 이름을 찾습니다. 특정 위키에 설치된 확장 기능의 전체 목록은 위키의 Special:Version 문서에서 볼 수 있습니다. |
| This extension is included in the following wiki farms/hosts and/or packages: |
- Stable extensions/ko
- API extensions/ko
- ContentAlterParserOutput extensions/ko
- GetExtendedMetadata extensions/ko
- SkinAfterBottomScripts extensions/ko
- ValidateExtendedMetadataCache extensions/ko
- GPL licensed extensions/ko
- Extensions in Wikimedia version control/ko
- All extensions/ko
- Extensions used on Wikimedia/ko
- Extensions included in Canasta/ko
- Extensions included in Miraheze/ko
- Metadata/ko
- Data extraction extensions/ko
