Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate List of API Functions #32

Closed
37 tasks done
horsburgh opened this issue Mar 17, 2016 · 5 comments
Closed
37 tasks done

Consolidate List of API Functions #32

horsburgh opened this issue Mar 17, 2016 · 5 comments

Comments

@horsburgh
Copy link
Member

After looking at the existing code, we have decided on a major consolidation of the functions in the API to avoid complexity and repetition. For a description of the planned signatures (inputs and outputs) for each of the functions, click here.

Consolidated List of ODM2 API Low-level Get Functions

  • getActions()
  • getAffilations()
  • getDatasets()
  • getEquipment()
  • getMethods()
  • getModels()
  • getOrganizations()
  • getPeople()
  • getProcessingLevels()
  • getRelatedActions()
  • getRelatedModels()
  • getRelatedSamplingFeatures()
  • getResults()
  • getResultValues()
  • getSamplingFeatures()
  • getSimulations()
  • getUnits()
  • getVariables()

Consolidated List of ODM2 API Low-level Create Functions

  • createVariable()
  • createMethod()
  • createProcessingLevel()
  • createSamplingFeature()
  • createUnit()
  • createOrganization()
  • createPerson()
  • createAffiliation()
  • createDataset()
  • createDatasetResults()
  • createAction()
  • createRelatedAction()
  • createResult()
  • createResultValues()
  • createSamplingFeature()
  • createSpatialReference()
  • createModel()
  • createRelatedModel()
  • createSimulation()

For Reference - Functions that are being removed

getVariableById - Covered by getVariables (passing in a VariableID)
getVariableByCode - covered by getVariables (passing in a VariableCode)
getResultById - covered by getResults (passing in a ResultID)
getMethodById - covered by getMethods (passing in a MethodID)
getMethodByCode - coverd by getMethods (passing in a MethodCode)
getProcessingLevelById - covered by getProcessingLevels (passing in a ProcessingLevelID)
getProcessingLevelByCode - covered by getProcessingLevels (passing in a ProcessingLevelCode)
getSamplingFeatureById - Covered by getSamplingFeatures (passing in a SamplingFeatureID)
getSamplingFeatureByCode - Covered by getSamplingFeatures (Passing in a SamplingFeatureCode)
getSamplingFeaturesByType - Covered by getSamplingFeatures (Passing in a SamplingFeatureType)
getSamplingFeatureByGeometry - Covered by getSamplingFeatures (passing in a GeometryType)
getGeometryTest - I don't know what this is and don't think we need it
getUnitById - Covered by getUnits (passing in a UnitsID)
getUnitByName - Covered by getUnits (passing in a UnitsName)
getOrganizationById - Covered by getOrganizations (passing in an OrganizationID)
getOrganizationByCode - Covered by getOrganizations (passing in an OrganizationCode)
getPersonById - Covered by getPeople (passing in a PersonID)
getPersonByName - Covered by getPeople (passing in a name)
getAffiliationByPersonAndOrg - why do we need this? Covered by getAffiliations?
getAffiliationsByPerson - Covered by getAffiliations (passing in a PersonID)
getResultByActionID - Covered by getResults (passing in an ActionID)
getResultByID - Covered by getResults
getResultAndGeomByID - Covered by getResults (passing in a ResultID)
getResultAndGeomByActionID - coverec by getResults (passing in an ActionID)
getResultValidDateTime - covered by getting the result and querying the metadata
getDatasetByCode - Covered by getDatasets (passing in a DatasetCode)
getAllDataQuality - what is this for?
getAllEquipment - covered by getEquipment
getCitations - why do we need this independently?
getTimeSeriesResults - covered by getResults
getTimeSeriesResultByResultId - Covered by getResults (passing in a ResultID)
getTimeSeriesResultbyCode - Results don't have a code, so not sure what this would do anyway
getTimeSeriesResultValues - covered by getResultValues
getTimeSeriesResultValuesByResultId - covered by getResultValues (passing in a ResultID)
getTimeSeriesResultValuesByCode - results don't have a code so this wouldnt work anyway
getTimeSeriesResultValuesByTime - covered by getResultValues (passing in a ResultID and a time period)
getAllSites - Covered by getSamplingFeatures (passing a type of "Site")
getSiteBySFId - covered by getSamplingFeatures (passing in a SamplingFeatureID)
getSiteBySFCode - covered by getSamplingFeatures (passing in a SamplingFeatureCode)
getSpatialReferenceByCode - don't think we need this
getAllDeploymentAction - covered by getActions (passing in an ActionType)
getDeploymentActionById - covered by getActions (passing in an ActionID)
getDeploymentActionByCode - Actions do not have code, so this one wouldn't work anyway
getAllModels - covered by getModels
getModelByCode - covered by getModels (passing in a ModelCode)
getAllSimulations - covered by getSimulations
getSimulationByName - covered by getSimulations (passing in a Simulation Name)
getSimulationByActionID - covered by getSimulations (passing in an ActionID)
getRelatedModelsByID - covered by getRelatedModels (Passing in a ModelID)
getRelatedModelsByCode - covered by getRelatedModels (passing in a ModelCode)
getResultsBySimulationID - covered by GetResults (passing in an ActionID)
createTimeSeriesResult - covered by createResult
createTimeSeriesResultValues - covered by createResultValues
createSite - covered by createSamplingFeature
createDeploymentAction - covered by createAction

@emiliom
Copy link
Member

emiliom commented Mar 17, 2016

👍

@sreeder
Copy link
Contributor

sreeder commented Mar 24, 2016

I have created a branch called addqueries to address this issue.

@sreeder
Copy link
Contributor

sreeder commented Mar 24, 2016

Per a discussion with @horsburgh we have decided that the create functions should receive an object, or all required objects, to be added to the database. createVariables(), will receive a Variables object. but createActions() will take both an Actions and an ActionBy object, because you won't be creating and ActionBy without an Action.

@valentinedwv
Copy link
Member

getRelatedModels()

Pass a ModelID - get a list of model objects related to the model having ModelID
Pass a ModelCode - get a list of model objects related to the model having ModeCode

Question that needs to be answered:

  1. Is this getting the children of ModelID, aka I have model XXXX, what models are related?
    or
  2. all parents of a model with modelID

Functioning as #2. I think it should be #1

@horsburgh
Copy link
Member Author

@valentinedwv and @sreeder - shouldn't the "GetRelatedX" functions return both parents and children (e.g., anything with a relationship to the object with ID or Code that was passed in)? We could move this to a separate issue to fix after merging and releasing the current dev branch that includes all of this work.

sreeder pushed a commit that referenced this issue Apr 22, 2016
@sreeder sreeder added this to the alpha Release 0.5 milestone May 4, 2016
@sreeder sreeder assigned sreeder and unassigned sreeder Jun 28, 2016
@sreeder sreeder closed this as completed Jun 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants