Changing the name of a standard attribute

The Data Ingest Web Service allows you to rename a standard attribute on records in a running data domain.

You use the replaceAssignments element in an updateRecords to rename attributes.

When you rename an attribute, the Data Ingest Web Service removes the name of the attribute that was previously specified in the mdex-property_Key of the PDR of this attribute, and replaces it with the new name. All records retain assignments on this attribute, and the Dgraph process of the Oracle Endeca Server continues to run.

Important: Before renaming a standard attribute, remove it from groups or entities (used for views in Studio). If you rename the attribute without removing it from groups or entities, you will invalidate these groups or entities.

You can rename any standard attribute on the records in your data domain. You cannot rename a managed attribute (except by renaming the associated standard attribute). You also cannot rename an attribute on any system record, such as PDRs, DDRs, or system attributes that define groups.

You cannot include any other updates inside the updateRecords request for renaming an attribute. Also, if the entire ingestChanges request contains additional updateRecords elements, they cannot be run on the same attribute that is being renamed.

The request must specify the EQL expression that correctly identifies the name of the attribute to be replaced, using this request format:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ns="http://www.endeca.com/MDEX/ingest/3/0" 
xmlns:ns1="http://www.endeca.com/MDEX/XQuery/2009/09">
 <soapenv:Header/><soapenv:Body>
  <ns:ingestChanges>
   <ns:updateRecords>
    <ns:recordSpecifier>"mdex-property_Key"='oldName'</ns:recordSpecifier>
     <ns:replaceAssignments>
      <ns1:attribute name="mdex-property_Key">newName</ns1:attribute>
    </ns:replaceAssignments>
   </ns:updateRecords>
  </ns:ingestChanges>  
 </soapenv:Body>
</soapenv:Envelope>
where:
  • "mdex-property_Key"='oldName' is the EQL expression that locates the PDR of your attribute, and identifies the current assignment value, oldName, on the mdex-property_Key of the PDR.
  • newName is the new name for the attribute.

If you submit the ingestChanges request after a Transaction Web Service request that starts an outer transaction, the request must specify the outer transaction ID. If no outer transactions have been started, the ID attribute must be omitted in the request.

To rename an attribute:

  1. Ensure that both the data domain's Dgraph process and the Data Ingest Web Service are running.
  2. Create an updateRecords request, similar to the example below that renames an attribute partID with an attribute SKU, and send the request to the Data Ingest Web Service.
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:ns="http://www.endeca.com/MDEX/ingest/3/0" 
    xmlns:ns1="http://www.endeca.com/MDEX/XQuery/2009/09">
       <soapenv:Header/>
       <soapenv:Body>
          <ns:ingestChanges>
             <ns:updateRecords>
                <ns:recordSpecifier>"mdex-property_Key"='partID'</ns:recordSpecifier>
                <ns:replaceAssignments>
                   <ns1:attribute name="mdex-property_Key">SKU</ns1:attribute>
                </ns:replaceAssignments>
             </ns:updateRecords>
          </ns:ingestChanges>
       </soapenv:Body>
    </soapenv:Envelope>
  3. After the request is made, check the ingestChangesResponse to determine if the request transaction was successful.
A successful ingestChangesResponse returned from the above sample request should look like this, indicating that one record has been affected:
<ingest:ingestChangesResponse xmlns:ingest="http://www.endeca.com/MDEX/ingest/3/0">
   <ingest:numPropertiesCreated>0</ingest:numPropertiesCreated>
   <ingest:numRecordsAffected>1</ingest:numRecordsAffected>
   <ingest:numRecordsDeleted>0</ingest:numRecordsDeleted>
</ingest:ingestChangesResponse>