ここでは、コレクションの作成に必要なステップの概要を示します。
この手順では、(一意のプロパティ・キーがProductID標準属性である)Productsおよび(一意のプロパティ・キーがSalesID標準属性である)Salesの2つのコレクションを作成すると仮定しています。また、(収集された場合に)各ソース・レコードが、ProductID属性(この場合はProductsコレクションに属します)またはSalesID属性(この場合はSalesコレクションに属します)のいずれかの割当てを持つと仮定しています。
コレクションを作成する手順:
<listCollectionsResponse xmlns="http://www.endeca.com/endeca-server/sconfig/3/0">
<collectionRecord collectionKey="Products" displayName="Product data" uniquePropertyKey="ProductID">
<description>Collection of Product information</description>
<property key="Locale">US region</property>
<collectionAttributes>
<collectionAttribute propertyKey="Color"/>
<collectionAttribute propertyKey="DealerPrice"/>
...
<collectionAttribute propertyKey="Style"/>
<collectionAttribute propertyKey="Weight"/>
</collectionAttributes>
</collectionRecord>
<collectionRecord collectionKey="Sales" displayName="Sales data" uniquePropertyKey="SalesID">
<description>Collection of Sales information</description>
<property key="Currency">$</property>
<collectionAttributes>
<collectionAttribute propertyKey="FactSales_CurrencyKey"/>
<collectionAttribute propertyKey="FactSales_CustomerPONumber"/>
...
<collectionAttribute propertyKey="FactSales_TotalProductCost"/>
<collectionAttribute propertyKey="FactSales_UnitPrice"/>
</collectionAttributes>
</collectionRecord>
</listCollectionsResponse>
このlistCollectionsResponseでは、ステップ3で作成されたProductsおよびSalesの2つのコレクションが示されています。また、Dgraphによって、コレクションの一意のプロパティ・キーからの割当てを持つレコードから属性がCDRに移入されたことも示されています。