試圖在語義上標記關於特定地址的報告頁面。該頁面提供有關該地址能耗的報告,並提供與能耗相關的服務報價。我想在語義上表示地址的地址,與地址相關的能源報告以及地址可用的報價。現在,我的標記有一個RDFa lite節點用於放置,另一個節點用於優惠。建立這些事情之間關係的最佳方式是什麼?例如能源報告和這個地方的相關報價?如何建立rdfa lite節點之間的關係
<!DOCTYPE html>
<html version="HTML+RDFa 1.1" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Energy Report For 1 main st, townville, ca</title>
</head>
<body>
<div xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:gr="http://purl.org/goodrelations/v1#"
xmlns:pto="http://www.productontology.org/id/"
xmlns:foo="http://example.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<div vocab="http://schema.org/" typeof="Place" additionaltype="Offer" resource="#energyreport">
<h1 property="name">Energy Assessment for <div property="address" resource="#address" typeof="PostalAddress">
<span property="streetAddress">1 main st.
</span> <span property="addressLocality">townville</span>,
<span property="addressRegion">ca</span></div></h1>
<span property="description">Energy Potential for 1 main st., townville, ca. Explore installation offers. Find the best choice for your home.
</span>
</div>
<div vocab="http://schema.org/" resource="#offer" typeof="Offer">
<!-- The offer to sell it -->
<div about="#offer" >
<div property="name">Energy Offerings</div>
<div rel="gr:hasBusinessFunction" resource="http://purl.org/goodrelations/v1#Sell"></div>
<div rel="gr:includes">
<!-- The object -->
<div about="#myObject" typeof="http://www.productontology.org/id/Energy">
<div rel="rdf:type" resource="http://purl.org/goodrelations/v1#SomeItems"></div>
<div property="gr:description" xml:lang="en">Offer Details For Premium Lease Option</div>
<div property="gr:name" xml:lang="en">Premium Lease</div>
</div>
</div>
<div rel="foaf:page" resource="http://URI_of_the_page_containing_the_offer"></div>
<div rel="gr:hasPriceSpecification">
<div typeof="gr:UnitPriceSpecification">
<span property="gr:hasCurrency" content="USD" datatype="xsd:string">$</span>
<span property="gr:hasCurrencyValue" datatype="xsd:float">2.5</span>
</div>
</div>
</div>
</div>
</div>
</body>
謝謝你,有道理。你認爲在任何詞彙表中都不存在頂級模式類型存在任何問題。所以如果報告是有報價並有地址的報告,報告是不是真的在任何地方定義的東西,或者它會讓我能夠定義這些東西。我認爲創造頂級水平的原因是,報告將是一個地方的語義表示,其中包含能源報告並提供相關報價。 –
@SeanParker如果你可以找到一個已經有你需要的屬性的詞彙,那麼最好使用這些屬性,但是也可以定義你自己的屬性和類。儘管如此,你應該使用絕對IRI,這樣你就可以得到像雖然。 –