ã¯ããã«
HTML5ã解決ããããšããåé¡ã®1ã€ã¯ã<header>ã<nav>ã<figure>ãªã©ã®æšæºçãªã»ãã³ãã£ãã¯èŠçŽ ã®å°å ¥ã«ãã£ãŠèšŒæãããããã«ãè«çïŒãããã£ãŠãã·ã³ã®å¯èªæ§ïŒããŒã¯ã¢ãããå¢ããããšã§ããã ããã¯ãã¹ãŠè¯ãããšã§ãããã³ã³ãã³ãèŠçŽ ã«ç¹å®ã®æ©æ¢°å¯èªå±æ§ãè¿œå ããŠãç°ãªãã³ã³ãã³ãã«äœ¿çšãããããŒã¯ã¢ãããç°ãªãå Žåã§ããäºæž¬å¯èœãªã¹ã¯ãªããã§äœ¿çšã§ããããã«ããå¿ èŠãããå ŽåããããŸãã ãã®ããŒãºã¯ãã·ã³ãã«ã§äžäœäºææ§ã®ããMicroformatsã®å©ããšãããé£è§£ãªRDFaã®å©ããåããŠãããçšåºŠãŸã§ã¯ãã§ã«æºããããŠããŸãã
ãã®ç¹ã§ããã®åé¡ã®è§£æ±ºçãHTML5ä»æ§ã«microdataä»æ§ïŒä»¥éMicrodataïŒãšããŠè¿œå ãããããšã¯é©ãããšã§ã¯ãããŸãããããã«ã¯ãä»»æã®èŠçŽ ã«è¿œå ã§ããå±æ§ã®ã»ãããšãäžã®microdataãåŠç/éçŽããããã®é¢é£DOM APIããŒãžã
Microdataã¯ãéå»ã«æ¢ã«æã£ãŠããããšãæ¹åããããšããŠããŸãããã€ã¯ããã©ãŒããããšåããããç解ãããããç¬èªã®ããŒãµãŒãäœæããã«ããŒã¿ãåŠçã§ããçµã¿èŸŒã¿ã¡ã«ããºã ãæäŸããŸãã ãã¡ãããå¿ èŠã«å¿ããŠJavaScriptã䜿çšãããã€ãã£ãMicrodata DOM APIãµããŒããªãã§ããã©ãŠã¶ãŒãµããŒãçšã«ç¬èªã®MicrodataããŒãµãŒãäœæã§ããŸãã ãã®èšäºã§ã¯ãMicrodata HTMLå±æ§ãšDOM APIæ§æã«ã€ããŠèª¬æããŸãã
: Opera Microdata .
HTMLæ§æ
microdataã¯äžé£ã®èŠçŽ ã§æ§æãããåèŠçŽ ã«ã¯ããŒãšå€ã®ãã¢ã§è¡šãããäžé£ã®ããããã£ããããŸãã å®éãå®éã®Webãªã¿ã¯ã®ããã«ãmicrodata圢åŒã§èªåã説æããŸãããã ããªãã¯ç§ã®ãã¿ãŒã³ã§ããªãèªèº«ã®äŸãæžãããšãã§ããŸãã
: Microdata HTML5-. Microdata , .
ãŸãã itemscopeå±æ§ã䜿çšããŠãé©åãªèŠçŽ ãèŠçŽ ã®ã³ã³ãããšããŠããŒã¯ã§ããŸã
<article itemscope> </article>
æããã«ãå¿ èŠãªããŒã¿ãå«ãèŠçŽ ãéžæããå¿ èŠããããŸãããããŒã¯ããããŒã¿ã¯éèŠã§ã¯ãããŸããã ãã®å ŽåãäŒèšã«ãŒããããŒã¯ããŸããæåã®ããããã£ã¯ååã§ããã itempropå±æ§ã䜿çšããŠããŒã¯ããŸãã
<article itemscope> <h2 itemprop="name">Chris Mills</h2> </article>
itempropå±æ§ã¯ãããŒã¿ãå«ãã¢ã€ãã ãéžæããŸãã å±æ§å€ã¯ããããã£ã®ååã§ãããèŠçŽ ã®ã³ã³ãã³ãã¯ããããã£ã®å€ã§ãã ããããã£ãããã€ãè¿œå ããŠãèŠç¹ã確å®ã«ææ¡ããŸãããã
<article itemscope> <h2 itemprop="name">Chris Mills</h2> <ul> <li>Nationality: <span itemprop="nationality">British</span></li> <li>Age: <span itemprop="age">33</span></li> <li>Hair colour: <span itemprop="colour">Brown</span></li> </ul> </article>
å Žåã«ãã£ãŠã¯ãããããã£å€ã¯èŠçŽ ã®ããã¹ãã³ã³ãã³ãã§ã¯ãªããåãèŠçŽ ã®å±æ§ã®å€ã§ãã äŸïŒ
- <media>ã¿ã°ã®å Žåãããããã£å€ã¯srcå±æ§ã®å€ã§ãã
- <a>ã¿ã°ã®å Žåãhrefå±æ§ã®å€ã
- <time>ã¿ã°ã®å Žåããdatetimeãå±æ§ã®å€ã
ïŒæ³šç¿»èš³è ïŒä»ã®èŠçŽ ã®å€ã¯ä»æ§ã«ãããŸã ïŒ
äžæ¹ãããããã£å€ãURLã®å Žåã察å¿ããèŠçŽ ãä»ããŠè¡šçŸããå¿ èŠããããŸãã察å¿ããèŠçŽ ã¯ãããšãã°<a>èŠçŽ ãä»ããŠãå€éšãªãœãŒã¹ããã€ã³ããŸãã¯ããŒãããŸãã ããããã£å€ãæ¥ä»ãŸãã¯æå»ïŒãŸãã¯ãã®äž¡æ¹ïŒã§ããå Žåãããããã£ã¯<time>èŠçŽ ãšãdatetimeãå±æ§ã§è¡šçŸããå¿ èŠããããŸãã itempropå±æ§ã¯ãŸã£ããåãæ¹æ³ã§è¿œå ãããŸãã ãåæã«ãããããã£å€ã¯èŠçŽ ã®ããã¹ãã³ã³ãã³ãã§ã¯ãªãå±æ§å€ã«ãªããŸãã
ããã€ãã®äŸïŒ
<article itemscope> <h2 itemprop="name">Chris Mills</h2> <p><img itemprop="image" src="Chris-Mills.png" alt="Photo of Chris Mills - this is me"></p> <ul> <li>Nationality: <span itemprop="nationality">British</span></li> <li>Age: <span itemprop="age">33</span></li> <li>Date of birth: <time itemprop="birthday" datetime="1978-06-27">June 27th 1978</time></li> <li>Hair colour: <span itemprop="colour">Brown</span></li> </ul> </article>
: (10 2011), <data>, .
ãã¹ããããMicrodataããŒã
ãŸããäºãã«ç°¡åã«MicrodataèŠçŽ ãå°å ¥ããããšãã§ããŸãïŒãã©ã³ã¹ã¬ãŒã¿ãŒã«æ³šæããŠãã ããïŒæ··ä¹±ããªãããã«ããMicrodataããŒããïŒã æäžäœã®MicrodataããŒãã¯itemscopeå±æ§ã§ããŒã¯ããããã¹ããããMicrodataããŒããitemscopeå±æ§ã§ããŒã¯ãããŸãã ã°ã«ãŒãã«é¢ããæ å ±ãäŒèšã«ãŒãã«è¿œå ããŸãããã
<article itemscope itemtype="http://example.org/biography"> ... <li> <div itemscope itemprop="band"> <h3>My band</h3> <ul> <li>Name: <span itemprop="name">Conquest of Steel</span></li> <li>Band: <span itemprop="style">Heavy metal</span></li> <li>Members: <span itemprop="size">5</span></li> </ul> </div> </li> ... </article>
ç°ãªãããããã£ã1ã€ã®ååã 1ã€ã®ããããã£ãç°ãªãåå
ããšãã°ã次ã®ããã«ãè€æ°ã®èŠçŽ ã«åãããããã£åãæå®ã§ããŸãã
<li>Members: <ul> <li itemprop="member">Claymore Clark</li> <li itemprop="member">DD Danger</li> <li itemprop="member">Dan Durrant</li> <li itemprop="member">Chris Mills</li> <li itemprop="member">Vic Victory</li> </ul> </li>
ãã®çµæã5ã€ã®ããããã£ãæã€MicrodataããŒããäœæãããŸãããã¹ãŠã®ããããã£ã®ååã¯ãmemeberãã§ãããããã«ç¬èªã®å€ããããŸãã
ãŸããéã«ã1ã€ã®èŠçŽ ã«è€æ°ã®ããããã£ãé 眮ããŠããããã®ããããã£ã«åãå€ãäžããããšãã§ããŸãã
<li>Band: <span itemprop="style favouritemusic">Heavy metal</span></li>
itemcopeèŠçŽ ã®å€åŽã®ããããã£ãæã
MicrodataããŒãã«ããã®å¥ïŒèŠçŽ ïŒã®å€éšã§å®éã«å®çŸ©ãããŠããªãããããã£ãå«ããå ŽåããããŸãã ãããè¡ãã«ã¯ã itemrefå±æ§å ã®å€éšããããã£ã®IDãåç §ããŸãã 次ã®äŸãèããŠã¿ãŸãããããã®äŸã§ã¯ãã°ã«ãŒãã®ã¡ã³ããŒãèŠçŽ ã®å€ã§htmlããŒã¯ã¢ããã®å¥ã®å Žæã«ç§»åããŸããã
<article> ... <li> <div itemscope itemprop="band" itemref="members"> <h3>My band</h3> <ul> <li>Name: <span itemprop="name">Conquest of Steel</span></li> <li>Band: <span itemprop="style">Heavy metal</span></li> <li>Members: <span itemprop="bandsize">5</span></li> </ul> </div> </li> </ul> </article> <ul id="members"> <li itemprop="member">Claymore Clark</li> <li itemprop="member">DD Danger</li> <li itemprop="member">Dan Durrant</li> <li itemprop="member">Chris Mills</li> <li itemprop="member">Vic Victory</li> </ul>
ãã®å Žåããã¡ã³ããŒãããããã£ã¯ãMicrodataã¢ã€ãã ã®itemrefå±æ§ãåç §ããèå¥åãæã€èŠçŽ å ã«ãããŸãã
: ID itemref . : itemref="members instruments gigdates"
åŸã§äœ¿çšã§ããMicrodataããŒãã®ããããã£ãã£ã¯ã·ã§ããªã®å®çŸ©
MicrodataããŒã¯ã¢ãããèªåã§äœ¿çšããéãããã¹ãŠãåé¡ãããŸãããMicrodataããŒãã®ããããã£ã»ãããèªåã§å®çŸ©ããŸãã ãã ããä»ã®Webéçºè ãšäœæ¥ããå Žåãç¹å®ã®MicrodataããŒãã®ããããã£ãã£ã¯ã·ã§ããªãå®çŸ©ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ã itemtypeå±æ§ã䜿çšããŠåããŒãã«ã¿ã€ããæå®ããŸãã ãã®å±æ§ã®å€ã¯URLã®åœ¢åŒã§ããããã®URLã«ãã£ãŠåç §ããããªãœãŒã¹ã¯ååšããå Žåãšååšããªãå ŽåããããŸãã URLãä»ã®ãŠãŒã¶ãŒã«ããããã£ãã£ã¯ã·ã§ããªã«ã€ããŠéç¥ããã€ã³ã¿ãŒãããäžã®å®éã®ããŒãžã«ãã€ã³ããããšè¯ãã§ãããããããå¿ èŠã¯ãããŸããã
äŸã«æ»ããŸãããã
<article itemscope itemtype="http://example.org/biography"> ... <div itemscope itemprop="band" itemtype="http://example.org/band" itemref="members"> ... </div> ... </article>
MicrodataããŒãã¯1ã€ã®ã¿ã€ãã®ã¿ãæã€ããšãã§ããã¿ã€ãã¯ããããã£ã®ãã£ã¯ã·ã§ããªãå®çŸ©ããŸãã ãããã£ãŠããã®äŸã§ã¯ãã¿ã€ãexample.org/biographyã®èŠçŽ ã«ã¯ãååãã¹ã¿ã€ã«ããã³ããµã€ãºãããã³ã¡ã³ããŒãšãã4ã€ã®ããããã£ããããŸãã ããã«ãããåæ§ã®ããããã£åãšã®æ··ä¹±ãé¿ããããšãã§ããŸãã Microdataã䜿çšããŠãåãããããã£itemprop = "member"ã§ãcourt審ã«é¢ããæ å ±ãããŒã¯ã¢ããããããšãã§ããŸãããããã¯ç°ãªãããããã£ã«ãªããŸãã MicrodataããŒãã«ã¯ãå¥ã®itemtypeããã ãŸã -â example.org/jury âããŸãã¯ãã®ä»ã®ä»»æã®éžæã
ä¿¡é Œæ§ãæè»æ§ãããã³æ¡åŒµæ§ãéžæããããã«ã䜿çšããããããã£ãã£ã¯ã·ã§ããªã«ã€ããŠæ éã«æ€èšããå¿ èŠããããŸãã詳现ãšãã³ãã«ã€ããŠã¯ãããã£ã¯ã·ã§ããªã®å®çŸ©ãä»æ§ã®ã»ã¯ã·ã§ã³ã ååã®éžæããåç §ããŠãã ããã ãŸãããŠã§ããæ€çŽ¢ããå¿ èŠããããŸããããããã誰ããããªãã®ç®çã«åã£ãé©åãªèŸæžããã§ã«æžããŠãããããããŸããã vCardãvEventãªã©ã®ãã€ã¯ããã©ãŒããããã移è¡ãããæ¢åã®ãã£ã¯ã·ã§ããªã«ã€ããŠã¯ãã ãã€ã¯ãããŒã¿ãã£ã¯ã·ã§ããªã®ä»æ§ãã»ã¯ã·ã§ã³ãã芧ãã ããã
MidrodataããŒãã®ã°ããŒãã«èå¥åã®å²ãåœãŠ
æžç±ã®ISBNãã¹ãã¢å ã®è£œåã®UPCãªã©ã決æžèå¥åã®å¥çŽã«ãã£ãŠæ¢ã«èå¥åãå²ãåœãŠãããŠãããã®ããããŸãã äžéšã®Microdataãã£ã¯ã·ã§ããªã¯ãããã®èå¥åããµããŒãããŸãïŒãã®ãããªè³ªåã¯èªåã§èª¿ã¹ãå¿ èŠããããŸãããã®ãããç¬èªã®ããããã£ãã£ã¯ã·ã§ããªãäœæãããšãã¯ã itemtypeå±æ§ã§æå®ãããURLã«è³ªåãæžãããšããå§ãããŸãïŒ åæ§ã®èå¥åã䜿çšããå Žåã itemscopeãšitemtypeãæå®ããåãèŠçŽ ã®itemidå±æ§ã§æå®ããŸãã ãã®ãããªããŒã¯ã¢ãããç解ããŠããã¯ããŒã©ãŒãŸãã¯æ€çŽ¢ãšã³ãžã³ïŒãã®ãããªããŒã¯ã¢ããã¯ãŸã ãããŸããïŒã¯ãã³ã³ãã³ããåãitemidãæã€ä»ã®ã³ã³ãã³ããšåãISBN / UPCãªããžã§ã¯ãã§ããããšãç解ããŸãã ããã«ããããã¯ãŒã¯ãæèãåãæ»ãããã·ã³ãç«ã¡äžãããŸã§ãæ å ±ãã¹ã ãŒãºã«èç©ã§ããŸãã
ããšãã°ã次ã®ããŒã¯ã¢ããã¯ã example.com / bookãã£ã¯ã·ã§ããªãISBNèå¥åã®äœ¿çšãæ瀺çã«æ瀺ããŠããå Žåã«ã®ã¿åŠçãããŸãïŒããã«ã€ããŠã¯åŸã§è©³ãã説æããŸãïŒã
<article itemscope itemtype="http://example.com/book" itemid="urn:isbn:978-0321703521"> <h2 itemprop="title">InterACT with web standards</h2> <p>Authors:</p> <ul> <li itemprop="author">Leslie Jensen-Inman</li> <li itemprop="author">Chris Mills</li> <li itemprop="author">Glenda Sims</li> <li itemprop="author">Aarron Walter</li> ...
Microdata DOM API
microdataã¯ãDOM APIã䜿çšããŠjavascriptã䜿çšããŠããŒãžäžã®ããŒããšãã®ããããã£ãæäœããããããæ å ±ãæ€çŽ¢æ¹æ³ã§è¡šç€ºããããä»ã®ã¢ããªã±ãŒã·ã§ã³ã«é ä¿¡ããããããšããã«äŸ¿å©ã«ãªããŸãã
APIã¯éåžžã«åçŽã§ã-document.getItemsïŒïŒé¢æ°ã䜿çšããŠãããŒãžäžã®ãã¹ãŠã®MicrodataããŒããå«ãNodelistãªããžã§ã¯ããååŸããŸãïŒç¿»èš³è 泚ïŒãã¹ãŠã®æäžäœã¬ãã«ã®ããŒãã®ã¿ãã€ãŸããä»ã®ããŒãã«ãã¹ããããŠãããã itempropå±æ§ãæã¡ãŸããïŒã åŒæ°ãªãã§é¢æ°ãåŒã³åºããšããã¹ãŠã®MicrodataããŒãã®ãªã¹ããååŸãããŸãã ãŸãã¯ãåŒã³åºããã©ã¡ãŒã¿ãŒãšããŠæž¡ãããšã§ãæ¢ããŠããã¢ã€ãã ã¿ã€ããæå®ã§ããŸãããã®å Žåãé¢æ°ã¯ãã¢ã€ãã ã¿ã€ãããã©ã¡ãŒã¿ãŒã«çããMicrodataããŒãã§ã®ã¿Nodelistãè¿ããŸãã äŸïŒ
var biography = document.getItems("http://example.org/biography");
çµæŽããŒããè¿ããå€æ°ã«ä¿åããŸãã ããŒããåãåã£ãåŸãããããã£ããããã£ã䜿çšããŠãã®ããããã£ãæäœã§ããŸãã
var biography = document.getItems("http://example.org/biography")[0]; alert('Hi there ' + biography.properties['name'][0].textContent + '!');
ãããŠãçå£ã«è€éãªãã®ã¯äœããããŸããã microdata DOM APIä»æ§ã®äœ¿çšã§åŠç¿ããä»ã®äŸãèŠã€ããããšãã§ããŸãã ããã«ã PhilipJÀgenstedtã¯éåžžã«ãšã¬ã¬ã³ããªã©ã€ã microdataãã¥ãŒã¢ãäœæããŸãããããã¯ã³ãŒãã®ãã§ãã¯ã«éåžžã«äŸ¿å©ã§ãããMicrodataãJSONãªã©ã®ããŸããŸãªåœ¢åŒã«ãã°ããå€æããããã«ã䜿çšã§ããŸãã
Microdata. , Opera Microdata, W3C
ãã€ã¯ãããŒã¿ã®ç°¡åãªã¬ãã¥ãŒã¯çµäºããŸããã ãããããã®èå³æ·±ãæ°ãããã¯ãããžãŒã®ç解ã«åœ¹ç«ã€ããšãé¡ã£ãŠããŸãã ãæèŠããèãããã ããããŸããmicrodataããµããŒãããOperaã®ãã€ããããã«ããã芧ãã ãã ã
翻蚳è ããïŒ
ãã®èšäºã¯8æããDev.Operaã«èŒã£ãŠããã誰ã翻蚳ããŠããŸããã ãªããªã ãã®èšäºã¯æ³šç®ã«å€ãããã®ã§ãããå€ãã®éçºè ã«ãšã£ãŠèå³æ·±ããã®ã«ãªãã§ããããç§ã¯ãã®äžæ£ãä¿®æ£ããèªç±ãåããŸããã ç§ã¯è±èªã®ç¥èã翻蚳çµéšããªãã®ã§ã翻蚳ã«äžæ£ç¢ºãªç¹ãèŠã€ããããç§ã«å人çã«æžããŠãã ããã ãã®èšäºãä»ã®ããã°ã«ãµãããããšæããªããç§ã«å人çã«æžããŠãã ãã