次のレコード例は、標準属性とその値(キー/値ペア)の様々な構成を示します。
各例では、表の各行が単一のレコード(この場合は自転車)を表します。列見出しは標準属性で、各セルには標準属性値(キー/値ペア)が含まれます。
Name | Bike Type | ProductID | Size Range | Color | Number Sold | Price |
---|---|---|---|---|---|---|
Road-450 | Road Bikes | 4038 | 42-46 CM | Red | 171 | 1457.99 |
Road-550-W | Road Bikes | 5213 | 38-40 CM | Yellow | 455 | 1000.48 |
Touring-1000 | Touring Bikes | 8765 | 54-58 CM | Blue | 117 | 2384.07 |
Touring-3000 | Touring Bikes | 4035 | 48-52 CM | Yellow | 221 | 742.35 |
Mountain-300 | Mountain Bikes | 3421 | 38-40 CM | Black | 223 | 1079.99 |
Mountain-500 | Mountain Bikes | 4821 | 38-40 CM | Silver | 176 | 564.99 |
Road-450レコードのXML表現は、次の例のようになります。
<Record> <attribute name="Name" type="mdex:string">Road-450</attribute> <attribute name="ProductID" type="mdex:int">4038</attribute> <attribute name="BikeType" type="mdex:string">Road Bikes</attribute> <attribute name="SizeRange" type="mdex:string">42-46 CM</attribute> <attribute name="Color" type="mdex:string">Red</attribute> <attribute name="NumSold" type="mdex:int">171</attribute> <attribute name="Price" type="mdex:double">1457.99</attribute> </Record>
主キー属性(この場合はProductID属性)に注意してください。主キー属性は、このレコードを一意に識別するためにOracle Endeca Serverによって使用されます。データ・ロードの段階で、どの標準属性を主キー属性にするかを決定します。
この例では、前の例と同じデータを使用しますが、Review Score属性を追加します。Review Score属性では、複数の割当てを持つレコードと、割当てを持たないレコードがあります。
たとえば、Road-450レコードには複数のレビュー・スコアがあり、Touring-3000レコードにはレビュー・スコアがありません。
Name | Bike Type | ProductID | Size Range | Color | Review Score | Price |
---|---|---|---|---|---|---|
Road-450 | Road Bikes | 4038 | 42-46 CM | Red | 35, 45, 60 | 1457.99 |
Road-550-W | Road Bikes | 5213 | 38-40 CM | Yellow | 80, 82 | 1000.48 |
Touring-3000 | Touring Bikes | 4035 | 48-52 CM | Yellow | 742.35 | |
Mountain-500 | Mountain Bikes | 4821 | 38-40 CM | Silver | 76 | 564.99 |
Road-450およびTouring-3000自転車のXML表現は、次の例のようになります。
<Record> <attribute name="Name" type="mdex:string">Road-450</attribute> <attribute name="ProductID" type="mdex:int">4038</attribute> <attribute name="BikeType" type="mdex:string">Road Bikes</attribute> <attribute name="SizeRange" type="mdex:string">42-46 CM</attribute> <attribute name="Color" type="mdex:string">Red</attribute> <attribute name="ReviewScore" type="mdex:int">35</attribute> <attribute name="ReviewScore" type="mdex:int">45</attribute> <attribute name="ReviewScore" type="mdex:int">60</attribute> <attribute name="Price" type="mdex:double">1457.99</attribute> </Record> <Record> <attribute name="Name" type="mdex:string">Touring-3000</attribute> <attribute name="ProductID" type="mdex:int">4035</attribute> <attribute name="BikeType" type="mdex:string">Mountain Bikes</attribute> <attribute name="SizeRange" type="mdex:string">48-52 CM</attribute> <attribute name="Color" type="mdex:string">Yellow</attribute> <attribute name="Price" type="mdex:double">742.35</attribute> </Record>
Road-450レコードのXMLには、各スコアに1つずつ、合計3つのReviewScore要素が含まれます。Touring-3000レコードにはレビュー・スコアがないため、ReviewScore要素は含まれません。