Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

JSON-LD / RDF support

Đang mở
#1,483 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Lĩnh vực
api, backend-api-design

Hướng nghiên cứu

Issue không nêu tên các tệp trong repository, các bài kiểm thử hoặc các entry point. Hãy bắt đầu bằng cách truy vết cách API xử lý các header Accept và các định dạng phản hồi, sau đó xác định biểu diễn JSON-LD và phạm vi của ontology. Công việc được xem là hoàn tất khi có một kế hoạch triển khai đã được thống nhất và hỗ trợ cho dạng JSON-LD được yêu cầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 Person type from Schema.org (https://schema.org/Person) as it integrates with the rest of the Schema.org ontology - for example, the CreativeWork.character property takes a Person as its value to represent a character within a creative work. However, the Comic Book Ontology also provides a dedicated Character type (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.

Ngôn ngữ chính
Python
Star
5.4k
Fork
1.2k
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
18

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PokeAPI/pokeapi

Tất cả issue của PokeAPI/pokeapi

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.