JSON-LD / RDF support
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
调研方向
该 issue 未指明仓库文件、测试或入口点。首先追踪 API 如何处理 Accept 标头和响应格式,然后确定 JSON-LD 表示形式以及本体范围。完成的要求是形成一致认可的实现计划,并支持所请求的 JSON-LD 形式。
由索引模型根据 Issue 内容生成。
描述
I think it would be valuable to be able to use a PokéAPI endpoint as a canonical URL within RDF linked data, so other RDF documents can refer to Pokémon concepts. For example, someone could make character bios using JSON-LD that look like:
{
"@context": {
"@vocab": "https://schema.org/",
"pkmn": "https://pokemonkg.org/ontology/version/1.0.0"
},
"@id": "<...>",
"@type": "Person",
"name": "Meowth",
"description": "Team Rocket's Meowth",
"url": "https://bulbapedia.bulbagarden.net/wiki/Meowth_(Team_Rocket)",
"pkmn:species": { "@id": "https://pokeapi.co/api/v2/pokemon-species/meowth" },
"gender": { "@id": "https://schema.org/Male" },
"memberOf": {
"@type": "Organization",
"name": "Team Rocket",
"url": "https://bulbapedia.bulbagarden.net/wiki/Team_Rocket"
},
"knows": {
"@id": "<...>",
"@type": "Person",
"name": "Meowzie",
"url": "https://bulbapedia.bulbagarden.net/wiki/Meowzie",
"pkmn:species": { "@id": "https://pokeapi.co/api/v2/pokemon-species/meowth" },
"gender": { "@id": "https://schema.org/Female" }
}
}
This would be very useful for creating original characters in a somewhat-standard machine-readable format, e.g. for use in TTRPG campaigns.
Some notes:
- There is a readily available Pokémon ontology for RDF, but we could extend it or make our own for PokéAPI if it doesn't have all the features we need.
- In the example above, I used the
Persontype from Schema.org (https://schema.org/Person) as it integrates with the rest of the Schema.org ontology - for example, theCreativeWork.characterproperty takes aPersonas its value to represent a character within a creative work. However, the Comic Book Ontology also provides a dedicatedCharactertype (https://comicmeta.org/cbo/#Character).
Similar to MusicBrainz, a client could request the JSON-LD for a Pokémon concept by modifying its HTTP request in the following form:
GET /api/v2/pokemon-species/meowth HTTP/2
Host: pokeapi.co
Accept: application/ld+json
or alternatively append ?format=json-ld to the resource URL.
- 主要语言
- Python
- 星标
- 5.4k
- 派生
- 1.2k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 18
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PokeAPI/pokeapi 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-2 天 新手友好度 76/100
-
难度 3/5 1-2 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 48/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 84/100
gradio-app/gradio#13895 ·
-
build-error
难度 2/5 1-3 小时 新手友好度 76/100
spack/spack-packages#6713 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
ActivityWatch/activitywatch#1464 · 1 个 reaction ·
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search results 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
bytedance/trae-agent#483 ·