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

Implement QB Writer Unit Tests #64

Closed
4 tasks done
robons opened this issue Jul 6, 2021 · 2 comments
Closed
4 tasks done

Implement QB Writer Unit Tests #64

robons opened this issue Jul 6, 2021 · 2 comments
Assignees

Comments

@robons
Copy link
Contributor

robons commented Jul 6, 2021

  • _get_default_value_uri_for_code_list_concepts - Ensure it generates appropriate default valueUrl for both dataset-local and global-level code lists.
  • _get_default_property_value_uris_for_column - Ensure default propertyUrl and valueUrl values/templates are generated for {New/Existing}Qb{Dimension/Attribute}, QbMultiUnits, QbMultiMeasureDimension and QbObservationValue.
  • _define_csvw_column_for_qb_column - Ensure column.output_uri_template overrides whatever defaultValueUrl is relevant for the component.
  • _generate_csvqb_column - Ensure SuppressedCsvColumn gets suppressed. Ensure titles/name properties are set from CsvColumn input.
@robons robons changed the title Implement QB Writer Tests Implement QB Writer Unit Tests Jul 6, 2021
@robons
Copy link
Contributor Author

robons commented Jul 8, 2021

Some thoughts on _get_default_value_uri_for_code_list_concepts

Cities,Value
Birmingham,20

QbColumn("Cities", ExistingQbDimension("http://gss-data.org.uk/def/dimension/cities"),
                   column_output_uri="http://gss-data.org.uk/def/concept-scheme/cities/{+cities}")

QbColumn("Cities", ExistingQbDimension("http://gss-data.org.uk/def/dimension/cities"))

codelist_uri = lookup(dimension_uri) # http://gss-data.org.uk/def/concept-scheme/cities

if codelist_uri looks like family/global codelist:
    http://gss-data.org.uk/def/concept-scheme/cities/{+cities}
elif codelist_uri looks like a dataset local one:
    http://gss-data.org.uk/data/some-dataset-name#concept/cities/{+cities}

What we want to test:

family/global: test that "http://gss-data.org.uk/def/concept-scheme/cities" gets converted to "http://gss-data.org.uk/def/concept-scheme/cities/{+cities}"

dataset-local: test that "http://gss-data.org.uk/data/some-dataset-name#scheme/cities" gets converted to "http://gss-data.org.uk/data/some-dataset-name#concept/cities/{+cities}"

anything which doesn't match the above two should get converted to just "{+cities}"

@robons robons self-assigned this Jul 8, 2021
robons pushed a commit that referenced this issue Jul 14, 2021
…that URIs are correctly inferred when outputting CSV-W.
robons pushed a commit that referenced this issue Jul 15, 2021
…that URIs are correctly inferred when outputting CSV-W.
robons pushed a commit that referenced this issue Jul 15, 2021
…whilst allowing users to override the `valueUrl` property.
@robons
Copy link
Contributor Author

robons commented Jul 15, 2021

Adding in a bit of work to this task:

  • _generate_virtual_columns_for_obs_val - Test that a virt_unit column gets added where the user sets a single unit against a QbObservationValue column. Test the corresponding thing with the virt_measure column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants