ODMconnection
¶
Read Services
¶
-
class
odm2api.ODM2.services.readService.
DetailedResult
(action, result, sc, sn, method, variable, processingLevel, unit)[source]¶
-
class
odm2api.ODM2.services.readService.
ReadODM2
(session_factory, debug=False)[source]¶ Bases:
odm2api.base.serviceBase
-
InstrumentOutputVariables
(self, modelid=None, variableid=None)[source]¶ - Pass Nothing - return a list of all objects
- Pass ModelID
- Pass VariableID
-
RelatedEquipment
(self, code=None)[source]¶ - Pass nothing - return a list of all objects
- Pass code- return a single object with the given code
-
getActions
(self, ids=None, type=None, sfid=None)[source]¶ - Pass nothing - returns a list of all Actions
- Pass a list of Action ids - returns a list of Action objects
- Pass a ActionTypeCV - returns a list of Action objects of that type
- Pass a SamplingFeature ID - returns a list of Action objects associated with that Sampling feature ID, Found through featureAction table
-
getAffiliations
(ids=None, personfirst=None, personlast=None, orgcode=None)[source]¶ Retrieve a list of Affiliation objects.
If no arguments are passed to the function, or their values are None, all Affiliation objects in the database will be returned.
Parameters: - ids (list, optional) – List of AffiliationIDs.
- personfirst (str, optional) – Person First Name.
- personlast (str, optional) – Person Last Name.
- orgcode (str, optional) – Organization Code.
Returns: List of Affiliation objects
Return type: list
Examples
>>> ReadODM2.getAffiliations(ids=[39,40]) >>> ReadODM2.getAffiliations(personfirst='John', ... personlast='Smith') >>> ReadODM2.getAffiliations(orgcode='Acme')
-
getAnnotations
(type=None, codes=None, ids=None)[source]¶ def getAnnotations(self, type=None, codes = None, ids = None):
- Pass Nothing - return a list of all objects
- Pass AnnotationTypeCV - return a list of all objects of the fiven type
- Pass a list of codes - return a list of objects, one for each of the given codes
- Pass a list of ids -return a list of objects, one for each of the given ids
-
getCVs
(type)[source]¶ getCVs(self, type): * Pass CVType - return a list of all objects of the given type
-
getDataSets
(self, codes=None, uuids=None)[source]¶ - Pass nothing - returns a list of all DataSet objects
- Pass a list of DataSetCode - returns a single DataSet object for each code
- Pass a list of UUIDS - returns a single DataSet object for each UUID
-
getDetailedAffiliationInfo
(self)[source]¶ - Pass Nothing - Return a list of all Affiliations with detailed information, including Affiliation, People and Organization
-
getDetailedResultInfo
(self, resultTypeCV=None, resultID=None, sfID=None)[source]¶ Get detailed information for all selected Results including , unit info, site info, method info , ProcessingLevel info. * Pass nothing - return a list of all objects * Pass resultTypeCV - All objects of given type * Pass a result ID - single object with the given result ID * Pass a SamplingFeatureID - All objects associated with the given sampling feature.
-
getEquipment
(self, codes=None, type=None, sfid=None, actionid=None)[source]¶ - Pass nothing - returns a list of all Equipment objects
- Pass a list of EquipmentCodes- return a list of all Equipment objects that match each of the codes
- Pass a EquipmentType - returns a single Equipment object
- Pass a SamplingFeatureID - returns a single Equipment object
- Pass an ActionID - returns a single Equipment object
-
getExtensionProperties
(self, type=None)[source]¶ - Pass nothing - return a list of all objects
- Pass type- return a list of all objects of the given type
-
getExternalIdentifiers
(self, type=None)[source]¶ - Pass nothing - return a list of all objects
- Pass type- return a list of all objects of the given type
-
getMethods
(ids=None, codes=None, type=None)[source]¶ getMethods(self, ids=None, codes=None, type=None): * Pass nothing - returns full list of method objects * Pass a list of MethodIDs - returns a single method object for each given id * Pass a list of MethodCode - returns a single method object for each given code * Pass a MethodType - returns a list of method objects of the given MethodType
-
getModels
(self, codes=None)[source]¶ - Pass nothing - return a list of all Model Objects
- Pass a list of ModelCodes - get a list of converter objects related to the converter having ModeCode
-
getOrganizations
(self, ids=None, codes=None)[source]¶ - Pass nothing - returns a list of all organization objects
- Pass a list of OrganizationID - returns a single organization object
- Pass a list of OrganizationCode - returns a single organization object
-
getPeople
(self, ids=None, firstname=None, lastname=None)[source]¶ - Pass nothing - returns a list of all People objects
- Pass a list of PeopleID - returns a single People object
- Pass a First Name - returns a single People object
- Pass a Last Name - returns a single People object
-
getProcessingLevels
(self, ids=None, codes=None)[source]¶ - Pass nothing - returns full list of ProcessingLevel objects
- Pass a list of ProcessingLevelID - returns a single processingLevel object for each given id
- Pass a list of ProcessingLevelCode - returns a single processingLevel object for each given code
-
getRelatedActions
(self, actionid=None)[source]¶ - Pass an ActionID - get a list of Action objects related to the input action along with the relatinship type
-
getRelatedModels
(self, id=None, code=None)[source]¶ - Pass a ModelID - get a list of converter objects related to the converter having ModelID
- Pass a ModelCode - get a list of converter objects related to the converter having ModeCode
-
getRelatedSamplingFeatures
(sfid=None, rfid=None, relationshiptype=None)[source]¶ getRelatedSamplingFeatures(self, sfid=None, rfid = None, relationshiptype=None): * Pass a SamplingFeatureID - get a list of sampling feature objects related to the input sampling feature * Pass a RelatedFeatureID - get a list of Sampling features objects through the related feature * Pass a RelationshipTypeCV - get a list of sampling feature objects with the given type
-
getResultValues
(self, resultids, starttime=None, endtime=None)[source]¶ - Pass in a list of ResultID - Returns a pandas dataframe object of type that is specific to the result type -
- The resultids must be associated with the same value type
- Pass a ResultID and a date range - returns a pandas dataframe object of type that is specific to the result type with values between the input date range
- Pass a starttime - Returns a dataframe with the values after the given start time
- Pass an endtime - Returns a dataframe with the values before the given end time
-
getResults
(ids=None, type=None, uuids=None, actionid=None, simulationid=None, sfid=None, variableid=None, siteid=None)[source]¶ Retrieve a list of Result objects.
If no arguments are passed to the function, or their values are None, all Result objects in the database will be returned.
Parameters: - ids (list, optional) – List of ResultIDs.
- type (str, optional) – Type of Result from controlled vocabulary name.
- uuids (list, optional) – List of UUIDs string.
- actionid (int, optional) – ActionID.
- simulationid (int, optional) – SimulationID.
- sfid (int, optional) – SamplingFeatureID.
- variableid (int, optional) – VariableID.
- siteid (int, optional) – SiteID.
Returns: List of Result objects
Return type: list
Examples
>>> ReadODM2.getResults(ids=[39,40]) >>> ReadODM2.getResults(type='Time series coverage') >>> ReadODM2.getResults(sfid=65) >>> ReadODM2.getResults(uuids=['a6f114f1-5416-4606-ae10-23be32dbc202', ... '5396fdf3-ceb3-46b6-aaf9-454a37278bb4']) >>> ReadODM2.getResults(simulationid=50) >>> ReadODM2.getResults(siteid=6) >>> ReadODM2.getResults(variableid=7) >>> ReadODM2.getResults(actionid=20)
-
getSamplingFeatures
(ids=None, codes=None, uuids=None, type=None, wkt=None, results=False)[source]¶ getSamplingFeatures(self, ids=None, codes=None, uuids=None, type=None, wkt=None, results=False): * Pass nothing - returns a list of all sampling feature objects with each object of type specific to that sampling feature * Pass a list of SamplingFeatureID - returns a single sampling feature object for the given ids * Pass a list of SamplingFeatureCode - returns a single sampling feature object for the given code * Pass a list of SamplingFeatureUUID - returns a single sampling feature object for the given UUID’s * Pass a SamplingFeatureType - returns a list of sampling feature objects of the type passed in * Pass a SamplingFeature Well Known Text - return a list of sampling feature objects * Pass whether or not you want to return only the sampling features that have results associated with them
-
getSimulations
(self, name=None, actionid=None)[source]¶ - Pass nothing - get a list of all converter simuation objects
- Pass a SimulationName - get a single simulation object
- Pass an ActionID - get a single simulation object
-
getSpatialReferences
(self, srsCodes=None)[source]¶ - Pass nothing - return a list of all Spatial References
- Pass in a list of SRS Codes-
-
getTaxonomicClassifiers
()[source]¶ getTaxonomicClassifiers(self): * Pass nothing - return a list of all objects
-
getUnits
(self, ids=None, name=None, type=None)[source]¶ - Pass nothing - returns a list of all units objects
- Pass a list of UnitsID - returns a single units object for the given id
- Pass UnitsName - returns a single units object
- Pass a type- returns a list of all objects of the given type
-
getVariables
(ids=None, codes=None, sitecode=None, results=False)[source]¶ getVariables(self, ids=None, codes=None, sitecode=None, results= False): * Pass nothing - returns full list of variable objects * Pass a list of VariableID - returns a single variable object * Pass a list of VariableCode - returns a single variable object * Pass a SiteCode - returns a list of Variable objects that are collected at the given site. * Pass whether or not you want to return the sampling features that have results associated with them
-