Skip to content

Commit 244074b

Browse files
committed
netcdf interface
1 parent a35c9fa commit 244074b

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

lib/bald/__init__.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -816,15 +816,28 @@ def load_netcdf(afilepath, baseuri=None, alias_dict=None, cache=None):
816816
response = cache['http://binary-array-ld.net/latest']
817817
reference_graph.parse(data=response.text, format='xml')
818818

819-
# reference_graph.parse('http://binary-array-ld.net/latest?_format=ttl')
819+
# # reference_graph.parse('http://binary-array-ld.net/latest?_format=ttl')
820+
# qstr = ('prefix bald: <http://binary-array-ld.net/latest/> '
821+
# 'prefix skos: <http://www.w3.org/2004/02/skos/core#> '
822+
# 'select ?s '
823+
# 'where { '
824+
# ' ?s rdfs:range ?type . '
825+
# 'filter(?type != rdfs:Literal) '
826+
# 'filter(?type != skos:Concept) '
827+
# '}')
828+
829+
# refs_ = reference_graph.query(qstr)
830+
820831
qstr = ('prefix bald: <http://binary-array-ld.net/latest/> '
821832
'prefix skos: <http://www.w3.org/2004/02/skos/core#> '
833+
'prefix owl: <http://www.w3.org/2002/07/owl#> '
822834
'select ?s '
823835
'where { '
824836
' ?s rdfs:range ?type . '
825-
'filter(?type != rdfs:Literal) '
826-
'filter(?type != skos:Concept) '
837+
' ?type rdf:type ?rtype . '
838+
'filter(?rtype = owl:Class) '
827839
'}')
840+
828841
refs = reference_graph.query(qstr)
829842

830843
ref_prefs = [str(ref[0]) for ref in list(refs)]

lib/bald/tests/integration/test_hdf_graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def test_match(self):
5151
f.close()
5252
root_container = bald.load_hdf5(tfile, cache=self.acache)
5353
html = root_container.viewgraph()
54-
with open(os.path.join(self.html_path, 'hdf_container_nest.html'), 'w') as sf:
55-
sf.write(html)
54+
# with open(os.path.join(self.html_path, 'hdf_container_nest.html'), 'w') as sf:
55+
# sf.write(html)
5656

5757

5858
if __name__ == '__main__':

0 commit comments

Comments
 (0)