Skip to content

Commit 027d11d

Browse files
committed
Make simple schema validation test pass
* paying more attention to the required multiplicities in the Resource * making XML unwrapped the default - for when things are missing!
1 parent 8075116 commit 027d11d

File tree

4 files changed

+37
-25
lines changed

4 files changed

+37
-25
lines changed

model/RegTAP.vodsl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ include "../build/tmp/IVOA-v1.0.vodsl"
1313

1414
created: ivoa:datetime "The UTC date and time this resource metadata description was created.";
1515

16-
short_name: ivoa:string "A short name or abbreviation given to something, for presentation in space-constrained fields (up to 16 characters).";
16+
short_name: ivoa:string @? "A short name or abbreviation given to something, for presentation in space-constrained fields (up to 16 characters).";
1717

1818
res_title: ivoa:string "The full name given to the resource.";
1919

@@ -25,23 +25,23 @@ include "../build/tmp/IVOA-v1.0.vodsl"
2525

2626
reference_url: ivoa:string "URL pointing to a human-readable document describing this resource.";
2727

28-
creator_seq: ivoa:string "The creator(s) of the resource in the order given by the resource record author, separated by semicolons.";
28+
creator_seq: ivoa:string @? "The creator(s) of the resource in the order given by the resource record author, separated by semicolons.";
2929

30-
content_type: ivoa:string "A hash-separated list of natures or genres of the content of the resource.";
30+
content_type: ivoa:string @? "A hash-separated list of natures or genres of the content of the resource.";
3131

32-
source_format: ivoa:string "The format of source_value. This, in particular, can be ``bibcode''.";
32+
source_format: ivoa:string @? "The format of source_value. This, in particular, can be ``bibcode''.";
3333

34-
source_value: ivoa:string "A bibliographic reference from which the present resource is derived or extracted.";
34+
source_value: ivoa:string @? "A bibliographic reference from which the present resource is derived or extracted.";
3535

36-
res_version: ivoa:string "Label associated with creation or availablilty of a version of a resource.";
36+
res_version: ivoa:string @? "Label associated with creation or availability of a version of a resource.";
3737

38-
region_of_regard: ivoa:real "A single numeric value representing the angle, given in decimal degrees, by which a positional query against this resource should be ``blurred'' in order to get an appropriate match.";
38+
region_of_regard: ivoa:real @? "A single numeric value representing the angle, given in decimal degrees, by which a positional query against this resource should be ``blurred'' in order to get an appropriate match.";
3939

40-
waveband: ivoa:string "A hash-separated list of regions of the electro-magnetic spectrum that the resource's spectral coverage overlaps with.";
40+
waveband: ivoa:string @? "A hash-separated list of regions of the electro-magnetic spectrum that the resource's spectral coverage overlaps with.";
4141

42-
rights: ivoa:string "A statement of usage conditions (license, attribution, embargo, etc).";
42+
rights: ivoa:string @? "A statement of usage conditions (license, attribution, embargo, etc).";
4343

44-
rights_uri: ivoa:string "A URI identifying a license the data is made available under.";
44+
rights_uri: ivoa:string @? "A URI identifying a license the data is made available under.";
4545

4646
//IMPL all of these compositions are really direct children in the VOResource model
4747

@@ -75,7 +75,7 @@ include "../build/tmp/IVOA-v1.0.vodsl"
7575
tapTables: TAPTable @* as composition "TAP tables"; // IMPL quite a departure from the original VOResource ideas...
7676

7777
}
78-
78+
// TODO - need to review all the multiplicities below.
7979
otype Role "Entities (persons or organizations) operating on re-
8080
sources: creators, contacts, publishers, contributors." {
8181

src/test/java/org/ivoa/dm/regtap/RegTAPBasiclModelTest.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
import org.ivoa.vodml.testing.AutoRoundTripWithValidationTest;
77

8+
import java.util.Date;
9+
10+
11+
812
/**
913
* This will run a XML and JSON round trip test on the model inst
1014
*/
@@ -15,7 +19,15 @@ public RegTAPModel createModel() {
1519
RegTAPModel retval = new RegTAPModel();
1620
retval.addContent(Resource.createResource( r -> {
1721
r.ivoid="ivo://test/something";
18-
//TODO add more to make a realistic example
22+
r.res_type= "vr:Resource";
23+
r.created = new Date();
24+
r.short_name="short name";
25+
r.res_title="title";
26+
r.updated = new Date();
27+
r.content_level = "level";
28+
r.res_description="description";
29+
r.reference_url="reference url";
30+
1931
}
2032

2133
));

vo-dml/RegTAP.vo-dml.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<title></title>
1010
<author>Paul Harrison</author>
1111
<version>1.0</version>
12-
<lastModified>2025-06-06T09:52:58Z</lastModified>
12+
<lastModified>2025-06-06T13:27:14Z</lastModified>
1313
<import>
1414
<name>ivoa</name>
1515
<version>1.0</version>
@@ -67,7 +67,7 @@
6767
<vodml-ref>ivoa:string</vodml-ref>
6868
</datatype>
6969
<multiplicity>
70-
<minOccurs>1</minOccurs>
70+
<minOccurs>0</minOccurs>
7171
<maxOccurs>1</maxOccurs>
7272
</multiplicity>
7373
</attribute>
@@ -139,7 +139,7 @@
139139
<vodml-ref>ivoa:string</vodml-ref>
140140
</datatype>
141141
<multiplicity>
142-
<minOccurs>1</minOccurs>
142+
<minOccurs>0</minOccurs>
143143
<maxOccurs>1</maxOccurs>
144144
</multiplicity>
145145
</attribute>
@@ -151,7 +151,7 @@
151151
<vodml-ref>ivoa:string</vodml-ref>
152152
</datatype>
153153
<multiplicity>
154-
<minOccurs>1</minOccurs>
154+
<minOccurs>0</minOccurs>
155155
<maxOccurs>1</maxOccurs>
156156
</multiplicity>
157157
</attribute>
@@ -163,7 +163,7 @@
163163
<vodml-ref>ivoa:string</vodml-ref>
164164
</datatype>
165165
<multiplicity>
166-
<minOccurs>1</minOccurs>
166+
<minOccurs>0</minOccurs>
167167
<maxOccurs>1</maxOccurs>
168168
</multiplicity>
169169
</attribute>
@@ -175,19 +175,19 @@
175175
<vodml-ref>ivoa:string</vodml-ref>
176176
</datatype>
177177
<multiplicity>
178-
<minOccurs>1</minOccurs>
178+
<minOccurs>0</minOccurs>
179179
<maxOccurs>1</maxOccurs>
180180
</multiplicity>
181181
</attribute>
182182
<attribute>
183183
<vodml-id>Resource.res_version</vodml-id>
184184
<name>res_version</name>
185-
<description>Label associated with creation or availablilty of a version of a resource.</description>
185+
<description>Label associated with creation or availability of a version of a resource.</description>
186186
<datatype>
187187
<vodml-ref>ivoa:string</vodml-ref>
188188
</datatype>
189189
<multiplicity>
190-
<minOccurs>1</minOccurs>
190+
<minOccurs>0</minOccurs>
191191
<maxOccurs>1</maxOccurs>
192192
</multiplicity>
193193
</attribute>
@@ -199,7 +199,7 @@
199199
<vodml-ref>ivoa:real</vodml-ref>
200200
</datatype>
201201
<multiplicity>
202-
<minOccurs>1</minOccurs>
202+
<minOccurs>0</minOccurs>
203203
<maxOccurs>1</maxOccurs>
204204
</multiplicity>
205205
</attribute>
@@ -211,7 +211,7 @@
211211
<vodml-ref>ivoa:string</vodml-ref>
212212
</datatype>
213213
<multiplicity>
214-
<minOccurs>1</minOccurs>
214+
<minOccurs>0</minOccurs>
215215
<maxOccurs>1</maxOccurs>
216216
</multiplicity>
217217
</attribute>
@@ -223,7 +223,7 @@
223223
<vodml-ref>ivoa:string</vodml-ref>
224224
</datatype>
225225
<multiplicity>
226-
<minOccurs>1</minOccurs>
226+
<minOccurs>0</minOccurs>
227227
<maxOccurs>1</maxOccurs>
228228
</multiplicity>
229229
</attribute>
@@ -235,7 +235,7 @@
235235
<vodml-ref>ivoa:string</vodml-ref>
236236
</datatype>
237237
<multiplicity>
238-
<minOccurs>1</minOccurs>
238+
<minOccurs>0</minOccurs>
239239
<maxOccurs>1</maxOccurs>
240240
</multiplicity>
241241
</attribute>

vo-dml/RegTAP.vodml-binding.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<file>RegTAP.vo-dml.xml</file>
99
<java-package>org.ivoa.dm.regtap</java-package>
1010
<xml-targetnamespace prefix="regtap">http://ivoa.net/dm/models/vo-dml/experiment/regtap</xml-targetnamespace>
11-
<xml elementFormDefault="qualified"/>
11+
<xml elementFormDefault="qualified" compositionStyle="unwrapped"/>
1212
<rdb naturalJoin="true">
1313
<rdbmap vodml-id="Subject">
1414
<tableName>res_subject</tableName>

0 commit comments

Comments
 (0)