Microdata
Microdata เป็นข้อกําหนดในการฝังข้อมูลที่คอมพิวเตอร์อ่านได้ในเอกสาร HTML โดยประกอบด้วยคู่ชื่อ-ค่า (เรียกว่า items
) ที่กําหนดตามคําศัพท์ schema.org มีคอลเล็กชันคําศัพท์มาร์กอัปที่ใช้กันโดยทั่วไป
ไวยากรณ์พื้นฐานประกอบด้วยแอตทริบิวต์ itemscope
เพื่อกำหนดรายการ และแอตทริบิวต์ itemprop
เพื่ออธิบายคุณสมบัติรายการใดรายการหนึ่ง ประเภทจะระบุโดยใช้แอตทริบิวต์ itemtype
และสามารถรับค่าที่กําหนดไว้ในคําศัพท์ที่ต้องการ เช่น schema.org
กำหนดประเภท เช่น http://schema.org/Person
หรือ http://schema.org/PostalAddress
ตัวอย่างต่อไปนี้ (จาก Wikipedia) แสดงวิธีใช้ Microdata เพื่ออธิบายบุคคล
<section itemscope itemtype="http://schema.org/Person">
Hello, my name is
<span itemprop="name">John Doe</span>,
I am a
<span itemprop="jobTitle">Graduate research assistant</span>
at the
<span itemprop="affiliation">University of Dreams</span>
My friends call me
<span itemprop="additionalName">Johnny</span>
You can visit my homepage at
<a href="http://www.example.com.com" itemprop="url">www.example.com</a>
<section itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
I live at
<span itemprop="streetAddress">1234 Peach Drive</span>
<span itemprop="addressLocality">Warner Robins</span>
<span itemprop="addressRegion">Georgia</span>.
</section>
</section>
ตรวจสอบเครื่องมือโปรแกรมตรวจสอบสคีมาเพื่อแก้ไขข้อบกพร่องของมาร์กอัปและตรวจสอบกับสคีมาที่รองรับ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-12-21 UTC
[null,null,["อัปเดตล่าสุด 2024-12-21 UTC"],[[["Microdata is an HTML specification used to embed machine-readable data in webpages using name-value pairs called `items` which are defined within a vocabulary."],["Schema.org provides commonly used vocabularies to structure the data, and items are marked up with attributes like `itemscope`, `itemprop`, and `itemtype` for machines to understand."],["The syntax involves defining an `item` and its `properties` using these attributes, and specifying a vocabulary such as schema.org for types like `Person` or `PostalAddress`."],["You can validate your Microdata implementation using the Schema Validator tool to ensure correctness and compatibility with supported schemas."]]],["Microdata embeds machine-readable data in HTML using name-value pairs called items. `itemscope` defines an item, `itemprop` describes its properties, and `itemtype` specifies its type from a vocabulary (e.g., schema.org). For example, the `Person` type can include properties like `name`, `jobTitle`, and `address`. The Schema Validator tool is available for debugging and validating microdata markup against supported schemas.\n"]]