-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
293 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
info: | ||
version: 1.0.0 | ||
title: Recommendation API | ||
description: Recommendation API | ||
termsOfService: https://github.com/wikimedia/restbase | ||
license: | ||
name: Apache license, v2 | ||
url: https://www.apache.org/licenses/LICENSE-2.0 | ||
tags: | ||
- name: Recommendation | ||
description: contribution recommendations | ||
paths: | ||
/recommendation/caption/addition/{target}: | ||
get: | ||
tags: | ||
- Recommendation | ||
summary: Recommend files missing a caption (label) in the target language | ||
parameters: | ||
- name: target | ||
in: path | ||
description: The target wiki language code for suggestions | ||
required: true | ||
schema: | ||
type: string | ||
responses: | ||
200: | ||
description: list of candidates for caption addition | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/caption_recommendation_result' | ||
default: | ||
description: Error | ||
content: | ||
application/problem+json: | ||
schema: | ||
$ref: '#/components/schemas/problem' | ||
x-request-handler: | ||
- get_from_backend: | ||
request: | ||
uri: '{{options.host}}/{{domain}}/v1/caption/addition/{target}' | ||
x-monitor: false | ||
|
||
/recommendation/caption/translation/from/{source}/to/{target}: | ||
get: | ||
tags: | ||
- Recommendation | ||
summary: Recommend files with a caption (label) in the source language but missing one in the target language | ||
parameters: | ||
- name: source | ||
in: path | ||
description: The source wiki language code for suggestions | ||
required: true | ||
schema: | ||
type: string | ||
- name: target | ||
in: path | ||
description: The target wiki language code for suggestions | ||
required: true | ||
schema: | ||
type: string | ||
responses: | ||
200: | ||
description: list of candidates for caption translation | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/caption_recommendation_result' | ||
default: | ||
description: Error | ||
content: | ||
application/problem+json: | ||
schema: | ||
$ref: '#/components/schemas/problem' | ||
x-request-handler: | ||
- get_from_backend: | ||
request: | ||
uri: '{{options.host}}/{{domain}}/v1/caption/translation/from/{source}/to/{target}' | ||
x-monitor: false | ||
|
||
components: | ||
schemas: | ||
caption_recommendation_result: | ||
type: array | ||
description: list of candidates for caption addition or translation | ||
items: | ||
type: object | ||
properties: | ||
pageid: | ||
type: integer | ||
description: wiki page id | ||
ns: | ||
type: integer | ||
description: numeric page namespace (should always be 6) | ||
title: | ||
type: string | ||
description: page title (with namespace prefix) | ||
mime: | ||
type: string | ||
description: the MIME type of the file | ||
structured: | ||
type: object | ||
description: structured data from Structured Data on Commons | ||
properties: | ||
captions: | ||
type: object | ||
description: captions, by language, from Structured Data on Commons | ||
globalusage: | ||
type: object | ||
description: pages using this image on the source or target wiki, by language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
info: | ||
version: 1.0.0 | ||
title: Recommendation API | ||
description: Recommendation API | ||
termsOfService: https://github.com/wikimedia/restbase | ||
license: | ||
name: Apache license, v2 | ||
url: https://www.apache.org/licenses/LICENSE-2.0 | ||
tags: | ||
- name: Recommendation | ||
description: contribution recommendations | ||
paths: | ||
/recommendation/description/addition/{target}: | ||
get: | ||
tags: | ||
- Recommendation | ||
summary: Recommend Wikibase items missing a description in the target language | ||
parameters: | ||
- name: target | ||
in: path | ||
description: The target wiki language code for suggestions | ||
required: true | ||
schema: | ||
type: string | ||
responses: | ||
200: | ||
description: list of candidates for description addition | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/description_recommendation_result' | ||
default: | ||
description: Error | ||
content: | ||
application/problem+json: | ||
schema: | ||
$ref: '#/components/schemas/problem' | ||
x-request-handler: | ||
- get_from_backend: | ||
request: | ||
uri: '{{options.host}}/{{domain}}/v1/description/addition/{target}' | ||
x-monitor: false | ||
|
||
/recommendation/description/translation/from/{source}/to/{target}: | ||
get: | ||
tags: | ||
- Recommendation | ||
summary: Recommend Wikibase items with a description in the source language but missing one in the target language | ||
parameters: | ||
- name: source | ||
in: path | ||
description: The source wiki language code for suggestions | ||
required: true | ||
schema: | ||
type: string | ||
- name: target | ||
in: path | ||
description: The target wiki language code for suggestions | ||
required: true | ||
schema: | ||
type: string | ||
responses: | ||
200: | ||
description: list of candidates for description translation | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/description_recommendation_result' | ||
default: | ||
description: Error | ||
content: | ||
application/problem+json: | ||
schema: | ||
$ref: '#/components/schemas/problem' | ||
x-request-handler: | ||
- get_from_backend: | ||
request: | ||
uri: '{{options.host}}/{{domain}}/v1/description/translation/from/{source}/to/{target}' | ||
x-monitor: false | ||
|
||
components: | ||
schemas: | ||
description_recommendation_result: | ||
type: array | ||
description: list of candidates for description addition or translation | ||
items: | ||
type: object | ||
properties: | ||
pageid: | ||
type: integer | ||
description: wiki page id | ||
ns: | ||
type: integer | ||
description: numeric page namespace (should always be 0) | ||
title: | ||
type: string | ||
description: page title | ||
wikibase_item: | ||
type: object | ||
description: info about the corresponding item in Wikidata | ||
properties: | ||
type: | ||
type: string | ||
description: entity type (should always be "item") | ||
id: | ||
type: string | ||
description: Wikibase ID (should be Q-prefixed) | ||
labels: | ||
type: object | ||
description: item labels by language | ||
descriptions: | ||
type: object | ||
description: item descriptions by language | ||
sitelinks: | ||
type: object | ||
description: item sitelinks by wiki (e.g., 'dewiki') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters