From e57f1f488c017d6f7a68bfc7299cdfe218ec696c Mon Sep 17 00:00:00 2001
From: Utz-Uwe Haus <uhaus@cray.com>
Date: Wed, 22 Apr 2020 21:53:52 +0200
Subject: [PATCH] schema parsing seems to work for a start

---
 attributes/ecmwf-yaml.h        |  33 ++---
 attributes/ecmwf.yaml          |   4 +-
 attributes/maestro-core-yaml.h | 214 ++++++++++++++++++---------------
 attributes/maestro-core.yaml   |   7 ++
 attributes/maestro-schema.c    |  43 +++++--
 attributes/maestro-schema.h    |  14 ++-
 include/maestro/attributes.h   |  14 +++
 tests/check_schema_parse.c     |  39 +++++-
 8 files changed, 237 insertions(+), 131 deletions(-)

diff --git a/attributes/ecmwf-yaml.h b/attributes/ecmwf-yaml.h
index 1877d843..f8198d00 100644
--- a/attributes/ecmwf-yaml.h
+++ b/attributes/ecmwf-yaml.h
@@ -53,21 +53,22 @@ unsigned char ecmwf_yaml[] = {
   0x61, 0x20, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x0a, 0x0a, 0x20,
   0x20, 0x2d, 0x20, 0x6b, 0x65, 0x79, 0x3a, 0x20, 0x22, 0x64, 0x61, 0x74,
   0x65, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a,
-  0x20, 0x69, 0x6e, 0x74, 0x28, 0x29, 0x20, 0x23, 0x20, 0x4f, 0x72, 0x2c,
-  0x20, 0x62, 0x65, 0x74, 0x74, 0x65, 0x72, 0x2c, 0x20, 0x61, 0x6e, 0x20,
-  0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20,
-  0x74, 0x79, 0x70, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71,
-  0x75, 0x69, 0x72, 0x65, 0x64, 0x3a, 0x20, 0x54, 0x72, 0x75, 0x65, 0x0a,
-  0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
-  0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x53, 0x74, 0x61, 0x72, 0x74,
-  0x20, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65,
-  0x20, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
-  0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x20, 0x6b, 0x65, 0x79, 0x3a, 0x20, 0x22,
-  0x74, 0x69, 0x6d, 0x65, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79,
-  0x70, 0x65, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x29, 0x20, 0x23, 0x20,
-  0x4f, 0x72, 0x2c, 0x20, 0x62, 0x65, 0x74, 0x74, 0x65, 0x72, 0x2c, 0x20,
-  0x61, 0x6e, 0x20, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x20, 0x74, 0x69,
-  0x6d, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20,
+  0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x28, 0x29,
+  0x20, 0x23, 0x20, 0x72, 0x66, 0x63, 0x33, 0x33, 0x33, 0x39, 0x20, 0x74,
+  0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x0a, 0x20, 0x20, 0x20,
+  0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x3a, 0x20, 0x54,
+  0x72, 0x75, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75,
+  0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x53,
+  0x74, 0x61, 0x72, 0x74, 0x20, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x66,
+  0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d,
+  0x65, 0x6e, 0x74, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x20, 0x6b, 0x65,
+  0x79, 0x3a, 0x20, 0x22, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x0a, 0x20, 0x20,
+  0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x75, 0x69, 0x6e, 0x74,
+  0x28, 0x29, 0x20, 0x23, 0x20, 0x75, 0x73, 0x75, 0x61, 0x6c, 0x6c, 0x79,
+  0x20, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x68, 0x6f, 0x75, 0x72, 0x20, 0x6f,
+  0x66, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2c, 0x20, 0x65, 0x2e, 0x67,
+  0x2e, 0x2c, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x30, 0x2f,
+  0x36, 0x2f, 0x31, 0x32, 0x2f, 0x31, 0x38, 0x0a, 0x20, 0x20, 0x20, 0x20,
   0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x3a, 0x20, 0x54, 0x72,
   0x75, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d,
   0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x53, 0x74,
@@ -155,4 +156,4 @@ unsigned char ecmwf_yaml[] = {
   0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x71, 0x75, 0x61,
   0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x0a
 };
-const unsigned int ecmwf_yaml_len = 1855;
+const unsigned int ecmwf_yaml_len = 1867;
diff --git a/attributes/ecmwf.yaml b/attributes/ecmwf.yaml
index d51df239..a3163b1a 100644
--- a/attributes/ecmwf.yaml
+++ b/attributes/ecmwf.yaml
@@ -25,12 +25,12 @@ maestro-attributes:
     documentation: Type of data stream.
 
   - key: "date"
-    type: int() # Or, better, an actual time type
+    type: timestamp() # rfc3339 timestamp
     required: True
     documentation: Start date of the experiment.
 
   - key: "time"
-    type: int() # Or, better, an actual time type
+    type: uint() # usually just hour of start, e.g., one of 0/6/12/18
     required: True
     documentation: Start time of the experiment
 
diff --git a/attributes/maestro-core-yaml.h b/attributes/maestro-core-yaml.h
index 86ba36e0..dc46894d 100644
--- a/attributes/maestro-core-yaml.h
+++ b/attributes/maestro-core-yaml.h
@@ -178,108 +178,128 @@ unsigned char maestro_core_yaml[] = {
   0x63, 0x64, 0x6f, 0x2e, 0x64, 0x65, 0x73, 0x69, 0x73, 0x74, 0x20, 0x61,
   0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x2e, 0x29, 0x0a, 0x0a,
   0x20, 0x20, 0x2d, 0x20, 0x6b, 0x65, 0x79, 0x3a, 0x20, 0x22, 0x63, 0x64,
-  0x6f, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x6d, 0x6f, 0x64,
-  0x65, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a,
-  0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x6d, 0x6f, 0x64, 0x65,
-  0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65,
-  0x64, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20,
-  0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x20, 0x2a, 0x61,
-  0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x6d, 0x6f, 0x64, 0x65, 0x2d, 0x76,
-  0x61, 0x6c, 0x75, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f,
-  0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a,
-  0x20, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x68,
-  0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x44, 0x4f, 0x20, 0x77,
-  0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73,
-  0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75,
-  0x73, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
-  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28,
-  0x72, 0x65, 0x61, 0x64, 0x2d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x2c, 0x20,
-  0x72, 0x65, 0x61, 0x64, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x20, 0x65,
-  0x74, 0x63, 0x2e, 0x29, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x20, 0x6b,
-  0x65, 0x79, 0x3a, 0x20, 0x22, 0x63, 0x64, 0x6f, 0x2e, 0x74, 0x72, 0x61,
-  0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, 0x61, 0x73, 0x61, 0x70, 0x22, 0x0a,
-  0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x62, 0x6f,
-  0x6f, 0x6c, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71,
-  0x75, 0x69, 0x72, 0x65, 0x64, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65,
-  0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
-  0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20,
-  0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,
-  0x6e, 0x3a, 0x20, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73,
-  0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x44,
-  0x4f, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x74, 0x72,
-  0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20,
-  0x73, 0x6f, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+  0x6f, 0x2e, 0x6d, 0x61, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x2d, 0x70, 0x72,
+  0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x2d, 0x73, 0x74, 0x6f, 0x72, 0x61,
+  0x67, 0x65, 0x22, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70,
+  0x65, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x28, 0x29, 0x0a, 0x20, 0x20,
+  0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x3a, 0x20,
+  0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65,
+  0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65,
+  0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+  0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x52, 0x65, 0x71, 0x75,
+  0x65, 0x73, 0x74, 0x2f, 0x61, 0x64, 0x76, 0x69, 0x73, 0x65, 0x20, 0x6d,
+  0x61, 0x65, 0x73, 0x74, 0x72, 0x6f, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x61,
+  0x67, 0x65, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e,
+  0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20,
   0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
-  0x61, 0x73, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2e,
-  0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x20, 0x6b, 0x65, 0x79, 0x3a, 0x20, 0x22,
-  0x63, 0x64, 0x6f, 0x2e, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x2d, 0x70, 0x6f,
-  0x6f, 0x6c, 0x65, 0x64, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79,
-  0x70, 0x65, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x28, 0x29, 0x0a, 0x20,
-  0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x3a,
+  0x20, 0x20, 0x20, 0x20, 0x20, 0x43, 0x44, 0x4f, 0x20, 0x28, 0x6e, 0x6f,
+  0x20, 0x52, 0x41, 0x57, 0x2d, 0x50, 0x54, 0x52, 0x20, 0x77, 0x69, 0x6c,
+  0x6c, 0x20, 0x62, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
+  0x64, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20,
+  0x6f, 0x62, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x64, 0x29, 0x0a, 0x0a, 0x20,
+  0x20, 0x2d, 0x20, 0x6b, 0x65, 0x79, 0x3a, 0x20, 0x22, 0x63, 0x64, 0x6f,
+  0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x6d, 0x6f, 0x64, 0x65,
+  0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20,
+  0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2d, 0x6d, 0x6f, 0x64, 0x65, 0x0a,
+  0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64,
+  0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20,
+  0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x20, 0x2a, 0x61, 0x63,
+  0x63, 0x65, 0x73, 0x73, 0x2d, 0x6d, 0x6f, 0x64, 0x65, 0x2d, 0x76, 0x61,
+  0x6c, 0x75, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63,
+  0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20,
+  0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x68, 0x6f,
+  0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x44, 0x4f, 0x20, 0x77, 0x69,
+  0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73,
+  0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73,
+  0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x72,
+  0x65, 0x61, 0x64, 0x2d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x2c, 0x20, 0x72,
+  0x65, 0x61, 0x64, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x20, 0x65, 0x74,
+  0x63, 0x2e, 0x29, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x20, 0x6b, 0x65,
+  0x79, 0x3a, 0x20, 0x22, 0x63, 0x64, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x6e,
+  0x73, 0x66, 0x65, 0x72, 0x2d, 0x61, 0x73, 0x61, 0x70, 0x22, 0x0a, 0x20,
+  0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x62, 0x6f, 0x6f,
+  0x6c, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75,
+  0x69, 0x72, 0x65, 0x64, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a,
+  0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a,
   0x20, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64,
-  0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73,
-  0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
-  0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x49, 0x6e, 0x64,
-  0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20,
-  0x74, 0x68, 0x65, 0x20, 0x43, 0x44, 0x4f, 0x20, 0x77, 0x69, 0x6c, 0x6c,
-  0x20, 0x62, 0x65, 0x20, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x20, 0x62, 0x65,
-  0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x20,
+  0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+  0x3a, 0x20, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20,
+  0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x44, 0x4f,
+  0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x74, 0x72, 0x61,
+  0x6e, 0x73, 0x66, 0x65, 0x72, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x73,
+  0x6f, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61,
+  0x73, 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x2e, 0x0a,
+  0x0a, 0x20, 0x20, 0x2d, 0x20, 0x6b, 0x65, 0x79, 0x3a, 0x20, 0x22, 0x63,
+  0x64, 0x6f, 0x2e, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x2d, 0x70, 0x6f, 0x6f,
+  0x6c, 0x65, 0x64, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70,
+  0x65, 0x3a, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x28, 0x29, 0x0a, 0x20, 0x20,
+  0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x3a, 0x20,
+  0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65,
+  0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65,
+  0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+  0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x49, 0x6e, 0x64, 0x69,
+  0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74,
+  0x68, 0x65, 0x20, 0x43, 0x44, 0x4f, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20,
+  0x62, 0x65, 0x20, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x20, 0x62, 0x65, 0x20,
+  0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20,
   0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
-  0x20, 0x20, 0x20, 0x20, 0x4f, 0x46, 0x46, 0x45, 0x52, 0x2f, 0x44, 0x45,
-  0x4d, 0x41, 0x4e, 0x44, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20,
-  0x70, 0x6f, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x6c, 0x79, 0x20,
-  0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x73, 0x20, 0x65, 0x78, 0x74, 0x72,
-  0x61, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
-  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x65, 0x72,
-  0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x70, 0x74,
-  0x69, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a,
-  0x0a, 0x20, 0x20, 0x23, 0x23, 0x20, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69,
-  0x6d, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x0a, 0x20,
-  0x20, 0x2d, 0x20, 0x6b, 0x65, 0x79, 0x3a, 0x20, 0x22, 0x63, 0x64, 0x6f,
-  0x2e, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x0a, 0x20,
-  0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x6c, 0x69, 0x66,
-  0x65, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76,
-  0x61, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69,
-  0x72, 0x65, 0x64, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20,
-  0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61,
-  0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x43, 0x44, 0x4f, 0x20, 0x6c, 0x69,
-  0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69,
-  0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20,
+  0x20, 0x20, 0x20, 0x4f, 0x46, 0x46, 0x45, 0x52, 0x2f, 0x44, 0x45, 0x4d,
+  0x41, 0x4e, 0x44, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x70,
+  0x6f, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x70,
+  0x65, 0x72, 0x6d, 0x69, 0x74, 0x73, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61,
+  0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x65, 0x72, 0x66,
+  0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69,
+  0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x0a,
+  0x20, 0x20, 0x23, 0x23, 0x20, 0x4c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d,
+  0x65, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x0a, 0x20, 0x20,
   0x2d, 0x20, 0x6b, 0x65, 0x79, 0x3a, 0x20, 0x22, 0x63, 0x64, 0x6f, 0x2e,
+  0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x0a, 0x20, 0x20,
+  0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x6c, 0x69, 0x66, 0x65,
+  0x74, 0x69, 0x6d, 0x65, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61,
+  0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72,
+  0x65, 0x64, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20,
+  0x20, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74,
+  0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x43, 0x44, 0x4f, 0x20, 0x6c, 0x69, 0x66,
+  0x65, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66,
+  0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2d,
+  0x20, 0x6b, 0x65, 0x79, 0x3a, 0x20, 0x22, 0x63, 0x64, 0x6f, 0x2e, 0x6c,
+  0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x73, 0x74, 0x72, 0x69,
+  0x63, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20,
+  0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69,
+  0x6d, 0x65, 0x2d, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x6e, 0x65, 0x73,
+  0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72,
+  0x65, 0x64, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20,
+  0x20, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x20, 0x2a,
   0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x73, 0x74, 0x72,
-  0x69, 0x63, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x22, 0x0a, 0x20, 0x20, 0x20,
-  0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x6c, 0x69, 0x66, 0x65, 0x74,
-  0x69, 0x6d, 0x65, 0x2d, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x6e, 0x65,
-  0x73, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69,
+  0x69, 0x63, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x2d, 0x76, 0x61, 0x6c, 0x75,
+  0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+  0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x43, 0x44,
+  0x4f, 0x20, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x73,
+  0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+  0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x23, 0x23,
+  0x20, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74,
+  0x65, 0x64, 0x0a, 0x20, 0x20, 0x2d, 0x20, 0x6b, 0x65, 0x79, 0x3a, 0x20,
+  0x22, 0x63, 0x64, 0x6f, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x73,
+  0x69, 0x7a, 0x65, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70,
+  0x65, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x6d, 0x69, 0x6e, 0x3d, 0x2d,
+  0x31, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69,
   0x72, 0x65, 0x64, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x20,
   0x20, 0x20, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x20,
-  0x2a, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2d, 0x73, 0x74,
-  0x72, 0x69, 0x63, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x2d, 0x76, 0x61, 0x6c,
-  0x75, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75,
-  0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x43,
-  0x44, 0x4f, 0x20, 0x6c, 0x69, 0x66, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x20,
-  0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
-  0x6e, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x23,
-  0x23, 0x20, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x20, 0x72, 0x65, 0x6c, 0x61,
-  0x74, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2d, 0x20, 0x6b, 0x65, 0x79, 0x3a,
-  0x20, 0x22, 0x63, 0x64, 0x6f, 0x2e, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e,
-  0x73, 0x69, 0x7a, 0x65, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79,
-  0x70, 0x65, 0x3a, 0x20, 0x69, 0x6e, 0x74, 0x28, 0x6d, 0x69, 0x6e, 0x3d,
-  0x2d, 0x31, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75,
-  0x69, 0x72, 0x65, 0x64, 0x3a, 0x20, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x0a,
-  0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a,
-  0x20, 0x2d, 0x31, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75,
-  0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x54,
-  0x68, 0x65, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x20, 0x73, 0x69, 0x7a,
-  0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x44, 0x4f,
-  0x2e, 0x20, 0x2d, 0x31, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74,
-  0x65, 0x73, 0x20, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x55,
-  0x6e, 0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x0a,
-  0x0a, 0x20, 0x20, 0x23, 0x20, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x73,
-  0x0a, 0x20, 0x20, 0x23, 0x20, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62,
-  0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x0a, 0x0a, 0x23, 0x20, 0x28,
-  0x65, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x61, 0x65, 0x73, 0x74,
-  0x72, 0x6f, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x79, 0x61, 0x6d, 0x6c,
-  0x29, 0x0a, 0x0a
+  0x2d, 0x31, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+  0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x54, 0x68,
+  0x65, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x20, 0x73, 0x69, 0x7a, 0x65,
+  0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x44, 0x4f, 0x2e,
+  0x20, 0x2d, 0x31, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65,
+  0x73, 0x20, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x55, 0x6e,
+  0x61, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x0a,
+  0x20, 0x20, 0x23, 0x20, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x73, 0x0a,
+  0x20, 0x20, 0x23, 0x20, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75,
+  0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x0a, 0x0a, 0x23, 0x20, 0x28, 0x65,
+  0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x61, 0x65, 0x73, 0x74, 0x72,
+  0x6f, 0x2d, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x79, 0x61, 0x6d, 0x6c, 0x29,
+  0x0a, 0x0a
 };
-const unsigned int maestro_core_yaml_len = 3375;
+const unsigned int maestro_core_yaml_len = 3614;
diff --git a/attributes/maestro-core.yaml b/attributes/maestro-core.yaml
index f6f17f7f..2b1531b4 100644
--- a/attributes/maestro-core.yaml
+++ b/attributes/maestro-core.yaml
@@ -64,6 +64,13 @@ maestro-attributes:
                    pool. (Note the non-trivial semantic interaction
                    with the cdo.desist attribute.)
 
+  - key: "cdo.maestro-provided-storage" 
+    type: bool()
+    required: False
+    default: False
+    documentation: Request/advise maestro storage management for the
+                   CDO (no RAW-PTR will be provided or can be obtained)
+
   - key: "cdo.access-mode"
     type: access-mode
     required: False
diff --git a/attributes/maestro-schema.c b/attributes/maestro-schema.c
index 40c74a8e..9218417b 100644
--- a/attributes/maestro-schema.c
+++ b/attributes/maestro-schema.c
@@ -19,6 +19,7 @@
 #include "maestro-schema.h"
 #include "schema_type_parse.h"
 #include "symtab.h"
+#include "maestro/i_utlist.h"
 
 #include "maestro/i_uthash.h"
 #include "maestro/i_utstack.h"
@@ -54,7 +55,13 @@ const struct {
   [0] = { .schema = maestro_core_yaml, .schema_size = maestro_core_yaml_len},
   [1] = { .schema = ecmwf_yaml, .schema_size = ecmwf_yaml_len},
 };
-  
+
+const unsigned char *MSTRO_SCHEMA_BUILTIN_YAML_CORE      = maestro_core_yaml;
+const unsigned int   MSTRO_SCHEMA_BUILTIN_YAML_CORE_LEN  = maestro_core_yaml_len;
+
+const unsigned char *MSTRO_SCHEMA_BUILTIN_YAML_ECMWF     = ecmwf_yaml;
+const unsigned int   MSTRO_SCHEMA_BUILTIN_YAML_ECMWF_LEN = ecmwf_yaml_len;
+
 
 /** The C data structures to hold a parsed schema
  **/
@@ -206,7 +213,7 @@ struct mstro_schema_ {
 
   struct mstro_schema_ *next; /** is also a linked list: schema
                                * merging works by pushing down the
-                               * merged schema here */ 
+                               * merged schema here. */ 
 };
 
 
@@ -216,6 +223,8 @@ mstro_schema_free(mstro_schema sch)
   if(sch==NULL)
     return MSTRO_INVARG;
 
+  mstro_schema next=sch->next; /* save for tail recursion */
+
   if(sch->schema_name)
     free(sch->schema_name);
 
@@ -244,8 +253,11 @@ mstro_schema_free(mstro_schema sch)
   }
 
   free(sch);
-
-  return MSTRO_OK;
+  
+  if(next)
+    return mstro_schema_free(next);
+  else
+    return MSTRO_OK;
 }
 
 /** Return the name of a schema. */
@@ -736,7 +748,17 @@ mstro_status
 mstro_schema_merge(mstro_schema main,
                    mstro_schema consumed)
 {
-  return MSTRO_UNIMPL;
+  if(main==NULL || consumed==NULL) {
+    return MSTRO_INVARG;
+  }
+
+  LL_APPEND(main,consumed);
+  /* FIXME: we could copy entries from consumed into main, but until
+   * someone complains we'll cdr down the next list when performing
+   * lookups.
+   */
+  
+  return MSTRO_OK;
 }
 
 /* these are 1:1 corresponding to the user-facing ones from enum mstro_stp_val_kind */
@@ -1269,9 +1291,14 @@ mstro_attributes__parse_helper(yaml_parser_t parser,
           free(pk->fqkey);
         free(pk);
         /* restore invariant: in a mapping we have an empty entry on top of stack */
-        if(keystack->fqkey) {
-          free(keystack->fqkey);
-          keystack->fqkey=NULL;
+        if(STACK_EMPTY(keystack)) {
+          /* top-level mapping ending */
+          DEBUG("key stack now empty\n");
+        } else {
+          if(keystack->fqkey) {
+            free(keystack->fqkey);
+            keystack->fqkey=NULL;
+          }
         }
         break;
       }
diff --git a/attributes/maestro-schema.h b/attributes/maestro-schema.h
index 94deb69c..eb0264b8 100644
--- a/attributes/maestro-schema.h
+++ b/attributes/maestro-schema.h
@@ -80,6 +80,14 @@ mstro_schema_version(mstro_schema sch);
  ** explicitly, as its data structures become shared with the shares
  ** data structures of the @arg main schema. Deallocating that will
  ** also clean up the @arg consumed one.
+ **
+ ** The schema list is linear. All entries in @arg main dominate all
+ ** those in @arg consumed, i.e., consumed is "appended" to the end of
+ ** @arg main.
+ **
+ ** Typical usage: A user schema is used as @arg main, with the
+ ** maestro-core schema being @arg consumed. As a result entries in
+ ** @arg main shadow entries in @arg consumed.
  **/
 mstro_status
 mstro_schema_merge(mstro_schema main,
@@ -143,11 +151,5 @@ mstro_attributes_default(mstro_schema schema,
                          mstro_attribute_dict *result);
 
 
-/** Pattern for RFC3339-timestamp string representation (see @ref
- * mstro_timestamp) */
-#define RFC3339_PATTERN ("^([0-9]{4})-([0-9]{2})-([0-9]{2})"                     \
-                         "([Tt]([0-9]{2}):([0-9]{2}):([0-9]{2})(\\.[0-9]+)?)?"   \
-                         "(([Zz]|([+-])([0-9]{2}):([0-9]{2})))?")
-
 
 #endif
diff --git a/include/maestro/attributes.h b/include/maestro/attributes.h
index 0f476cb9..ac9e34e7 100644
--- a/include/maestro/attributes.h
+++ b/include/maestro/attributes.h
@@ -305,6 +305,20 @@ mstro_status
 mstro_cdo_attribute_set_default(mstro_cdo cdo);
 
   /**@} (end of group MSTRO_Attr) */
+
+  /** Pattern for RFC3339-timestamp string representation (see @ref
+ * mstro_timestamp) */
+#define RFC3339_PATTERN ("^([0-9]{4})-([0-9]{2})-([0-9]{2})"                     \
+                         "([Tt]([0-9]{2}):([0-9]{2}):([0-9]{2})(\\.[0-9]+)?)?"   \
+                         "(([Zz]|([+-])([0-9]{2}):([0-9]{2})))?")
+
+/** Built-in schemata: */
+extern const unsigned char *MSTRO_SCHEMA_BUILTIN_YAML_CORE;
+extern const unsigned int   MSTRO_SCHEMA_BUILTIN_YAML_CORE_LEN;
+
+extern const unsigned char *MSTRO_SCHEMA_BUILTIN_YAML_ECMWF;
+extern const unsigned int   MSTRO_SCHEMA_BUILTIN_YAML_ECMWF_LEN;
+
 /**@} (end of addtogroup MSTRO_Core) */
 
 #ifdef __cplusplus
diff --git a/tests/check_schema_parse.c b/tests/check_schema_parse.c
index c3ed7437..e1b407d7 100644
--- a/tests/check_schema_parse.c
+++ b/tests/check_schema_parse.c
@@ -94,8 +94,8 @@ CHEAT_TEST(core_schema_parse,
            cheat_assert(MSTRO_OK==s);
            cheat_yield();
 
-           /* cheat_assert(MSTRO_OK==mstro_schema_merge(s1, s2)); */
-           /* cheat_yield(); */
+           cheat_assert(MSTRO_OK==mstro_schema_merge(s1, s2));
+           cheat_yield();
 
            /* now use the merged schema to parse some sample defs */
            cheat_assert(MSTRO_OK==mstro_attributes_parse(s1,
@@ -103,10 +103,45 @@ CHEAT_TEST(core_schema_parse,
                                                          &dict));
            cheat_yield();
 
+           /* s1 is the merged one, and freeing it will recurse */
+           cheat_assert(MSTRO_OK==mstro_schema_free(s1)); 
+           
+           )
+
+CHEAT_TEST(core_schema_parse_builtin,
+           mstro_schema s1, s2;
+
+           mstro_attribute_dict dict;
+           mstro_status s=MSTRO_OK;
+
+           cheat_assert(MSTRO_OK==mstro_schema_parse(MSTRO_SCHEMA_BUILTIN_YAML_CORE,
+                                                    MSTRO_SCHEMA_BUILTIN_YAML_CORE_LEN, &s1));
+           cheat_yield();
+           
+           s=mstro_schema_parse(MSTRO_SCHEMA_BUILTIN_YAML_ECMWF,
+                                MSTRO_SCHEMA_BUILTIN_YAML_ECMWF_LEN,
+                                &s2);
+           if(MSTRO_OK!=s) {
+             /* clean up successful ones so that valgrind is happy
+              * even on failure */
+             cheat_assert(MSTRO_OK==mstro_schema_free(s1));
+           }
+           cheat_assert(MSTRO_OK==s);
+           cheat_yield();
+
+           cheat_assert(MSTRO_OK==mstro_schema_merge(s1, s2));
+           cheat_yield();
 
+           /* now use the merged schema to parse some sample defs */
+           cheat_assert(MSTRO_OK==mstro_attributes_parse(s1,
+                                                         SAMPLE_YAML_STRING,
+                                                         &dict));
+           cheat_yield();
 
            /* s1 is the merged one, and freeing it will recurse */
            cheat_assert(MSTRO_OK==mstro_schema_free(s1)); 
            
            )
+
+
            
-- 
GitLab