def _setup_ncom(self):
        # TODO: some or all of this (or some variation) should move to DAMS

        # Create and register the necessary resources/objects

        # Create DataProvider
        dprov = ExternalDataProvider(institution=Institution(), contact=ContactInformation())
#        dprov.institution.name = "OOI CGSN"
        dprov.contact.name = "Robert Weller"
        dprov.contact.email = "*****@*****.**"

        # Create DataSource
        dsrc = DataSource(protocol_type="DAP", institution=Institution(), contact=ContactInformation())
        #        dsrc.connection_params["base_data_url"] = "http://ooi.whoi.edu/thredds/dodsC/"
        dsrc.connection_params["base_data_url"] = ""
        dsrc.contact.name="Rich Signell"
        dsrc.contact.email = "*****@*****.**"

        # Create ExternalDataset
        dset = ExternalDataset(name="test", dataset_description=DatasetDescription(), update_description=UpdateDescription(), contact=ContactInformation())

        #        dset.dataset_description.parameters["dataset_path"] = "ooi/AS02CPSM_R_M.nc"
        dset.dataset_description.parameters["dataset_path"] = "test_data/ncom.nc"
        dset.dataset_description.parameters["temporal_dimension"] = "time"
        dset.dataset_description.parameters["zonal_dimension"] = "lon"
        dset.dataset_description.parameters["meridional_dimension"] = "lat"

        # Create ExternalDataSourceModel
        dsrc_model = ExternalDataSourceModel(name="dap_model")
        dsrc_model.model = "DAP"
        dsrc_model.data_handler_module = "eoi.agent.handler.dap_external_data_handler"
        dsrc_model.data_handler_class = "DapExternalDataHandler"

        ## Run everything through DAMS
        #TODO: Uncomment when CRUD methods in DAMS are implemented
        #        self.ncom_ds_id = self.dams_cli.create_external_dataset(external_dataset=dset)
        #        ext_dprov_id = self.dams_cli.create_external_data_provider(external_data_provider=dprov)
        #        ext_dsrc_id = self.dams_cli.create_data_source(data_source=dsrc)

        self.ncom_ds_id, _ = self.rr_cli.create(dset)
        ext_dprov_id, _ = self.rr_cli.create(dprov)
        ext_dsrc_id, _ = self.rr_cli.create(dsrc)
        #TODO: this needs to be added to DAMS
        ext_dsrc_model_id, _ = self.rr_cli.create(dsrc_model)

        ## Associate everything
        self.rr_cli.create_association(self.ncom_ds_id, PRED.hasSource, ext_dsrc_id)
        log.debug("Associated ExternalDataset %s with DataSource %s" % (self.ncom_ds_id, ext_dsrc_id))
        self.rr_cli.create_association(ext_dsrc_id, PRED.hasProvider, ext_dprov_id)
        log.debug("Associated DataSource %s with ExternalDataProvider %s" % (ext_dsrc_id, ext_dprov_id))
        self.rr_cli.create_association(ext_dsrc_id, PRED.hasModel, ext_dsrc_model_id)
        log.debug("Associated DataSource %s with ExternalDataSourceModel %s" % (ext_dsrc_id, ext_dsrc_model_id))
        data_prod_id = self.dams_cli.register_external_data_set(self.ncom_ds_id)
        log.debug("Registered ExternalDataset {%s}: DataProducer ID = %s" % (self.ncom_ds_id, data_prod_id))
    def _setup_hfr(self):
        # TODO: some or all of this (or some variation) should move to DAMS

        # Create and register the necessary resources/objects

        # Create DataProvider
        dprov = ExternalDataProvider(institution=Institution(), contact=ContactInformation())
#        dprov.institution.name = "HFR UCSD"

        # Create DataSource
        dsrc = DataSource(protocol_type="DAP", institution=Institution(), contact=ContactInformation())
        dsrc.connection_params["base_data_url"] = "http://hfrnet.ucsd.edu:8080/thredds/dodsC/"

        # Create ExternalDataset
        dset = ExternalDataset(name="UCSD HFR", dataset_description=DatasetDescription(), update_description=UpdateDescription(), contact=ContactInformation())
        dset.dataset_description.parameters["dataset_path"] = "HFRNet/USEGC/6km/hourly/RTV"
        dset.dataset_description.parameters["temporal_dimension"] = "time"
        dset.dataset_description.parameters["zonal_dimension"] = "lon"
        dset.dataset_description.parameters["meridional_dimension"] = "lat"

        # Create ExternalDataSourceModel
        dsrc_model = ExternalDataSourceModel(name="dap_model")
        dsrc_model.model = "DAP"
        dsrc_model.data_handler_module = "eoi.agent.handler.dap_external_data_handler"
        dsrc_model.data_handler_class = "DapExternalDataHandler"

        ## Run everything through DAMS
        #TODO: Uncomment when CRUD methods in DAMS are implemented
        #        self.ncom_ds_id = self.dams_cli.create_external_dataset(external_dataset=dset)
        #        ext_dprov_id = self.dams_cli.create_external_data_provider(external_data_provider=dprov)
        #        ext_dsrc_id = self.dams_cli.create_data_source(data_source=dsrc)

        self.hfr_ds_id, _ = self.rr_cli.create(dset)
        ext_dprov_id, _ = self.rr_cli.create(dprov)
        ext_dsrc_id, _ = self.rr_cli.create(dsrc)
        #TODO: this needs to be added to DAMS
        ext_dsrc_model_id, _ = self.rr_cli.create(dsrc_model)

        self.rr_cli.create_association(self.hfr_ds_id, PRED.hasSource, ext_dsrc_id)
        log.debug("Associated ExternalDataset %s with DataSource %s" % (self.hfr_ds_id, ext_dsrc_id))
        self.rr_cli.create_association(ext_dsrc_id, PRED.hasProvider, ext_dprov_id)
        log.debug("Associated DataSource %s with ExternalDataProvider %s" % (ext_dsrc_id, ext_dprov_id))
        self.rr_cli.create_association(ext_dsrc_id, PRED.hasModel, ext_dsrc_model_id)
        log.debug("Associated DataSource %s with ExternalDataSourceModel %s" % (ext_dsrc_id, ext_dsrc_model_id))
        data_prod_id = self.dams_cli.register_external_data_set(self.hfr_ds_id)
        log.debug("Registered ExternalDataset {%s}: DataProducer ID = %s" % (self.hfr_ds_id, data_prod_id))