问题描述
我想以一种无私的方式公开有关我的网站的结构化数据.我也不介意SEO提升,而是次要的.
In an altruistic manner I would like to expose as much structured data about my website.I also wouldn't mind SEO boost but its secondary.
似乎有两个选择:
- 完全了解RDF(立即杀死XML)
- 带有您自己的自定义标签的原子(喜欢) 您网页中的
- RDFa(可能会帮助SEO)
- 都柏林核心元标记
- 使用RDFa的Dublin Core
- 带有RDFa的原子
- Full on RDF (kill me now XML)
- Atom with your own custom tags (liking that)
- RDFa in your webpage (might help SEO)
- Dublin Core Meta tags
- Dublin Core using RDFa
- Atom with RDFa
我只是想让人们更容易地从我的网站上获取数据.
I'm just trying to make it easy for people to get data off my site.
您认为我应该使用哪个?
推荐答案
RDF不仅是XML,而且是XML. RDF是一种数据模型,它依赖于三元组(主题,谓词,对象)和URI的集合来明确地引用事物.实际上,使用RDF的人们倾向于远离RDF/XML,我们更喜欢 RDF/Turtle 或 RDF/Ntriples ,甚至是JSON格式的RDF.这些序列化更具可读性,更易于构造和解析.此外,有许多工具可让您在所有范围的RDF风格之间进行转换(即: rapper 或 Jena ).
RDF is not just XML; RDF is a data model that relies on sets of triples (subject, predicate, object) and URIs to unambiguously refer to things. Actually, people working with RDF tend to run away from RDF/XML and we prefer RDF/Turtle or RDF/Ntriples, even RDF in JSON format. These serializations are more readable, easier to construct and easier to parse. Moreover, there are many tools that allow you to transform between all the range of RDF flavors (i.e: rapper or Jena).
在RDF中发布信息时.通常,您有三种不同的选择:
When it comes to publishing information in RDF. You generally have three different choices:
- 提供数据的RDF转储.
- 要遵循链接数据规则发布RDF.
- 使用RDFa将元数据添加到您现有的网页中.
- To provide RDF dumps of your data.
- To publish RDF following the Linked Data rules.
- To add metadata to your existing Web pages with RDFa.
...这些不是排他性的.您可以将它们组合使用,最重要的是选择正确的URI结构(请参见酷URI不变).
... these are not exclusive. You can go for any combination of them, the most important thing is choosing the correct structure of URIs (see Cool URIs don't change).
按照您的个人资料,我看到您正在社交推荐网站(http://evocatus.com/)上工作.我认为您可能想公开有关这些评论的信息.因此,对于 http://evocatus.com/sauce/cholula-chipolte -hot-sauce/272645/您可以提供不同的序列化并不仅返回HTML,而且还返回:
Following your SO profile I see that you're working on a social taste recommendation website (http://evocatus.com/). I assume that you might want to expose information about those reviews. So for a review like http://evocatus.com/sauce/cholula-chipolte-hot-sauce/272645/ you can provide different serializations and give back not just HTML but also:
- .../holula-chipolte-hot-sauce/272645/rdf-turtle
- .../holula-chipolte-hot-sauce/272645/rdf-xml
- .../holula-chipolte-hot-sauce/272645/rdf-json
- ,以及您要公开的任何其他类型的格式.
此外,可以使用RDFa增强HTML版本.根据使用数据的客户端类型,遵循内容协商规则,您可以将HTTP请求重定向到客户端接受的任何格式.这由HTTP标头Accept
建立.因此,您的应用将重定向RDF/XML版本,如以下带有curl
的请求:
In addition, the HTML version could be enhanced with RDFa. Depending on the type of client that consumes your data, following content negotiation rules, you'll redirect the HTTP request to whichever format is accepted by the client. This is established by the HTTP header Accept
. So a request like the one below with curl
would be redirected by your application giving back the RDF/XML version:
curl -H 'Accept: application/rdf+xml' .../holula-chipolte-hot-sauce/272645/
将来,人们只需在RDF数据中重用您的URI,就可以说出您网站中现有评论的内容.这就是RDF和链接数据的力量.
In the future, people would be able to say things about existing reviews in your site by just reusing your URIs in their RDF data. That's the power of RDF and Linked Data.
关于Dublin Core
,您可以将Dublin Core与RDF或RDFa一起使用.但是,在您的情况下,还需要考虑其他一些有趣的本体,正确的做法是将所有这些本体混合使用:
About Dublin Core
, you could use Dublin Core with either RDF or RDFa. But, in your case there are some other interesting ontologies to consider and the right thing would be to use a mix of all of them:
- FOAF :朋友的朋友",用于表达用户的个人信息和用户之间的关系. li>
- 标签本体:表达标签信息的非常简单的本体
- RDF评论词汇:用于使用RDF表达评论和评分的词汇.
- GoodRelations :表示产品信息和电子商务的本体.
- Vcard/RDF :用于地址,通常与FOAF结合使用.
- FOAF: Friend Of A Friend, to express user personal information and relations between users.
- Tag Ontology: A very simple ontology to express tag information.
- RDF Review Vocabulary: Vocabulary for expressing reviews and ratings using RDF.
- GoodRelations: An ontology to express product information and eCommerce.
- Vcard/RDF: for addresses, normally used in combination with FOAF.
有一个名为 http://revyu.com/的网站,它使用所有这些本体(GoodRelations除外),因此您可以将其用作准则.例如,参见:
There is one site called http://revyu.com/ that uses all these ontologies (except GoodRelations), so you could use it as a guideline. See for instance:
- http://revyu.com/reviews/342b55e79f64d5ca37f633b93c246c6ad6e14b04/about /li>
- http://revyu.com/reviews/342b55e79f64d5ca37f633b93c246c6ad6e14b04/about /li>
- http://revyu.com/reviews/342b55e79f64d5ca37f633b93c246c6ad6e14b04/about/html
- http://revyu.com/reviews/342b55e79f64d5ca37f633b93c246c6ad6e14b04/about/rdf
...这些是同一评论的HTML和RDF版本.
... these are HTML and RDF versions of the same review.
与ATOM不同,如您所见,使用RDF,您将能够重用现有的本体,并且由于RDF基于URI,因此所有内容都将相互链接.
Unlike with ATOM, as you can see, with RDF you would be able to reuse existing ontologies and since RDF is based on URIs everything would be interlinked.
链接数据附加值
如果您花一些时间将您的产品和评论链接到其他数据源,将会发生什么? (即:dbpedia.org或freebase.com).想象一下,通过遵循以下链接,您开始将所有Beer评论(http://evocatus.com/beer/)链接到从(http://dbpedia.org/page/Alcoholic_beverage)生产该产品的任何啤酒厂能够知道例如在哪里生产了优选的啤酒. Dbpedia拥有该信息.
What would happen if you invest sometime linking your products and reviews to other data sources ? (i.e: dbpedia.org or freebase.com). Let's imagine that you start linking all your Beer reviews (http://evocatus.com/beer/) to whatever brewery is manufacturing the product from (http://dbpedia.org/page/Alcoholic_beverage), by following the links you would be able to know for instance where the preferable beers are manufactured. Dbpedia holds that information.
还可以看到在Freebase(也提供RDF版本)中,您可以链接到制造商.例如,请参见 http://rdf.freebase.com/rdf/en.budweiser 在RDF中或 http://www.freebase.com/view/zh/budweiser 中HTML.
Also see that in Freebase, that also provides RDF versions, you could link to manufacturers. For instance see, http://rdf.freebase.com/rdf/en.budweiser in RDF or http://www.freebase.com/view/en/budweiser in HTML.
这篇关于用于公开结构化元数据(都柏林核心,rdf,原子)的格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!