Schema
To ensure the database is organized, standardized, and easy to understand, we have designed a schema to define how many types of nodes exist, what properties each type has, and how these nodes can be connected to create relationships.
We designed the Politigraph schema based on Popolo - International open government data specifications with adaptations for the context of Thailand. The schema consists of:
- Object: Types of actual data nodes, specifying the properties present in each node type.
- Interface: Basic requirements for object to extend.
- Union: Sets of possible types.
- Relationship: Possible relationships between different node types.
Feel free to select entities to read the descriptions.
For example, we have these people with first-name starting with “Nat” represented with nodes type of Person. These nodes will only have property and relationship that satisfied Person schema (they don’t need to have optional properties, so querying those will have value of null)
บุคคลที่เกี่ยวข้องทางการเมือง เช่น สมาชิกสภา สมาชิกพรรคการเมือง ฯลฯ
- id: 24b67bee-2791-49d0-a43f-5a1bdc8c2d7b
- prefix: นาย
- name_en: Natchanon Srikokuea
- image: https://politigraph.wevis.info/assets/people/ณัฏฐ์ชนน-ศรีก่อเกื้อ.webp
- birth_date: 1975-01-29
- educations: - ปริญญาโท ศิลปศาสตรมหาบัณฑิต (รัฐศาสตร์) มหาวิทยาลัยรามคำแหง
- previous_occupations: - สมาชิกสภาองค์การบริหารส่วนจังหวัดสงขลา
*Only showing nodes, properties, and relationships from the query see full schema
query People($where: PersonWhere) { people(where: $where) { id prefix name_en image birth_date educations previous_occupations }}{ "where": { "firstname_en_STARTS_WITH": "Nat" }}{ "data": { "people": [ { "__typename": "Person", "id": "24b67bee-2791-49d0-a43f-5a1bdc8c2d7b", "prefix": "นาย", "name_en": "Natchanon Srikokuea", "image": "https://politigraph.wevis.info/assets/people/ณัฏฐ์ชนน-ศรีก่อเกื้อ.webp", "birth_date": "1975-01-29", "educations": "- ปริญญาโท ศิลปศาสตรมหาบัณฑิต (รัฐศาสตร์) มหาวิทยาลัยรามคำแหง", "previous_occupations": "- สมาชิกสภาองค์การบริหารส่วนจังหวัดสงขลา" }, { "__typename": "Person", "id": "1f30f03a-4d63-4705-a34b-594f616d0015", "prefix": "นางสาว", "name_en": "Natchira Imwised", "image": null, "birth_date": null, "educations": "- ปริญญาโท คณะบริหารธุรกิจ มหาวิทยาลัยศิลปากร\n- ปริญญาตรี คณะบริหารธุรกิจ มหาวิทยาลัยเกษตรศาสตร์", "previous_occupations": "- อดีตที่ปรึกษาคณะกรรมาธิการกิจการเด็ก เยาวชน สตรี ผู้สูงอายุ ผู้พิการ กลุ่มชาติพันธุ์ และผู้มีความหลากหลายทางเพศ\n- ธุรกิจส่วนตัว" }, { "__typename": "Person", "id": "1afd00e0-1e07-4d48-9d77-94ab505f8b7e", "prefix": "นาย", "name_en": "Nattacha Boonchaiinsawat", "image": "https://politigraph.wevis.info/assets/people/ณัฐชา-บุญไชยอินสวัสดิ์.webp", "birth_date": "1990-04-11", "educations": "- ประกาศนียบัตรวิชาชีพชั้นสูง (ปวส.) วิทยาลัยเทคโนโลยีสยาม", "previous_occupations": "- นักธุรกิจ" }, { "__typename": "Person", "id": "befcc3d0-fc32-4836-9d71-1c16ee647782", "prefix": "นาย", "name_en": "Nattapong Pipatchaisiri", "image": null, "birth_date": null, "educations": "- มัธยมศึกษาตอนปลาย Broad Run High School VA สหรัฐอเมริกา\n- ปริญญาตรี วิทยาลัยนานาชาติ", "previous_occupations": "" }, { "__typename": "Person", "id": "468d76e2-cd67-4ee9-8f2a-043a28ef995f", "prefix": "นาย", "name_en": "Nattapong Supriyasilp", "image": "https://politigraph.wevis.info/assets/people/ณัฐพงษ์-สุปริยศิลป์.webp", "birth_date": "1977-12-23", "educations": "- ปริญญาโท Master of Commerce (International Business) Deakin University, Australia", "previous_occupations": "- สมาชิกสภาผู้แทนราษฎร" }, { "__typename": "Person", "id": "adad2e16-ec2e-4bf4-8f36-6202c22c46da", "prefix": "นาย", "name_en": "Nattapong Sumanotham", "image": null, "birth_date": null, "educations": "- ปริญญาตรี รัฐศาสตร์บัณฑิต การเมืองการปกครอง (เกียรตินิยมอันดับ 2) มหาวิทยาลัยธรรมศาสตร์\n- มัธยมศึกษา โรงเรียนสวนกุหลาบวิทยาลัย รุ่น 131", "previous_occupations": "- โฆษกคณะกรรมาธิการพิจารณา ร่าง พ.ร.บ. แก้ไขเพิ่มเติม พ.ร.ก.ประมง พ.ศ. 2558\n- ผู้จัดการรณรงค์ทางการเมือง คณะก้าวหน้า แคมเปญขอคนละชื่อปลดล็อกท้องถิ่น\n- อดีตทีมผู้ช่วยเลขาธิการคณะก้าวหน้า ปิยบุตร แสงกนกกุล\n- อดีตทีมสื่อสารพรรคก้าวไกล\n- อดีตผู้ช่วยหัวหน้าพรรคก้าวไกล พิธา ลิ้มเจริญรัตน์" }, { "__typename": "Person", "id": "d45582fa-6595-4aec-ba71-8cbc3a37013d", "prefix": "นาย", "name_en": "Natthaphong Ruengpanyawut", "image": "https://politigraph.wevis.info/assets/people/ณัฐพงษ์-เรืองปัญญาวุฒิ.webp", "birth_date": "1987-05-18", "educations": "- ปริญญาตรี วิศวกรรมศาสตรบัณฑิต (วิศวกรรมคอมพิวเตอร์) จุฬาลงกรณ์มหาวิทยาลัย", "previous_occupations": "- นักธุรกิจ" }, { "__typename": "Person", "id": "db6c21ed-25bc-4969-9417-76e58ded5d11", "prefix": "นาย", "name_en": "Nataphol Tovichakchaikul", "image": null, "birth_date": "1988-08-22", "educations": "- มัธยมศึกษา โรงเรียนมงฟอร์ตวิทยาลัย จังหวัดเชียงใหม่ - ปริญญาตรี คณะบริหารธุรกิจ มหาวิทยาลัยเชียงใหม่ - ปริญญาโท ด้านบริหารธุรกิจ มหาวิทยาลัยแคลิฟอร์เนีย ลูเธอรัน ประเทศสหรัฐอเมริกา", "previous_occupations": "- ธุรกิจส่วนตัว" } ] }}Relationship
Section titled “Relationship”Relationship in schema will have a name with arrow direction for human interpretation such as Post--IN--> Organization meaning Post is “in” an Organization But in the query process, either nodes at the both end can be queried from each other. For example, Post has property organizations and Organization has property posts that refer to reach other node of this relationship.
องค์กรที่เกี่ยวข้องทางการเมือง เช่น สส. สว. ครม. พรรคการเมือง ฯลฯ
- id: คณะรัฐมนตรี-64
- name_en: The 64th Cabinet
- posts:
- นายกรัฐมนตรี ครม. คณะที่ 64
*Only showing nodes, properties, and relationships from the query see full schema
query Organizations($where: OrganizationWhere, $postsWhere2: PostWhere) { organizations(where: $where) { id name_en posts(where: $postsWhere2) { id label role organizations { id name } } }}{ "where": { "id_EQ": "คณะรัฐมนตรี-64" }, "postsWhere2": { "role_EQ": "นายกรัฐมนตรี" }}{ "data": { "organizations": [ { "__typename": "Organization", "id": "คณะรัฐมนตรี-64", "name_en": "The 64th Cabinet", "posts": [ { "__typename": "Post", "id": "01c8850b-3d67-4c8c-9993-071b0f4dab0a", "label": "นายกรัฐมนตรี ครม. คณะที่ 64", "role": "นายกรัฐมนตรี", "organizations": [ { "__typename": "Organization", "id": "คณะรัฐมนตรี-64", "name": "คณะรัฐมนตรี คณะที่ 64" } ] } ] } ] }}