icat.dump_queries — Queries needed to dump the ICAT content

Note

This module is mostly intended as a helper for the icatdump script. Most users will not need to use it directly or even care about it.

ICAT data files are written in chunks. The partition used here is the following:

  1. One chunk with all objects that define authorization (User, Group, Rule, PublicStep).

  2. All static content in one chunk, e.g. all objects not related to individual investigations and that need to be present, before we can add investigations.

  3. FundingReferences.

  4. The investigation data. All content related to individual investigations. Each investigation with all its data in one single chunk on its own.

  5. DataCollections.

  6. DataPublications. All content related to individual data publications, each one in one chunk on its own respectively.

  7. One last chunk with all remaining stuff (Study, RelatedDatafile, Job).

The functions defined in this module each return a list of queries needed to fetch the objects to be included in one of these chunks. The queries are adapted to the ICAT server version the client is connected to.

Changed in version 1.0.0: review the partition to take the schema extensions in ICAT 5.0 into account and include the new entity types.

icat.dump_queries.getAuthQueries(client)

Return the queries to fetch all objects related to authorization.

icat.dump_queries.getStaticQueries(client)

Return the queries to fetch all static objects.

Changed in version 1.0.0: include queries for Technique and DataPublicationType.

icat.dump_queries.getFundingQueries(client)

Return the queries to fetch all FundingReferences.

New in version 1.0.0.

icat.dump_queries.getInvestigationQueries(client, invid)

Return the queries to fetch all objects related to an investigation.

Changed in version 1.0.0: add include clauses for investigationFacilityCycles and fundingReferences into query for Investigation, add include clauses for datasetInstruments and datasetTechniques into query for Dataset.

icat.dump_queries.getDataCollectionQueries(client)

Return the queries to fetch all DataCollections.

New in version 1.0.0.

icat.dump_queries.getDataPublicationQueries(client, pubid)

Return the queries to fetch all objects related to a data publication.

New in version 1.0.0.

Changed in version 1.1.0: return an empty list if the ICAT server is older than 5.0 rather than raising EntityTypeError.

icat.dump_queries.getOtherQueries(client)

Return the queries to fetch all other objects, e.g. not static and not directly related to an investigation.

Changed in version 1.0.0: drop query for DataCollection, now in a separate function getDataCollectionQueries().