Opengraph W3C 有效吗?

发布于 2024-09-01 04:34:44 字数 247 浏览 8 评论 0 原文

我想知道 opengraph 标记是否是 W3C 有效的, 当我尝试验证它时,我收到以下错误:

Line 14, Column 17: there is no attribute "PROPERTY"
 <meta property="og:site_name" content="sitename">

如果它无效,它会影响我的页面排名和其他搜索引擎算法吗?

是否有可能隐藏这些属性?

I would like to know if the opengraph markup is W3C valid,
I'm getting the following error when I try to validate it:

Line 14, Column 17: there is no attribute "PROPERTY"
 <meta property="og:site_name" content="sitename">

In case it's not valid, will it impact my pagerank and other search engines algo?

Is it possible to cloak those properties?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

猫烠⑼条掵仅有一顆心 2024-09-08 04:34:44

它在普通的 HTML 文档类型中无效,但是您可以使用一个文档类型来验证包括 Open Graph 在内的 XHTML 文档:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

请参阅此问题:属性属性的 HTML 验证错误

It's not valid in the normal HTML doctypes, but there is a doctype you can use to validate XHTML documents including Open Graph:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

See this question: Html validation error for property attribute

靑春怀旧 2024-09-08 04:34:44

不,不是。这就是验证器报告错误的原因。

No, it isn't. That is why the validator reports an error.

永不分离 2024-09-08 04:34:44

<头>
<标题>示例文档

<正文>

已移至 example.org

<html version="HTML+RDFa 1.1" lang="en">
<head>
<title>Example Document</title>
</head>
<body>
<p>Moved to <a href="http://example.org/">example.org</a>.</p>
</body>
</html>

雨轻弹 2024-09-08 04:34:44

这似乎有效:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="http://rdf.data-vocabulary.org/#">

With this seems to work:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="http://rdf.data-vocabulary.org/#">
柳若烟 2024-09-08 04:34:44

这样你就解决了问题:

<!DOCTYPE html>
<html vocab="http://www.w3.org/2011/rdfa-context/rdfa-1.1">

这样你就可以在你的html中使用像这样的行:

<meta property="og:title dc:title" content="m.clinic.pt - Está em boas mãos!">

或者从列出的其他词汇表中使用(http://www.w3.org/2011/rdfa-context/rdfa-1.1) 像这样:

cat:        http://www.w3.org/ns/dcat#
qb:         http://purl.org/linked-data/cube#
grddl:      http://www.w3.org/2003/g/data-view#
ma:         http://www.w3.org/ns/ma-ont#
owl:        http://www.w3.org/2002/07/owl#
rdf:        http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfa:       http://www.w3.org/ns/rdfa#
rdfs:       http://www.w3.org/2000/01/rdf-schema#
rif:        http://www.w3.org/2007/rif#
rr:         http://www.w3.org/ns/r2rml#
skos:       http://www.w3.org/2004/02/skos/core#
skosxl:     http://www.w3.org/2008/05/skos-xl#
wdr:        http://www.w3.org/2007/05/powder#
void:       http://rdfs.org/ns/void#
wdrs:       http://www.w3.org/2007/05/powder-s#
xhv:        http://www.w3.org/1999/xhtml/vocab#
xml:        http://www.w3.org/XML/1998/namespace
xsd:        http://www.w3.org/2001/XMLSchema#
prov:       http://www.w3.org/ns/prov#
sd:         http://www.w3.org/ns/sparql-service-description#
org:        http://www.w3.org/ns/org#
gldp:       http://www.w3.org/ns/people#
cnt:        http://www.w3.org/2008/content#
dcat:       http://www.w3.org/ns/dcat#
earl:       http://www.w3.org/ns/earl#
ht:         http://www.w3.org/2006/http#
ptr:        http://www.w3.org/2009/pointers#
cc:         http://creativecommons.org/ns#
ctag:       http://commontag.org/ns#
dc:         http://purl.org/dc/terms/
dc11:       http://purl.org/dc/elements/1.1/
dcterms:    http://purl.org/dc/terms/
foaf:       http://xmlns.com/foaf/0.1/
gr:         http://purl.org/goodrelations/v1#
ical:       http://www.w3.org/2002/12/cal/icaltzd#
og:         http://ogp.me/ns#
rev:        http://purl.org/stuff/rev#
sioc:       http://rdfs.org/sioc/ns#
v:          http://rdf.data-vocabulary.org/#
vcard:      http://www.w3.org/2006/vcard/ns#
schema:     http://schema.org/
describedby:http://www.w3.org/2007/05/powder-s#describedby
license:    http://www.w3.org/1999/xhtml/vocab#license
role:       http://www.w3.org/1999/xhtml/vocab#role

您可以通过 http://validator.w3.org/http ://html5.validator.nu/ 非常好。

因此,

<div vocab="http://schema.org/" typeof="Product">
   <img property="image" src="dell-30in-lcd.jpg" />
   <span property="name">Dell UltraSharp 30" LCD Monitor</span>
</div>

您可以使用以下资源:

<!-- The schema: prefix is defined in the vocabulary http://www.w3.org/2011/rdfa-context/rdfa-1.1 -->
<div typeof="schema:Product">
   <img property="schema:image" src="dell-30in-lcd.jpg" />
   <span property="schema:name">Dell UltraSharp 30" LCD Monitor</span>
</div>

一些资源 http://www.w3.org/ TR/rdfa-primer/ http://manu.sporny.org/2012/神话差异/ http://rdfa.info/

With this you are solving the issue:

<!DOCTYPE html>
<html vocab="http://www.w3.org/2011/rdfa-context/rdfa-1.1">

With this you can use lines in your html like this:

<meta property="og:title dc:title" content="m.clinic.pt - Está em boas mãos!">

or from other vocabularies listed (http://www.w3.org/2011/rdfa-context/rdfa-1.1) like this one:

cat:        http://www.w3.org/ns/dcat#
qb:         http://purl.org/linked-data/cube#
grddl:      http://www.w3.org/2003/g/data-view#
ma:         http://www.w3.org/ns/ma-ont#
owl:        http://www.w3.org/2002/07/owl#
rdf:        http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfa:       http://www.w3.org/ns/rdfa#
rdfs:       http://www.w3.org/2000/01/rdf-schema#
rif:        http://www.w3.org/2007/rif#
rr:         http://www.w3.org/ns/r2rml#
skos:       http://www.w3.org/2004/02/skos/core#
skosxl:     http://www.w3.org/2008/05/skos-xl#
wdr:        http://www.w3.org/2007/05/powder#
void:       http://rdfs.org/ns/void#
wdrs:       http://www.w3.org/2007/05/powder-s#
xhv:        http://www.w3.org/1999/xhtml/vocab#
xml:        http://www.w3.org/XML/1998/namespace
xsd:        http://www.w3.org/2001/XMLSchema#
prov:       http://www.w3.org/ns/prov#
sd:         http://www.w3.org/ns/sparql-service-description#
org:        http://www.w3.org/ns/org#
gldp:       http://www.w3.org/ns/people#
cnt:        http://www.w3.org/2008/content#
dcat:       http://www.w3.org/ns/dcat#
earl:       http://www.w3.org/ns/earl#
ht:         http://www.w3.org/2006/http#
ptr:        http://www.w3.org/2009/pointers#
cc:         http://creativecommons.org/ns#
ctag:       http://commontag.org/ns#
dc:         http://purl.org/dc/terms/
dc11:       http://purl.org/dc/elements/1.1/
dcterms:    http://purl.org/dc/terms/
foaf:       http://xmlns.com/foaf/0.1/
gr:         http://purl.org/goodrelations/v1#
ical:       http://www.w3.org/2002/12/cal/icaltzd#
og:         http://ogp.me/ns#
rev:        http://purl.org/stuff/rev#
sioc:       http://rdfs.org/sioc/ns#
v:          http://rdf.data-vocabulary.org/#
vcard:      http://www.w3.org/2006/vcard/ns#
schema:     http://schema.org/
describedby:http://www.w3.org/2007/05/powder-s#describedby
license:    http://www.w3.org/1999/xhtml/vocab#license
role:       http://www.w3.org/1999/xhtml/vocab#role

You can validate it through http://validator.w3.org/ or http://html5.validator.nu/ very well.

So instead of this:

<div vocab="http://schema.org/" typeof="Product">
   <img property="image" src="dell-30in-lcd.jpg" />
   <span property="name">Dell UltraSharp 30" LCD Monitor</span>
</div>

You can have this:

<!-- The schema: prefix is defined in the vocabulary http://www.w3.org/2011/rdfa-context/rdfa-1.1 -->
<div typeof="schema:Product">
   <img property="schema:image" src="dell-30in-lcd.jpg" />
   <span property="schema:name">Dell UltraSharp 30" LCD Monitor</span>
</div>

Some resources http://www.w3.org/TR/rdfa-primer/ http://manu.sporny.org/2012/mythical-differences/ http://rdfa.info/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文