2011-10-12 6 views
13

は私が仕事を得る人については、この簡単なHTMLページがあるとします。schema.orgのアイテムはどのように関連付けるのですか?

<!DOCTYPE HTML> 
<html> 
    <head> 
     <meta charset="utf-8"> 
     <title>New Job for John Doe</title> 
    </head> 
    <body> 
     <h1>New Job for John Doe</h1> 
     <p>This week John Doe accepted an offer to become a Software Engineer at MITRE. John graduated from MIT in 2005 with a BS in Computer Science. He previously worked at a small company near Boston. Blah, blah, blah.</p> 
     <p>The MITRE Corporation is a not-for-profit organization chartered to work in the public interest. The MITRE Corporation has two principal locations: Bedford, Massachusetts, and McLean, Virginia. Blah, blah, blah.</p> 
    </body> 
</html> 

私はschema.orgの語彙を使用してセマンティック・データを追加した場合、それは次のようになります。

<!DOCTYPE HTML> 
<html> 
    <head> 
     <meta charset="utf-8"> 
     <title>New Job for John Doe</title> 
    </head> 
    <body> 
     <h1>New Job for John Doe</h1> 
     <p itemscope itemtype="http://schema.org/Person">This week John Doe accepted an offer to become a <span itemprop="jobTitle">Software Engineer</span> at <span itemprop="worksFor">MITRE</span>. John graduated from <span itemprop="alumniOf">MIT</span> in 2005 with a BS in Computer Science. He previously worked at a small company near Boston. Blah, blah, blah.</p> 
     <p itemscope itemtype="http://schema.org/Corporation">The MITRE Corporation is a not-for-profit organization chartered to work in the public interest. The MITRE Corporation has two principal locations: <span itemprop="location">Bedford, Massachusetts</span>, and <span itemprop="location">McLean, Virginia</span>. Blah, blah, blah.</p> 
    </body> 
</html> 

最初段落は明らかに人、John Doeについてであり、第2段落はMITER Corporationについてのものです。しかし、第1段落の「MITER」は、第2段落の「The MITER Corporation」と同じです。 schema.orgを使用してこれらを明示的に1つに宣言するにはどうすればよいですか?自分の質問に答えるために

答えて

1

私の最初の試みはそうのように、itemref要素の属性を使用していた:

<p itemscope itemtype="http://schema.org/Person"> 
    This week John Doe accepted an offer to become a 
    <span itemprop="jobTitle">Software Engineer</span> 
    at <span itemprop="worksFor" itemref="TheMitreCorporation">MITRE</span>. 
    John graduated from <span itemprop="alumniOf">MIT</span> 
    in 2005 with a BS in Computer Science. 
    He previously worked at a small company near Boston. Blah, blah, blah. 
</p> 

<p itemscope itemtype="http://schema.org/Corporation" id="TheMitreCorporation"> 
    The MITRE Corporation is a not-for-profit organization chartered to work in the public interest. 
    The MITRE Corporation has two principal locations: 
    <span itemprop="location" itemscope itemtype="http://schema.org/Place"> 
     <span itemprop="name">Bedford, Massachusetts</span> 
    </span>, and 
    <span itemprop="location" itemscope itemtype="http://schema.org/Place"> 
     <span itemprop="name">McLean, Virginia</span> 
    </span>. Blah, blah, blah. 
</p> 

しかしコメンターのいくつかは、当然、これは、この属性の権利の使用はなかったと指摘しました。

これは私の2番目の試みです:代わりにitemid属性を使用してください。会社名の両方のインスタンスにはitemscope属性とitemtype属性が与えられ、両方ともURLである同じitemidの値に設定されます。

spec says「itemid属性は、指定されていれば有効なURLである必要があります。スペースのある可能性のあるURLです...アイテムのグローバル識別子は、その要素のitemid属性の値です、属性が指定されている要素に対して解決されました... itemid属性は、itemscope属性とitemtype属性の両方が指定されていない要素には指定しないでください。

<p itemscope itemtype="http://schema.org/Person">This week John Doe accepted an offer to become a <span itemprop="jobTitle">Software Engineer</span> at <span itemprop="worksFor" itemscope itemtype="http://schema.org/Corporation" itemid="http://www.mitre.org">MITRE</span>. John graduated from <span itemprop="alumniOf">MIT</span> in 2005 with a BS in Computer Science. He previously worked at a small company near Boston. Blah, blah, blah.</p> 
<p itemscope itemtype="http://schema.org/Corporation" itemid="http://www.mitre.org">The MITRE Corporation is a not-for-profit organization chartered to work in the public interest. The MITRE Corporation has two principal locations: <span itemprop="location" itemscope itemtype="http://schema.org/Place"><span itemprop="name">Bedford, Massachusetts</span></span>, and <span itemprop="location" itemscope itemtype="http://schema.org/Place"><span itemprop="name">McLean, Virginia</span></span>. Blah, blah, blah.</p> 
+0

私は実際にデータモデルに影響を与えたようには見えませんでした。(http://goo.gl/agxIv)。 – robertc

+2

itemrefは、アイテムスコープの追加のプロパティを指すためにのみ使用されます。したがってこの場合、タグはCorporationのitemtypeである必要があります。 id = "The MitreCorporation"のタグはアイテムスコープにはなりませんでした。 –

4

//更新:Schema.orgは人が会社に関連して明らかに

persoスキーマのその仕様を拡張し、あなたが何ができるか、人と組織のウィットとの関係を作るために「人ですitemprop "affiliation" 私はitemscope itemtype = "Person"で段落を折り返し、itemprop "affiliation"とitemscope itemtype = "Organization"を追加してスキーマPersonを展開しています。組織に所属しています。 it'sは「人」の仕様

<!DOCTYPE HTML> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title>New Job for John Doe</title> 
</head> 
<body> 
<div itemscope itemtype="http://schema.org/Person"> 
    <h1>New Job for John Doe</h1> 
<meta itemprop="name" content="John Doe" /> 
    <p>This week John Doe accepted an offer to become a <span itemprop="jobTitle">Software Engineer</span> at <span itemprop="worksFor">MITRE</span>. John graduated from <span itemprop="alumniOf">MIT</span> in 2005 with a BS in Computer Science. He previously worked at a small company near Boston. Blah, blah, blah.</p> 
    <p itemprop="affiliation" itemscope itemtype="http://schema.org/Organization">The MITRE Corporation is a not-for-profit organization chartered to work in the public interest. The MITRE Corporation has two principal locations: <span itemprop="location">Bedford, Massachusetts</span>, and <span itemprop="location">McLean, Virginia</span>. Blah, blah, blah.</p> 
</div> <!-- closing Schema "Person" --> 
</body> 
</html> 

を満たすために必要なので、私はまたにitemprop =「名前」にメタタグを追加しましたあなたは、Googleの豊富なスニペットテストツールにこれを置くことができると私はアウトプットは、あなたがどこ見て何だと思います

Item 
type: http://schema.org/person 
property: 
name: John Doe 
jobtitle: Software Engineer 
worksfor: MITRE 
alumniof: MIT 
affiliation: Item 1 


Item 1 
type: http://schema.org/organization 
property: 
location: Bedford, Massachusetts 
location: McLean, Virginia