From 579438991cbd5808859db9277976d6992c4629bf Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Fri, 15 Nov 2024 17:10:41 +0100 Subject: [PATCH] update the serialization description --- .github/workflows/test.yml | 2 +- .gitignore | 1 + doc/guide/Serialization.md | 48 ++++++++++++++----- .../SerializationExampleTest.java | 2 +- 4 files changed, 38 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 977606cc..efd8f2c4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,4 +49,4 @@ jobs: if: always() with: files: | - ./**/test/*.xml + ./**/reports/**/test/*.xml diff --git a/.gitignore b/.gitignore index b1594ea6..b23e2d73 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ tools/gradletooling/gradle-plugin/bin/ /tools/gradletooling/sample/pythontest/generated/ /tools/gradletooling/sample/mkdocs.yml /runtime/java/bin/ +/tools/gradletooling/sample/tmp/ diff --git a/doc/guide/Serialization.md b/doc/guide/Serialization.md index e925a25e..39701424 100644 --- a/doc/guide/Serialization.md +++ b/doc/guide/Serialization.md @@ -30,21 +30,31 @@ The schema for the serializations can be created with the `gradle vodmlSchema` c For the [small example model](https://github.com/ivoa/vo-dml/tree/master/models/sample/test/serializationExample.vodsl), the overall model object will produce xml like ```xml - + - + a value - a name + naturalkey another val - - a z val - id_0 - a name - + + some + z + values + + dval + a D + + + eval + cube + + MyModel-Refa_1000 + naturalkey + ``` Note that because the integer parts of the id might have come from database indices, which @@ -61,19 +71,31 @@ as a reference to the object if the data model is known. An `_id` property is ad "MyModelModel" : { "refs" : { "MyModel:Refa" : [ { - "_id" : 0, + "_id" : 1000, "val" : "a value" } ], "MyModel:Refb" : [ { - "name" : "a name", + "name" : "naturalkey", "val" : "another val" } ] }, "content" : [ { "@type" : "MyModel:SomeContent", - "zval" : "a z val", - "ref1" : 0, - "ref2" : "a name" + "_id" : 0, + "zval" : [ "some", "z", "values" ], + "con" : [ { + "@type" : "MyModel:Dcont", + "_id" : 0, + "bname" : "dval", + "dval" : "a D" + }, { + "@type" : "MyModel:Econt", + "_id" : 0, + "bname" : "eval", + "evalue" : "cube" + } ], + "ref1" : 1000, + "ref2" : "naturalkey" } ] } } diff --git a/tools/gradletooling/sample/src/test/java/org/ivoa/dm/serializationsample/SerializationExampleTest.java b/tools/gradletooling/sample/src/test/java/org/ivoa/dm/serializationsample/SerializationExampleTest.java index 484b7d74..57e7b090 100644 --- a/tools/gradletooling/sample/src/test/java/org/ivoa/dm/serializationsample/SerializationExampleTest.java +++ b/tools/gradletooling/sample/src/test/java/org/ivoa/dm/serializationsample/SerializationExampleTest.java @@ -26,7 +26,7 @@ public class SerializationExampleTest public MyModelModel createModel() { themodel = new MyModelModel(); refa = new Refa("a value"); - refb = new Refb("a name", "another val"); + refb = new Refb("naturalkey", "another val"); List clist = List.of(new Dcont("a D", "dval"), new Econt("cube", "eval"));