RDFa

From Creative Commons
跳转到:navigation,search

RDFa is a way of expressing RDF in XHTML. Creative Commons uses RDFa to express license and other information about works for the semantic web. When you select a license in ourlicense chooser, you are given a snippet of HTML that contains RDFa. Sites likeThingiversehave implemented RDFa across their platform so that every object uploaded expresses semantic information about itself to machines.

By using RDFa, Creative Commons is helping build the semantic web. Here are some frequently asked questions which can help you understand RDFa and the semantic web.

What is the point of the semantic web?

Traditionally, machines have had a very poor understanding of what humans are actually talking about when they create content. Computers may understand that a file is a text file or another file is an image file, but they typically don't understand what knowledge, or semantics, are expressed inside that file. This has been remedied to some extent by metadata such astagsorEXIF data.

But to a machine, the web is merely a heap of human-readable-data that needs to be classified by seemingly arbitrary rules. Google and other search engines have engineered meaning out of how humans create HTML documents. By interpreting a link expressed in HTML as a semantically meaningful "vote" for another page, Google can accurately value and rank all linked pages on the web.

While incoming links are good semantic indicators of value (or popularity) of a page, web pages should be able to express much more sophisticated statements to machines. Currently, web pages only express sophisticated statements to humans, but this can change.

Furthermore, humans should have the ability to query these knowledge statements in sophisticated ways. Just think if you could ask a question to Google about how many US presidents were born in Kentucky and receive an answer not because Google had somehow magically interpreted what you meant, but simply because Google maintained a database of statements about presidents and Kentucky that was trivially easy to query?

语义网背后的愿景是,在web上存储和检索信息不应该要求机器解析人类语言,而应该要求机器解析机器语言。网络有潜力提供大量的结构化信息和已经存在的大量的非结构化信息,如果我们谨慎地创建适当的标准和平台来呈现这些陈述,那么语义网络将成为现实。

What is RDF?

RDF stands for "Resource Description Framework" which is not a particularly informative acronym. Put simply, RDF is the way information is expressed semantically on the web. RDF is constituted bytripleswhich are subject-predicate-objects statements. This lets machines understand human knowledge statements. When many triples are aggregated they are stored in what's called a "triple store." By querying a triple store, we can learn information that might otherwise be hard to gather by just browsing the web with our eyes. As the semantic web evolves, it will become easier to query triple stores using natural language, and hopefully, discover things we wouldn't have ordinarily.

What is an RDF triple?

RDF三元组可以由任何语义上有意义的语句组成。Here are some examples:

  .   .

根据所选择的格式,RDF三元组可以存在于XML或XHTML文件中。

RDFa是什么?

RDFa is a way of expressing RDF triples inside XHTML pages using span tags.

This makes it much easier for people to casually express semantic information in conjunction with a normal web page. While there are many ways to express RDF (such as in serialized XML files that live next to standard web pages), RDFa helps machines and humans read exactly the same content.

Why does CC use RDFa?

卡塔尔vs葡萄牙分析知识共享许可以三种不同的格式表示:人类可读的许可契约、律师可读的法律代码和机器可读的代码。RDFa是我们选择的使我们的许可证可机器读取的方法之一。通过使用RDFa CC许可的对象可以被搜索引擎和自动发现机制发现,而不需要人工手动管理内容目录或列表。

Moreover, by using RDFa CC has made our licenses and their meta data compatible with a larger movement towards the open standard of a semantic web.

How does CC use RDFa?

When creators fill out the "Additional Information" section of our license chooser form, they are given a snippet of XHTML code that contains an image badge, a link to our license, some text, and some span tags. Inside these span tags, RDFa is expressed.

Let's take a look at some example code to learn more about RDFa:

<一个rel = "许可证" href = " //www.familygiver.com/licenses/by/3.0/us/ " > < img a卡塔尔vs葡萄牙分析lt = " Creative Commons许可"风格=“边框宽度:0”src = " http://i.www.familygiver.com/l/by/3.0/us/88x31.png " / > < / > < br / > < span xmlns: dc = " http://purl.org/dc/elements/1.1/ " href = " http://purl.org/dc/dcmitype/Text "属性=“dc:标题”rel = " dc:输入“> RDFa FAQ < / span > < xmlns: cc = " //www.familygiver.com/ns " href = " www.example.com "属性=“cc: attributionName”rel = " cc: attributionURL " > John Doe < / >许可下卡塔尔vs葡萄牙分析知识共享署名3.0美国许可
基于wiki.www.familygiver.com.
超出本许可范围的权限可以通过http://moreperms

Breaking Down RDFa

dc:title/dc:type

dc represents "Dublin Core" which is one of the oldest vocabularies or schemas on the semantic web. The full dublin core is availablehere. It allows one to express typical things like a work's title, or its date. Here you can CC using this to express the work's title which I've fictitiously named RDFa FAQ.

 RDFa FAQ

CC is using a XML name-space abbreviation or "xmlns" for short. This enables CC to use shorthand to refer to the dublin core schema. Instead of having to repeatedly state a URL such ashttp://purl.org/dc/titleto reference the title property, we can simply use dc: and achieve the same thing. This principle works across all RDF.

The dc:type references the Dublin Core definition for "Text" using the rel tag. Rel is used to specify the attribute's relationship to another resource. When rel is used inside a anchor tag, it is specifying that the document at the URL in the href attribute is of a particular relationship to the work. In this case that relationship is the Dublin Core "Type" attribute, and the href is the DC Text specification. Another document Type that could be specified with the href ishttp://purl.org/dc/dcmitype/StillImageorhttp://purl.org/dc/dcmitype/Sound, depending on the medium being licensed.

cc:attributionName/cc:attributionURL

In this case, CC is using its own XML namespace, abbreviated using cc:

John Doe

Again, the property is CC's AttributionName attribute, the value is the content inside the anchor tag (in this case, the fictitious John Doe), and a relationship of cc:AttributionURL is defined as beinghttp://www.example.com. //www.familygiver.com/licenses/by/3.0/">Creative Commons Licensehttp://i.www.familygiver.com/l/by/3.0/88x31.png" />
This work is licensed under a //www.familygiver.com/licenses/by/3.0/>知卡塔尔vs葡萄牙分析识共享署名3.0非移植许可。

dc:source

Similar to dc:title, dc:source specifies where the original source of the file is located.

Based on a work at  wiki.www.familygiver.com

在本例中,它指向这个文档。

cc:morePermissions

Finally, as part of the CC+ protocol, creators can specify a URL where re-users of CC licenses can obtain more rights to the work. Visit the CC+ page for more information and examples of CC+ in action. Here, the nonexistent URL ofhttp://morepermsis used as a placeholder.

超出本许可范围的权限可以通过以下途径获得:http://moreperms

CC Deeds using RDFa and Javascript

CC licenses scrape RDFa metadata from referring pages in order to create a "live" box on the Deed page that suggests how to attribute the work:Attribution box via RDFa and Javascript.pngThis will allow reusers to easily and properly attribute CC licensed works using RDFa.

RDFa是W3C推荐的是什么意思?

TheWorld Wide Web Consortiumagrees to recommend certain standards for helping the web run smoothly. One of those recommendations is thatRDFa be used to expressed license information on the semantic web.

How do I use RDFa?

If you're a creator using CC licenses

Make sure to fill out the "Additional Information" box when selecting your license.

If you're a user of CC licensed works

Make sure to copy the attribution XHTML from the license deed if it is available. Otherwise, feel free to roll your own RDFa span tags.

I'm a developer, how do I implement RDFa into my platform?

Implementing RDFa into your platform shouldn't require much more work than implementing CC, it's merely a matter of adding a couple more print statements inside the RDFa framework detailed above. Just make sure you swap out John Doe's name with the user's name, and fill in the proper license URLs.

Content discovery

A key use case for RDFa is the annotation of resources included or embedded in web pages. Existing annotations apply to the current document. For example,http://example.com/foocontains

cc

This says thathttp://example.com/foo在CC BY 3.0下授权。What about http://example.com/bar.jpg which is displayed inhttp://example.com/foovia a element?

To specify that bar.jpg is licensed, even under a different license, we can qualify the link with an about attribute:

cc

Found inhttp://example.com/foothis says http://example.com/bar.jpg is licensed under CC BY-NC 3.0.

SeeQualifying Other Documents and Document Chunks更多的例子。

TheRDFa highlighter bookmarkletprovides visual cues for statements about included resources.

TheRDFa Triples Lister(for the Google Chrome browser) can help one identify the triples listed on a particular page.

CC Tools

RDFa is used or supported in the following CC tools:


References

Presentations