def update_provenance(self,
                          full_provenance=False,
                          start_time=None,
                          end_time=None):
        """
        Writes a ProvDoc for the crime.py script and saves to the collection

        Parameters
        ----------
        full_provenance: bool
        start_time: datetime.datetime
        end_time: datetime.datetime

        Returns
        -------
        """
        prov_obj = ProjectProvenance(database_helper=self.database_helper,
                                     full_provenance=full_provenance)
        prov_doc = prov_obj.prov_doc
        this_script = prov_doc.agent(self.settings.agent,
                                     mcras.PROVENANCE_PYTHON_SCRIPT)

        resource = prov_doc.entity(
            '%s:%s' %
            (self.settings.data_namespace.name, self.settings.base_url))

        if full_provenance:
            this_run = prov_doc.activity(
                '%s:a%s' % (mcras.LOG_NAMESPACE.name, str(uuid.uuid4())))
            prov_doc.used(this_run, resource)
        else:
            this_run = prov_doc.activity(
                '%s:a%s' % (mcras.LOG_NAMESPACE.name, str(uuid.uuid4())),
                start_time, end_time, {
                    prov.model.PROV_TYPE: mcras.PROVENANCE_ONT_RETRIEVAL,
                    mcras.PROV_ONT_QUERY: '?' + self.query
                })

            prov_doc.used(this_run, resource, start_time)

        prov_doc.wasAssociatedWith(this_run, this_script)

        data_doc = prov_doc.entity(
            '%s:%s' % (mcras.DAT_NAMESPACE.name, self.settings.data_entity), {
                prov.model.PROV_LABEL: 'Crimes Committed',
                prov.model.PROV_TYPE: mcras.PROV_ONT_DATASET
            })

        prov_doc.wasAttributedTo(data_doc, this_script)
        if full_provenance:
            prov_doc.wasGeneratedBy(data_doc, this_run)
        else:
            prov_doc.wasGeneratedBy(data_doc, this_run, end_time)

        prov_doc.wasDerivedFrom(data_doc, resource, this_run)

        if full_provenance:
            prov_obj.write_provenance_json()
        else:
            self.database_helper.record(prov_doc.serialize())
    def update_provenance(self, full_provenance=False, start_time=None, end_time=None):
        """
        Writes a ProvDoc for the hospital_distances.py script and saves to the collection

        Parameters
        ----------
        full_provenance: bool
        start_time: datetime.datetime
        end_time: datetime.datetime

        Returns
        -------
        """
        prov_obj = ProjectProvenance(database_helper=self.database_helper, full_provenance=full_provenance)
        prov_doc = prov_obj.prov_doc
        this_script = prov_doc.agent(self.settings.agent, mcras.PROVENANCE_PYTHON_SCRIPT)

        resource_hospitals = \
            prov_doc.entity('%s:%s' % (self.settings.data_namespace.name, self.settings.base_url))
        resource_properties = \
            prov_doc.entity('%s:%s' % (self.settings.data_namespace.name, self.settings.resource_properties))

        if full_provenance:
            this_run = prov_doc.activity('%s:a%s' % (mcras.LOG_NAMESPACE.name, str(uuid.uuid4())))
            prov_doc.used(this_run, resource_hospitals)
            prov_doc.used(this_run, resource_properties)
        else:
            this_run = prov_doc.activity('%s:a%s' % (mcras.LOG_NAMESPACE.name, str(uuid.uuid4())), start_time, end_time,
                                         {prov.model.PROV_TYPE: mcras.PROV_ONT_EXTENSION})

        prov_doc.wasAssociatedWith(this_run, this_script)

        data_doc = prov_doc.entity('%s:%s' % (mcras.DAT_NAMESPACE.name, self.settings.data_entity),
                                   {prov.model.PROV_LABEL: 'Hospital Locations',
                                    prov.model.PROV_TYPE: mcras.PROV_ONT_DATASET})

        prov_doc.wasAttributedTo(data_doc, this_script)
        if full_provenance:
            prov_doc.wasGeneratedBy(data_doc, this_run)
        else:
            prov_doc.wasGeneratedBy(data_doc, this_run, end_time)

        prov_doc.wasDerivedFrom(data_doc, resource_hospitals, this_run)
        prov_doc.wasDerivedFrom(data_doc, resource_properties, this_run)

        if full_provenance:
            prov_obj.write_provenance_json()
        else:
            self.database_helper.record(prov_doc.serialize())