﻿
== Harvesting associations 

=== Storing the GetAssocations response in an ebRIM CSW catalogue.

To properly harvest the GetAssocations response it is important that each
object returned either as a part of the source or the target also be harvested
into the catalogue. This can accomplished in a number of ways but the following
basic algorithm below should be used as a guideline. 

. Harvest the service the containing the GetAssociations operation first as the
generated UUIDs will be needed to create the proper ebRIM Association objects

. For each Association returned from the GetAssociations response:

.. Process the Source object:

... Use the Identifier value and the generated ebRIM service id to retrieve the Identifier's ebRIM id

.. Process the Target object:

... Use the xlink:href parameter to retrieve the associated ebRIM service id for the Target object in the ebRIM database

.... If the service does not exist in the catalogue it will need to be harvested

... Use the Identifier value and namespace attribute to retrieve the Identifier's ebRIM id

.. Using the ebRIM id retrieved for the Source, the Association's rel attribute value and the ebRIM id retrieved for the Target object, create an ebRIM Association object.

. Once all associations have been processed the generated ebRIM Association objects should submitted has part of an ebRIM transactiont document.

The figure _<<ebRIM_catalogue_view,ebRIM Catalogue View>>_ presents a typical
view of what the various ebRIM Associations might look like in an ebRIM
database once all the appropriate services and other objects have been
successfully harvested.

[[ebRIM_catalogue_view]]
. ebRIM Catalogue View
image::includes/images/ebRIMCatalogueView.png["ebRIM_catalogue_view",scaledwidth="70%",align="center"]
