hmpf / easydmp

MIT License
7 stars 2 forks source link

Map many questions to RDA DMP CS #233

Closed hmpf closed 2 years ago

hmpf commented 3 years ago

In order to be able to export more of a plan to RDA DMP CS formatted JSON we need a way to map questions to positions in the RDA DMP CS object tree. This will be rather limited for existing templates since they have a flat, non-nested, non-repeatable structure, while RDA DMP CS templates are DAGs.

We'll make a new app for RDA DMP CS-adaptation:

class RDATag(models.Model):
    tag = models.CharField(max_length=255)
    optional = models.BooleanField()
    repeatable = models.BooleanField()

.. and have a ManyToManyKey from this model to dmpt.Section and dmpt.Question.

The format of the tag itself is in the form of a simplified subset of allowed jquery queries: .dmp.dataset[].distribution[].byte_size. When building the rda export, we'd fill in the index-values from the answerset position as sorted by identifier.

An entry for .dmp.dataset[].distribution[].byte_size would look like:

{
  'tag': '.dmp.dataset[].distribution[].byte_size',
  'optional': True,
  'repeatable': False,
}

.. which records the cardinality 0..1 with respect to its parent element .dmp.dataset[].distribution[].

The question-type needs to be compatible with the RDA DMP CS data type, so in the case of .dmp.dataset[].distribution[].byte_size only positiveinteger.

hmpf commented 3 years ago

Might be best to have a mapping between dmpt.input_types and RDA DMP CS data types, and validation. Maybe have a mapping per tag..

hmpf commented 2 years ago

Depends on #239.

hmpf commented 2 years ago

This is covered by the app "rdadcs" which will be deployed in the next feature release.