Skip to content

Commit fdecd8d

Browse files
committed
update test results
1 parent f67cc50 commit fdecd8d

16 files changed

+292
-428
lines changed

lib/bald/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def unpack_predicate(self, astring):
396396
elif len(results) == 1:
397397
result = str(results[0][0])
398398
if result == astring:
399-
result = self.baseuri + '/' + result
399+
result = self.baseuri + result
400400
return result
401401

402402
def unpack_rdfobject(self, astring, predicate):
@@ -1164,7 +1164,10 @@ def load_hdf5(afilepath, baseuri=None, alias_dict=None, cache=None):
11641164
# unused?
11651165
cache = {}
11661166
if baseuri is None:
1167-
baseuri = 'file://{}'.format(afilepath)
1167+
baseuri = 'file://{}/'.format(afilepath)
1168+
1169+
elif type(baseuri) == str and not baseuri.endswith('/'):
1170+
baseuri = '{}/'.format(baseuri)
11681171

11691172
root_container, file_variables = _hdf_group(fhandle, baseuri=baseuri,
11701173
alias_dict=alias_dict, cache=cache)

lib/bald/tests/integration/HTML/array_reference.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,11 @@
174174
return cell;
175175
};
176176

177-
var file://CDL/array_reference.cdl = instance('file://CDL/array_reference.cdl:<a xlink:href="http://binary-array-ld.net/latest/Container" xlink:show=new text-decoration="underline">bald__Container</a>', ['<a xlink:href="http://binary-array-ld.net/latest/contains" xlink:show=new text-decoration="underline">bald__contains</a>: |'], '#878800');
178-
var file://CDL/array_reference.cdl/child_variable = instance('file://CDL/array_reference.cdl/child_variable:<a xlink:href="http://binary-array-ld.net/latest/Array" xlink:show=new text-decoration="underline">bald__Array</a>, <a xlink:href="http://binary-array-ld.net/latest/Reference" xlink:show=new text-decoration="underline">bald__Reference</a>', ['<a xlink:href="http://binary-array-ld.net/latest/array" xlink:show=new text-decoration="underline">bald__array</a>: |', '<a xlink:href="http://binary-array-ld.net/latest/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11, 17'], '#878800');
179-
var file://CDL/array_reference.cdl/parent_variable = instance('file://CDL/array_reference.cdl/parent_variable:<a xlink:href="http://binary-array-ld.net/latest/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="http://binary-array-ld.net/latest/references" xlink:show=new text-decoration="underline">bald__references</a>: |', '<a xlink:href="http://binary-array-ld.net/latest/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11, 17'], '#878800');
180-
link(file://CDL/array_reference.cdl, file://CDL/array_reference.cdl/child_variable, 'bald__contains', 'top', true);
181-
link(file://CDL/array_reference.cdl, file://CDL/array_reference.cdl/parent_variable, 'bald__contains', 'top', true);
182-
link(file://CDL/array_reference.cdl/child_variable, file://CDL/array_reference.cdl/child_variable, 'bald__array', 'bottom');
177+
var file://CDL/array_reference.cdl/ = instance('file://CDL/array_reference.cdl/:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Container" xlink:show=new text-decoration="underline">bald__Container</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/contains" xlink:show=new text-decoration="underline">bald__contains</a>: |'], '#878800');
178+
var file://CDL/array_reference.cdl/child_variable = instance('file://CDL/array_reference.cdl/child_variable:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Array" xlink:show=new text-decoration="underline">bald__Array</a>, <a xlink:href="https://www.opengis.net/def/binary-array-ld/Reference" xlink:show=new text-decoration="underline">bald__Reference</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11, 17'], '#878800');
179+
var file://CDL/array_reference.cdl/parent_variable = instance('file://CDL/array_reference.cdl/parent_variable:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/references" xlink:show=new text-decoration="underline">bald__references</a>: |', '<a xlink:href="https://www.opengis.net/def/binary-array-ld/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11, 17'], '#878800');
180+
link(file://CDL/array_reference.cdl/, file://CDL/array_reference.cdl/child_variable, 'bald__contains', 'top', true);
181+
link(file://CDL/array_reference.cdl/, file://CDL/array_reference.cdl/parent_variable, 'bald__contains', 'top', true);
183182
link(file://CDL/array_reference.cdl/parent_variable, file://CDL/array_reference.cdl/child_variable, 'bald__references');
184183
joint.layout.DirectedGraph.layout(graph, { setLinkVertices: false,
185184
nodeSep: 150, rankSep: 100,

lib/bald/tests/integration/HTML/multi_array_reference.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -174,23 +174,23 @@
174174
return cell;
175175
};
176176

177-
var file://CDL/multi_array_reference.cdl = instance('file://CDL/multi_array_reference.cdl:<a xlink:href="http://binary-array-ld.net/latest/Container" xlink:show=new text-decoration="underline">bald__Container</a>', ['<a xlink:href="http://binary-array-ld.net/latest/contains" xlink:show=new text-decoration="underline">bald__contains</a>: |'], '#878800');
178-
var file://CDL/multi_array_reference.cdl/data_variable1 = instance('file://CDL/multi_array_reference.cdl/data_variable1:<a xlink:href="http://binary-array-ld.net/latest/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="http://binary-array-ld.net/latest/references" xlink:show=new text-decoration="underline">bald__references</a>: |', '<a xlink:href="http://binary-array-ld.net/latest/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11, 17', 'long_name: Gerald', 'obtype: <a xlink:href="http://codes.wmo.int/common/observation-type/METCE/2013/SamplingObservation" xlink:show=new text-decoration="underline">metce__SamplingObservation</a>'], '#878800');
179-
var file://CDL/multi_array_reference.cdl/data_variable2 = instance('file://CDL/multi_array_reference.cdl/data_variable2:<a xlink:href="http://binary-array-ld.net/latest/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="http://binary-array-ld.net/latest/references" xlink:show=new text-decoration="underline">bald__references</a>: |', '<a xlink:href="http://binary-array-ld.net/latest/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11, 17', 'long_name: Imelda', 'obtype: <a xlink:href="http://codes.wmo.int/common/observation-type/METCE/2013/SamplingObservation" xlink:show=new text-decoration="underline">metce__SamplingObservation</a>'], '#878800');
180-
var file://CDL/multi_array_reference.cdl/list_collection = instance('file://CDL/multi_array_reference.cdl/list_collection:<a xlink:href="http://binary-array-ld.net/latest/Resource" xlink:show=new text-decoration="underline">bald__Resource</a>', ['<a xlink:href="http://binary-array-ld.net/latest/references" xlink:show=new text-decoration="underline">bald__references</a>: |'], '#878800');
181-
var file://CDL/multi_array_reference.cdl/location_reference_system = instance('file://CDL/multi_array_reference.cdl/location_reference_system:<a xlink:href="http://binary-array-ld.net/latest/Resource" xlink:show=new text-decoration="underline">bald__Resource</a>', ['pcode: 4897'], '#878800');
182-
var file://CDL/multi_array_reference.cdl/location_variable = instance('file://CDL/multi_array_reference.cdl/location_variable:<a xlink:href="http://binary-array-ld.net/latest/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="http://binary-array-ld.net/latest/references" xlink:show=new text-decoration="underline">bald__references</a>: |', '<a xlink:href="http://binary-array-ld.net/latest/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11, 17'], '#878800');
183-
var file://CDL/multi_array_reference.cdl/pdim0 = instance('file://CDL/multi_array_reference.cdl/pdim0:<a xlink:href="http://binary-array-ld.net/latest/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="http://binary-array-ld.net/latest/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11'], '#878800');
184-
var file://CDL/multi_array_reference.cdl/pdim1 = instance('file://CDL/multi_array_reference.cdl/pdim1:<a xlink:href="http://binary-array-ld.net/latest/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="http://binary-array-ld.net/latest/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 17'], '#878800');
185-
var file://CDL/multi_array_reference.cdl/set_collection = instance('file://CDL/multi_array_reference.cdl/set_collection:<a xlink:href="http://binary-array-ld.net/latest/Resource" xlink:show=new text-decoration="underline">bald__Resource</a>', ['<a xlink:href="http://binary-array-ld.net/latest/references" xlink:show=new text-decoration="underline">bald__references</a>: |'], '#878800');
186-
link(file://CDL/multi_array_reference.cdl, file://CDL/multi_array_reference.cdl/data_variable1, 'bald__contains', 'top', true);
187-
link(file://CDL/multi_array_reference.cdl, file://CDL/multi_array_reference.cdl/data_variable2, 'bald__contains', 'top', true);
188-
link(file://CDL/multi_array_reference.cdl, file://CDL/multi_array_reference.cdl/list_collection, 'bald__contains', 'top', true);
189-
link(file://CDL/multi_array_reference.cdl, file://CDL/multi_array_reference.cdl/location_reference_system, 'bald__contains', 'top', true);
190-
link(file://CDL/multi_array_reference.cdl, file://CDL/multi_array_reference.cdl/location_variable, 'bald__contains', 'top', true);
191-
link(file://CDL/multi_array_reference.cdl, file://CDL/multi_array_reference.cdl/pdim0, 'bald__contains', 'top', true);
192-
link(file://CDL/multi_array_reference.cdl, file://CDL/multi_array_reference.cdl/pdim1, 'bald__contains', 'top', true);
193-
link(file://CDL/multi_array_reference.cdl, file://CDL/multi_array_reference.cdl/set_collection, 'bald__contains', 'top', true);
177+
var file://CDL/multi_array_reference.cdl/ = instance('file://CDL/multi_array_reference.cdl/:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Container" xlink:show=new text-decoration="underline">bald__Container</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/contains" xlink:show=new text-decoration="underline">bald__contains</a>: |'], '#878800');
178+
var file://CDL/multi_array_reference.cdl/data_variable1 = instance('file://CDL/multi_array_reference.cdl/data_variable1:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/references" xlink:show=new text-decoration="underline">bald__references</a>: |', '<a xlink:href="https://www.opengis.net/def/binary-array-ld/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11, 17', 'long_name: Gerald', 'obtype: <a xlink:href="http://codes.wmo.int/common/observation-type/METCE/2013/SamplingObservation" xlink:show=new text-decoration="underline">metce__SamplingObservation</a>'], '#878800');
179+
var file://CDL/multi_array_reference.cdl/data_variable2 = instance('file://CDL/multi_array_reference.cdl/data_variable2:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/references" xlink:show=new text-decoration="underline">bald__references</a>: |', '<a xlink:href="https://www.opengis.net/def/binary-array-ld/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11, 17', 'long_name: Imelda', 'obtype: <a xlink:href="http://codes.wmo.int/common/observation-type/METCE/2013/SamplingObservation" xlink:show=new text-decoration="underline">metce__SamplingObservation</a>'], '#878800');
180+
var file://CDL/multi_array_reference.cdl/list_collection = instance('file://CDL/multi_array_reference.cdl/list_collection:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Resource" xlink:show=new text-decoration="underline">bald__Resource</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/references" xlink:show=new text-decoration="underline">bald__references</a>: |'], '#878800');
181+
var file://CDL/multi_array_reference.cdl/location_reference_system = instance('file://CDL/multi_array_reference.cdl/location_reference_system:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Resource" xlink:show=new text-decoration="underline">bald__Resource</a>', ['pcode: 4897'], '#878800');
182+
var file://CDL/multi_array_reference.cdl/location_variable = instance('file://CDL/multi_array_reference.cdl/location_variable:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/references" xlink:show=new text-decoration="underline">bald__references</a>: |', '<a xlink:href="https://www.opengis.net/def/binary-array-ld/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11, 17'], '#878800');
183+
var file://CDL/multi_array_reference.cdl/pdim0 = instance('file://CDL/multi_array_reference.cdl/pdim0:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 11'], '#878800');
184+
var file://CDL/multi_array_reference.cdl/pdim1 = instance('file://CDL/multi_array_reference.cdl/pdim1:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Array" xlink:show=new text-decoration="underline">bald__Array</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/shape" xlink:show=new text-decoration="underline">bald__shape</a>: 17'], '#878800');
185+
var file://CDL/multi_array_reference.cdl/set_collection = instance('file://CDL/multi_array_reference.cdl/set_collection:<a xlink:href="https://www.opengis.net/def/binary-array-ld/Resource" xlink:show=new text-decoration="underline">bald__Resource</a>', ['<a xlink:href="https://www.opengis.net/def/binary-array-ld/references" xlink:show=new text-decoration="underline">bald__references</a>: |'], '#878800');
186+
link(file://CDL/multi_array_reference.cdl/, file://CDL/multi_array_reference.cdl/data_variable1, 'bald__contains', 'top', true);
187+
link(file://CDL/multi_array_reference.cdl/, file://CDL/multi_array_reference.cdl/data_variable2, 'bald__contains', 'top', true);
188+
link(file://CDL/multi_array_reference.cdl/, file://CDL/multi_array_reference.cdl/list_collection, 'bald__contains', 'top', true);
189+
link(file://CDL/multi_array_reference.cdl/, file://CDL/multi_array_reference.cdl/location_reference_system, 'bald__contains', 'top', true);
190+
link(file://CDL/multi_array_reference.cdl/, file://CDL/multi_array_reference.cdl/location_variable, 'bald__contains', 'top', true);
191+
link(file://CDL/multi_array_reference.cdl/, file://CDL/multi_array_reference.cdl/pdim0, 'bald__contains', 'top', true);
192+
link(file://CDL/multi_array_reference.cdl/, file://CDL/multi_array_reference.cdl/pdim1, 'bald__contains', 'top', true);
193+
link(file://CDL/multi_array_reference.cdl/, file://CDL/multi_array_reference.cdl/set_collection, 'bald__contains', 'top', true);
194194
link(file://CDL/multi_array_reference.cdl/data_variable1, file://CDL/multi_array_reference.cdl/location_variable, 'bald__references');
195195
link(file://CDL/multi_array_reference.cdl/data_variable2, file://CDL/multi_array_reference.cdl/location_variable, 'bald__references');
196196
link(file://CDL/multi_array_reference.cdl/location_variable, file://CDL/multi_array_reference.cdl/location_reference_system, 'bald__references');

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ this:co2 a bald:Array ;
2626
NetCDF:scale_factor 0.000981685145029486 ;
2727
NetCDF:units "kg kg**-1" ;
2828
bald:references [ a bald:Reference ;
29-
bald:target this:time ;
30-
bald:targetReshape ( 1 1 1 1 ) ;
31-
bald:targetShape ( 1 ) ],
32-
[ a bald:Reference ;
33-
bald:target this:longitude ;
34-
bald:targetReshape ( 1 1 1 360 ) ;
35-
bald:targetShape ( 360 ) ],
36-
[ a bald:Reference ;
3729
bald:target this:levelist ;
3830
bald:targetReshape ( 1 60 1 1 ) ;
3931
bald:targetShape ( 60 ) ],
4032
[ a bald:Reference ;
4133
bald:target this:latitude ;
4234
bald:targetReshape ( 1 1 181 1 ) ;
43-
bald:targetShape ( 181 ) ] ;
35+
bald:targetShape ( 181 ) ],
36+
[ a bald:Reference ;
37+
bald:target this:time ;
38+
bald:targetReshape ( 1 1 1 1 ) ;
39+
bald:targetShape ( 1 ) ],
40+
[ a bald:Reference ;
41+
bald:target this:longitude ;
42+
bald:targetReshape ( 1 1 1 360 ) ;
43+
bald:targetShape ( 360 ) ] ;
4444
bald:shape ( 1 60 181 360 ) .
4545

4646
this:lnsp a bald:Array ;
@@ -49,21 +49,21 @@ this:lnsp a bald:Array ;
4949
NetCDF:add_offset 11.2087164280841 ;
5050
NetCDF:long_name "Logarithm of surface pressure" ;
5151
bald:references [ a bald:Reference ;
52-
bald:target this:latitude ;
53-
bald:targetReshape ( 1 1 181 1 ) ;
54-
bald:targetShape ( 181 ) ],
52+
bald:target this:longitude ;
53+
bald:targetReshape ( 1 1 1 360 ) ;
54+
bald:targetShape ( 360 ) ],
5555
[ a bald:Reference ;
5656
bald:target this:time ;
5757
bald:targetReshape ( 1 1 1 1 ) ;
5858
bald:targetShape ( 1 ) ],
59+
[ a bald:Reference ;
60+
bald:target this:latitude ;
61+
bald:targetReshape ( 1 1 181 1 ) ;
62+
bald:targetShape ( 181 ) ],
5963
[ a bald:Reference ;
6064
bald:target this:levelist ;
6165
bald:targetReshape ( 1 60 1 1 ) ;
62-
bald:targetShape ( 60 ) ],
63-
[ a bald:Reference ;
64-
bald:target this:longitude ;
65-
bald:targetReshape ( 1 1 1 360 ) ;
66-
bald:targetShape ( 360 ) ] ;
66+
bald:targetShape ( 60 ) ] ;
6767
bald:shape ( 1 60 181 360 ) .
6868

6969
this:latitude a bald:Array ;

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,30 @@
22
@prefix DA: <https://codes.nws.noaa.gov/DataAssimilation> .
33
@prefix NWP: <https://codes.nws.noaa.gov/NumericalWeatherPrediction> .
44
@prefix StatPP: <https://codes.nws.noaa.gov/StatisticalPostProcessing> .
5-
@prefix bald: <http://binary-array-ld.net/latest/> .
5+
@prefix bald: <https://www.opengis.net/def/binary-array-ld/> .
6+
@prefix bald1: <https://www.opengis.net/def/binary-array-ld/x> .
67
@prefix cf_sname: <http://vocab.nerc.ac.uk/standard_name/> .
78
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
89
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
910
@prefix this: <file://CDL/ProcessChain0300.cdl/> .
1011
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
1112
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
1213

13-
<file://CDL/ProcessChain0300.cdl> a bald:Container ;
14+
this: a bald:xContainer ;
1415
this:process_chain "gfsmos_process_chain" ;
15-
bald:contains this:gfsmos_process_chain,
16+
bald:xcontains this:gfsmos_process_chain,
1617
this:step1,
1718
this:step2 ;
18-
bald:isPrefixedBy "prefix_list" .
19+
bald:xisPrefixedBy "prefix_list" .
1920

20-
this:gfsmos_process_chain a bald:Resource ;
21+
this:gfsmos_process_chain a bald:xResource ;
2122
this:OM_Process "(step1 step2)" .
2223

23-
this:step1 a bald:Resource ;
24+
this:step1 a bald:xResource ;
2425
this:LE_ProcessStep <https://codes.nws.noaa.gov/NumericalWeatherPrediction/Models/GFS13> ;
2526
this:LE_Source <https://codes.nws.noaa.gov/DataAssimilation/Methods/GDAS13> .
2627

27-
this:step2 a bald:Resource ;
28+
this:step2 a bald:xResource ;
2829
this:LE_ProcessStep <https://codes.nws.noaa.gov/StatisticalPostProcessing/Methods/GFSMOS05> ;
2930
this:LE_Source <https://codes.nws.noaa.gov/NumericalWeatherPrediction/Models/GFS13> .
3031

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
@prefix bald: <http://binary-array-ld.net/latest/> .
1+
@prefix bald: <https://www.opengis.net/def/binary-array-ld/> .
22
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
33
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
44
@prefix this: <file://CDL/array_reference.cdl/> .
55
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
66
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
77

8-
<file://CDL/array_reference.cdl> a bald:Container ;
8+
this: a bald:Container ;
99
bald:contains this:child_variable,
1010
this:parent_variable ;
1111
bald:isPrefixedBy "prefix_list" .
@@ -16,6 +16,5 @@ this:parent_variable a bald:Array ;
1616

1717
this:child_variable a bald:Array,
1818
bald:Reference ;
19-
bald:array this:child_variable ;
2019
bald:shape ( 11 17 ) .
2120

0 commit comments

Comments
 (0)