1.
Microdata annotates the DOM
with scoped name/value pairs from custom vocabularies. Anyone can define a
microdata vocabulary and start embedding custom properties in their own web
pages. Microdata works with name/value pairs. Every microdata vocabulary
defines a set of named properties. Along with named properties, microdata
relies heavily on the concept of “scoping.” Microdata re-uses the hierarchical
structure of the DOM itself to provide a way to say “all the properties within this
element are taken from this
vocabulary.” You can even nest
microdata vocabularies within other vocabularies, all by re-using the natural
structure of the DOM. Microdata is a complement to HTML and works best for
fine-tuning the semantics of data that’s already in the DOM, but the HTML
vocabulary isn’t quite expressive enough. If the data you’re semanti-fying
isn’t in the DOM, you should step back and re-evaluate whether microdata is the
right solution.
2.
To define your own microdata
vocabulary, first, you need a namespace, which is just a URL. The namespace URL
could actually point to a working web page, although that’s not strictly
required. A microdata property name is always declared on an HTML element. The
corresponding property value is then taken from the element’s DOM. For most
HTML elements, the property value is simply the text content of the element.
But there are a handful of exceptions:
“Text
content” doesn’t mean “all the markup inside this element” (like you would get
with, say, the
innerHTML
DOM property). It means “just the text”.
3.
“Adding microdata” to your page
is a matter of adding a few attributes to the HTML elements you already have.
The first thing you always do is declare which microdata vocabulary you’re
using, by adding an itemtype
attribute. The second thing you always do is
declare the scope of the vocabulary, using an itemscope
attribute:
<section itemscope itemtype="http://data-vocabulary.org/Person">
<h1 itemprop="name">Mark Pilgrim</h1>
…
In English, this says
“here is the name property of the http://data-vocabulary.org/Person vocabulary,
and the value of the property is Mark Pilgrim.”
4.
It’s a best practice to put
your documentation about the microdata vocabulary on the vocabulary URL itself.
5.
Microdata doesn’t have a way to
break up runs of text into separate properties. You can’t say “the first 18
characters of this text is one microdata property, and the last 12 characters
of this text is another microdata property.”
6.
A microdata property itself can
be a microdata item. That means we need to add the itemscope
and itemtype
attributes to the element too:
<section itemscope itemtype="http://data-vocabulary.org/Person">
…
<dt>Mailing address</dt>
<dd itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
This is nested
scope — defining a new itemtype
and itemscope
(on the <dd>
element)
within an existing one (on the <section>
element). This nested scope
works exactly like the HTML
DOM
. The <dd>
element has a certain number of child elements, all of which are scoped to the
vocabulary defined on the <dd>
element. Once the <dd>
element is
closed with a corresponding </dd>
tag, the scope reverts to the
vocabulary defined by the parent element (<section>
, in this case).
7.
Technically, any microdata property
can appear more than once.
8.
There are two major classes of
applications that consume HTML, and by extension, HTML5 microdata:
a)
Web browsers
b)
Search engines
For
browsers, HTML5
defines a
set of DOM
APIs
for extracting microdata items,
properties, and property values from a web page. But no one support it. When
Google’s web crawler parses your page and finds microdata properties that
conform to the http://data-vocabulary.org/Person
vocabulary, it parses out
those properties and stores them alongside the rest of the page data. Google
even provides a
handy tool to see how Google “sees” your microdata properties
.
- 大小: 26.4 KB
分享到:
相关推荐
Multi-Document Summarization using Distributed Bag-of-Words Model 是一种有效的多文档摘要技术,它结合了深度学习中的分布式词袋模型和传统文本处理技术,不仅能够快速准确地生成文档摘要,还能较好地保留原文档...
Java Bases Log Framework with Elastic Search Distributed Architecture & MongoDB Map Reduce based Recommendation Logging 建筑学 建筑学 弹性搜索 MongoDB 和 Map Reduce 部署说明 要快速使用 Loggio,您必须...
“Distributed Representations of Words and Phrases and their Compositionality”这个主题主要探讨的是如何通过神经网络模型生成词和短语的分布式表示,以及这些表示如何具有组合性,即如何通过基本单位(单词)...
For courses on Distributed Systems,... No other text examines the underlying principles - and their applications to a wide variety of practical distributed systems - with this level of depth and clarity.
在SQL Server中,Ad Hoc Distributed Queries是一种功能,允许用户执行一次性的分布式查询,无需创建永久性的链接服务器对象。这种特性对于临时的数据整合或者跨数据库的查询非常有用,特别是当需要从不同数据库或...
One of the most challenging problems in computer science for the 21st century is to improve the design of distributed systems where computing devices have to work together as a team to achieve common...
分布式系统 分布式系统学习 ...期待我们在接下去的学习中共同进步! 最新的课程相关可以查看问题,里面是每节课的相关内容。 最新动态 go如何实现gfs 之前的分割线 mit目录下是:mit的6.824《分布式系统》课程 ...
### S7 Distributed Safety V5.4 SP5 UPD1安装包知识点详解 #### 一、概述 S7 Distributed Safety V5.4 SP5 UPD1安装包是一款针对西门子S7系列PLC的安全功能软件更新包。该软件主要用于增强自动化系统中的安全功能...
Internet RFCs and other reference material for protocol specification Common Internet tools (such as nslookup, ping, traceroute, netstat) to observer and evaluate network performance and function An ...
分布式定时任务库 `distributed-cron` 是一个专为 Go 语言设计的高级工具,用于构建可扩展、可靠的分布式系统中的定时任务。它充分利用了 Go 的并发特性,提供了一种高效的方式来管理和执行周期性的任务,同时支持在...
Multiservice indoor distributed antenna system (MS-IDAS) plays an important role in wireless communications. This letter investigates a broadband antenna for MS-IDAS, which is composed of a ...
spring security oauth2.0 完成的demo,分以下几个模块, distributed-security-discovery distributed-security-gateway distributed-security-order distributed-security-uaa
"Distributed Snapshots: Determining Global States of Distributed Systems" 是一个深入探讨此主题的重要资源,尤其对于Java开发者而言,因为Java是构建分布式系统常用的编程语言。分布式快照是一种强大的工具,它...
"This book marks an important landmark in the theory of distributed systems and I highly recommend it to students and practicing engineers in the fields of operations research and computer science, as...
SIMATIC S7 Distributed Safety V5.4 SP5 Update 2