Skip to content

Commit b87a78e

Browse files
authored
Merge pull request #98 from marqh/groups
Groups
2 parents aff4ad9 + ac800df commit b87a78e

20 files changed

+1654
-465
lines changed

lib/bald/__init__.py

Lines changed: 479 additions & 326 deletions
Large diffs are not rendered by default.

lib/bald/tests/integration/CDL/array_reference_external_prefix.cdl renamed to lib/bald/tests/integration/CDL/array_reference_external_prefix_context.cdl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@ variables:
1010
child_variable:rdf__type = "bald__Reference" ;
1111

1212
// global attributes:
13-
:_NCProperties = "version=1|netcdflibversion=4.4.1|hdf5libversion=1.8.17" ;
1413
:rdf__type = "bald__Container" ;
15-
:bald__isPrefixedBy = "http://def.binary-array-ld.net/prefixes" ;
1614
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
netcdf tmpMwXy8U {
2+
dimensions:
3+
x_t = 144 ;
4+
y_t = 91 ;
5+
x_q = 144 ;
6+
y_q = 90 ;
7+
time = 4 ;
8+
variables:
9+
float x_t(x_t) ;
10+
x_t:cf__standard_name = "longitude" ;
11+
x_t:nc__units = "degrees" ;
12+
13+
14+
float y_t(y_t) ;
15+
y_t:cf__standard_name = "latitude" ;
16+
y_t:nc__units = "degrees" ;
17+
18+
19+
float x_q(x_q) ;
20+
x_q:cf__standard_name = "longitude" ;
21+
x_q:nc__units = "degrees" ;
22+
23+
24+
float y_q(y_q) ;
25+
y_q:cf__standard_name = "latitude" ;
26+
y_q:nc__units = "degrees" ;
27+
28+
int theta_points ;
29+
theta_points:georef__wkt_crs = "http://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::4326" ;
30+
theta_points:georef__coord_tuple = "(y_t x_t)" ;
31+
theta_points:rdfs__label = "Theta Points" ;
32+
theta_points:dct__description = "Arakawa C Theta points defined with respect to a 2D WGS84 geodetic surface." ;
33+
34+
int u_points ;
35+
u_points:cf__wkt_crs = "http://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::4326" ;
36+
u_points:georef__coord_tuple = "(y_t x_q)" ;
37+
u_points:rdfs__label = "U Points" ;
38+
u_points:dct__description = "Arakawa C U points defined with respect to a 2D WGS84 geodetic surface." ;
39+
40+
int v_points ;
41+
v_points:georef__wkt_crs = "http://www.epsg-registry.org/export.htm?wkt=urn:ogc:def:crs:EPSG::4326" ;
42+
v_points:georef__coord_tuple = "(y_q x_t)" ;
43+
v_points:rdfs__label = "V Points" ;
44+
v_points:dct__description = "Arakawa C V points defined with respect to a 2D WGS84 geodetic surface." ;
45+
46+
string time(time) ;
47+
time:rdfs__label = "Time" ;
48+
49+
// global attributes:
50+
:bald__isPrefixedBy = "prefix_list" ;
51+
52+
data:
53+
54+
y_t = -90, -88, -86, -84, -82, -80, -78, -76, -74, -72, -70, -68, -66, -64, -62, -60, -58, -56, -54, -52, -50, -48, -46, -44, -42, -40, -38, -36, -34, -32, -30, -28, -26, -24, -22, -20, -18, -16, -14, -12, -10, -8, -6, -4, -2, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90 ;
55+
56+
x_t = 0.0, 2.5, 5.0, 7.5, 10.0, 12.5, 15.0, 17.5, 20.0, 22.5, 25.0, 27.5, 30.0, 32.5, 35.0, 37.5, 40.0, 42.5, 45.0, 47.5, 50.0, 52.5, 55.0, 57.5, 60.0, 62.5, 65.0, 67.5, 70.0, 72.5, 75.0, 77.5, 80.0, 82.5, 85.0, 87.5, 90.0, 92.5, 95.0, 97.5, 100.0, 102.5, 105.0, 107.5, 110.0, 112.5, 115.0, 117.5, 120.0, 122.5, 125.0, 127.5, 130.0, 132.5, 135.0, 137.5, 140.0, 142.5, 145.0, 147.5, 150.0, 152.5, 155.0, 157.5, 160.0, 162.5, 165.0, 167.5, 170.0, 172.5, 175.0, 177.5, 180.0, 182.5, 185.0, 187.5, 190.0, 192.5, 195.0, 197.5, 200.0, 202.5, 205.0, 207.5, 210.0, 212.5, 215.0, 217.5, 220.0, 222.5, 225.0, 227.5, 230.0, 232.5, 235.0, 237.5, 240.0, 242.5, 245.0, 247.5, 250.0, 252.5, 255.0, 257.5, 260.0, 262.5, 265.0, 267.5, 270.0, 272.5, 275.0, 277.5, 280.0, 282.5, 285.0, 287.5, 290.0, 292.5, 295.0, 297.5, 300.0, 302.5, 305.0, 307.5, 310.0, 312.5, 315.0, 317.5, 320.0, 322.5, 325.0, 327.5, 330.0, 332.5, 335.0, 337.5, 340.0, 342.5, 345.0, 347.5, 350.0, 352.5, 355.0, 357.5 ;
57+
58+
y_q = -89, -87, -85, -83, -81, -79, -77, -75, -73, -71, -69, -67, -65, -63, -61, -59, -57, -55, -53, -51, -49, -47, -45, -43, -41, -39, -37, -35, -33, -31, -29, -27, -25, -23, -21, -19, -17, -15, -13, -11, -9, -7, -5, -3, -1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89 ;
59+
60+
x_q = 1.25, 3.75, 6.25, 8.75, 11.25, 13.75, 16.25, 18.75, 21.25, 23.75, 26.25, 28.75, 31.25, 33.75, 36.25, 38.75, 41.25, 43.75, 46.25, 48.75, 51.25, 53.75, 56.25, 58.75, 61.25, 63.75, 66.25, 68.75, 71.25, 73.75, 76.25, 78.75, 81.25, 83.75, 86.25, 88.75, 91.25, 93.75, 96.25, 98.75, 101.25, 103.75, 106.25, 108.75, 111.25, 113.75, 116.25, 118.75, 121.25, 123.75, 126.25, 128.75, 131.25, 133.75, 136.25, 138.75, 141.25, 143.75, 146.25, 148.75, 151.25, 153.75, 156.25, 158.75, 161.25, 163.75, 166.25, 168.75, 171.25, 173.75, 176.25, 178.75, 181.25, 183.75, 186.25, 188.75, 191.25, 193.75, 196.25, 198.75, 201.25, 203.75, 206.25, 208.75, 211.25, 213.75, 216.25, 218.75, 221.25, 223.75, 226.25, 228.75, 231.25, 233.75, 236.25, 238.75, 241.25, 243.75, 246.25, 248.75, 251.25, 253.75, 256.25, 258.75, 261.25, 263.75, 266.25, 268.75, 271.25, 273.75, 276.25, 278.75, 281.25, 283.75, 286.25, 288.75, 291.25, 293.75, 296.25, 298.75, 301.25, 303.75, 306.25, 308.75, 311.25, 313.75, 316.25, 318.75, 321.25, 323.75, 326.25, 328.75, 331.25, 333.75, 336.25, 338.75, 341.25, 343.75, 346.25, 348.75, 351.25, 353.75, 356.25, 358.75 ;
61+
62+
time = "2020-05-05T00:00Z", "2020-05-05T06:00Z", "2020-05-05T12:00Z", "2020-05-05T18:00Z" ;
63+
64+
// prefix group
65+
group: prefix_list {
66+
:bald__ = "https://www.opengis.net/def/binary-array-ld/" ;
67+
:rdf__ = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ;
68+
:bald__ = "https://www.opengis.net/def/binary-array-ld/" ;
69+
:rdf__ = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ;
70+
:rdfs__ = "http://www.w3.org/2000/01/rdf-schema#" ;
71+
:cf__ = "http://def.scitools.org.uk/CFTerms/" ;
72+
:nc__ = "http://def.scitools.org.uk/NetCDF/" ;
73+
:geo__ = "http://www.opengis.net/ont/geosparql#" ;
74+
:nc__ = "http://def.scitools.org.uk/NetCDF/" ;
75+
:georef__ = "http://def.scitools.org.uk/referencing-by-coordinates/" ;
76+
:dct__ = "http://purl.org/dc/terms/" ;
77+
}
78+
79+
group: vector_quantities {
80+
:vq__vector_quantities = "wind" ;
81+
82+
83+
group: wind {
84+
variables:
85+
86+
float u_wind(time, y_t, x_q) ;
87+
u_wind:cf__standard_name = "x_wind" ;
88+
u_wind:nc__units = "m s-1" ;
89+
u_wind:georef__domain = "u_points" ;
90+
91+
float v_wind(time, y_q, x_t) ;
92+
v_wind:cf__standard_name = "y_wind" ;
93+
v_wind:nc__units = "m s-1" ;
94+
v_wind:georef__domain = "v_points" ;
95+
96+
:vq__i_component = "x_wind" ;
97+
:vq__j_component = "y_wind" ;
98+
:rdfs__label = "Wind Vector" ;
99+
}
100+
101+
}
102+
103+
group: scalar_quantities {
104+
variables:
105+
106+
float air_pressure(time, y_t, x_t) ;
107+
air_pressure:cf__standard_name = "air_pressure" ;
108+
air_pressure:nc__units = "Pa" ;
109+
air_pressure:georef__domain = "theta_points" ;
110+
111+
}
112+
113+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
netcdf ogcClassA {
2+
dimensions:
3+
d0 = 1 ;
4+
d1 = 1 ;
5+
variables:
6+
int var0 ;
7+
int var1 ;
8+
9+
data:
10+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
netcdf ogcClassB {
2+
dimensions:
3+
d0 = 1 ;
4+
d1 = 1 ;
5+
variables:
6+
int var0 ;
7+
var0:rdfs__label = "rdfs__label" ;
8+
int var1 ;
9+
var1:rdfs__label = "rdfs__label" ;
10+
int prefix_list ;
11+
prefix_list:bald__ = "http://binary-array-ld.net/latest/" ;
12+
prefix_list:rdf__ = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ;
13+
prefix_list:rdfs__ = "http://www.w3.org/2000/01/rdf-schema#" ;
14+
:bald__isPrefixedBy = "prefix_list" ;
15+
data:
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
netcdf ogcClassC {
2+
dimensions:
3+
d0 = 1 ;
4+
d1 = 1 ;
5+
variables:
6+
int var0 ;
7+
int var1 ;
8+
:title = "Sample netCDF file definition with alias terms from the netCDF user guide" ;
9+
data:
10+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
netcdf ogcClassD {
2+
dimensions:
3+
d0 = 1 ;
4+
d1 = 1 ;
5+
variables:
6+
int var0 ;
7+
var0:rdfs__label = "rdfs__label" ;
8+
int var1 ;
9+
var1:rdfs__label = "rdfs__label" ;
10+
int prefix_list ;
11+
prefix_list:bald__ = "http://binary-array-ld.net/latest/" ;
12+
prefix_list:rdf__ = "http://www.w3.org/1999/02/22-rdf-syntax-ns#" ;
13+
prefix_list:rdfs__ = "http://www.w3.org/2000/01/rdf-schema#" ;
14+
:bald__isPrefixedBy = "prefix_list" ;
15+
:title = "Sample netCDF file definition with alias terms from the netCDF user guide" ;
16+
data:
17+
}

lib/bald/tests/integration/TTL/GEMS_CO2_Apr2006.ttl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ this:co2 a bald:Array ;
3333
NetCDF:scale_factor 0.000981685145029486 ;
3434
NetCDF:units "kg kg**-1" ;
3535
bald:references [ a bald:Reference ;
36-
bald:target this:levelist ;
37-
bald:targetReshape ( 1 60 1 1 ) ;
38-
bald:targetShape ( 60 ) ],
39-
[ a bald:Reference ;
4036
bald:target this:time ;
4137
bald:targetReshape ( 1 1 1 1 ) ;
4238
bald:targetShape ( 1 ) ],
4339
[ a bald:Reference ;
4440
bald:target this:latitude ;
4541
bald:targetReshape ( 1 1 181 1 ) ;
4642
bald:targetShape ( 181 ) ],
43+
[ a bald:Reference ;
44+
bald:target this:levelist ;
45+
bald:targetReshape ( 1 60 1 1 ) ;
46+
bald:targetShape ( 60 ) ],
4747
[ a bald:Reference ;
4848
bald:target this:longitude ;
4949
bald:targetReshape ( 1 1 1 360 ) ;
@@ -56,9 +56,9 @@ this:lnsp a bald:Array ;
5656
NetCDF:add_offset 11.2087164280841 ;
5757
NetCDF:long_name "Logarithm of surface pressure" ;
5858
bald:references [ a bald:Reference ;
59-
bald:target this:time ;
60-
bald:targetReshape ( 1 1 1 1 ) ;
61-
bald:targetShape ( 1 ) ],
59+
bald:target this:latitude ;
60+
bald:targetReshape ( 1 1 181 1 ) ;
61+
bald:targetShape ( 181 ) ],
6262
[ a bald:Reference ;
6363
bald:target this:levelist ;
6464
bald:targetReshape ( 1 60 1 1 ) ;
@@ -68,34 +68,34 @@ this:lnsp a bald:Array ;
6868
bald:targetReshape ( 1 1 1 360 ) ;
6969
bald:targetShape ( 360 ) ],
7070
[ a bald:Reference ;
71-
bald:target this:latitude ;
72-
bald:targetReshape ( 1 1 181 1 ) ;
73-
bald:targetShape ( 181 ) ] ;
71+
bald:target this:time ;
72+
bald:targetReshape ( 1 1 1 1 ) ;
73+
bald:targetShape ( 1 ) ] ;
7474
bald:shape ( 1 60 181 360 ) .
7575

7676
this:latitude a bald:Array ;
7777
CFTerms:standard_name <http://vocab.nerc.ac.uk/standard_name/latitude/> ;
7878
NetCDF:units "degrees_north" ;
79-
bald:first_value 90.0 ;
80-
bald:last_value -90.0 ;
79+
bald:arrayFirstValue 90.0 ;
80+
bald:arrayLastValue -90.0 ;
8181
bald:shape ( 181 ) .
8282

8383
this:levelist a bald:Array ;
8484
NetCDF:long_name "model_level_number" ;
85-
bald:first_value 1 ;
86-
bald:last_value 60 ;
85+
bald:arrayFirstValue 1 ;
86+
bald:arrayLastValue 60 ;
8787
bald:shape ( 60 ) .
8888

8989
this:longitude a bald:Array ;
9090
CFTerms:standard_name <http://vocab.nerc.ac.uk/standard_name/longitude/> ;
9191
NetCDF:units "degrees_east" ;
92-
bald:first_value 0.0 ;
93-
bald:last_value 359.0 ;
92+
bald:arrayFirstValue 0.0 ;
93+
bald:arrayLastValue 359.0 ;
9494
bald:shape ( 360 ) .
9595

9696
this:time a bald:Array ;
9797
CFTerms:standard_name <http://vocab.nerc.ac.uk/standard_name/time/> ;
9898
NetCDF:units "hours since 1900-01-01 00:00:0.0" ;
99-
bald:first_value "2006-04-01T00:00:00"^^xsd:dateTime ;
99+
bald:arrayFirstValue "2006-04-01T00:00:00"^^xsd:dateTime ;
100100
bald:shape ( 1 ) .
101101

lib/bald/tests/integration/TTL/array_reference_external_prefix.ttl renamed to lib/bald/tests/integration/TTL/array_reference_external_prefix_context.ttl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
@prefix dct: <http://purl.org/dc/terms/> .
44
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
55
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
6-
@prefix this: <file://CDL/array_reference_external_prefix.cdl/> .
6+
@prefix this: <file://CDL/array_reference_external_prefix_context.cdl/> .
77
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
88
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
99

@@ -14,8 +14,7 @@ this: a bald:Container ;
1414
dcat:mediaType [ a dcat:MediaType ;
1515
dct:identifier "application/x-netcdf" ] ] ;
1616
bald:contains this:child_variable,
17-
this:parent_variable ;
18-
bald:isPrefixedBy <http://def.binary-array-ld.net/prefixes> .
17+
this:parent_variable .
1918

2019
this:parent_variable a bald:Array ;
2120
bald:references this:child_variable ;

0 commit comments

Comments
 (0)