2013-07-15 60 views
1

我有一個頁面提及幾個人。他們中的大多數以某種方式連接到彼此。對於這個問題的目的,可以說我有3人:李四,李四,他們的孩子嬰兒李四:交叉引用schema.org'人'數據

<div itemscope itemtype="http://schema.org/Person" id="john"> 
    <span itemprop="name">John Doe</span> 
</div> 
<div itemscope itemtype="http://schema.org/Person" id="jane"> 
    <span itemprop="name">Jane Doe</span> 
</div> 
<div itemscope itemtype="http://schema.org/Person" id="baby"> 
    <span itemprop="name">Baby Doe</span> 
</div> 

parses without any problems(使用Live微觀數據)。

現在我想交叉引用這些人與彼此。簡是約翰的妻子。所以我需要一個spouse屬性來匹配。當然,情況也是如此:約翰是簡的丈夫。

寶寶有約翰和簡作爲它的父母。 Ergo約翰和簡應該有嬰兒作爲他們的孩子。

我該如何設置?無論我用itemref嘗試過哪種方法都不成功。

舉例來說,我可以讓嬰兒約翰和簡,但嬰兒兩個孩子將不再是在網頁上的自己的實體:(see parse

<div itemscope itemtype="http://schema.org/Person" id="john" itemref="baby"> 
    <span itemprop="name">John Doe</span> 
</div> 
<div itemscope itemtype="http://schema.org/Person" id="jane" itemref="baby"> 
    <span itemprop="name">Jane Doe</span> 
</div> 
<div itemprop="children" itemscope itemtype="http://schema.org/Person" id="baby"> 
    <span itemprop="name">Baby Doe</span> 
</div> 

反正對我來說,讓所有的人作爲單獨的實體,並仍將其作爲彼此的配偶,兄弟姐妹,父母,孩子等相互參照?頁面上沒有任何中央人員用作主要itemscope

回答

1

如果我對你有所幫助,你不能用schema.org做到這一點。你所說的是「關係」(例如"marriage" in Freebase)。但是schema.org不提供這種抽象。