Skip to content

Conversation

@Mikejmnez
Copy link
Collaborator

@Mikejmnez Mikejmnez commented Nov 7, 2025

Draft PR

This PR:

Action Items for this PR:

What is covered in the schema:

  • Dataset declaration (what is required). Dimensions
  • Attributes (all value types i.e. atomic, String, URI), and the different ways attributes may be defined i.e. containers, multiplevalued, see DAP4: Attribute values that conform to the DAP4 specification are not read correctly. libdap4#259) . See test files in tests/data/Attributes*.dmr
  • BaseTypes (Dim declarations, atomic types, etc)
  • Enumerations
  • Sequences
  • Structures
  • Groups (dimensions an other attributes)
  • Order in which all elements above may be defined (Groups at the very last in every node).
  • Opaque types are not included for now. I need an example for that.

@jgallagher59701 @ndp-opendap

@Mikejmnez Mikejmnez linked an issue Nov 7, 2025 that may be closed by this pull request
@Mikejmnez
Copy link
Collaborator Author

Mikejmnez commented Nov 12, 2025

EDIT:
How to validate in Python this simple test dmr using the published schema as shown below:

from lxml import etree
# import requests
# from io import StringIO

dap4_schema_gh = "<path_to_local_dev_branch>/XML/dap4/dap4.xsd"
xmlschema_doc = etree.parse(dap4_schema_gh)
xmlschema = etree.XMLSchema(xmlschema_doc)
#

dmr_test = "<path_to_pydap_test_dmrs>/SimpleGroup.dmr"

f_tests = open(dmr_test)
doc = etree.parse(f_tests)
### now Attempt to validate:
xmlschema.assertValid(doc)

current stage: I could not validate with any dap4 schema. As a result, I am starting from a dap3.3.xsd schema. I am able to validate a very simple dmr against the schema.

@Mikejmnez Mikejmnez marked this pull request as ready for review November 24, 2025 16:48
@Mikejmnez Mikejmnez merged commit 3780acb into master Nov 26, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

Set up schema validation

3 participants