@@ -283,12 +283,12 @@ def check_uri(self, uri):
283
283
return result
284
284
285
285
286
- class Subject (object ):
287
- _rdftype = 'bald__Subject '
286
+ class Resource (object ):
287
+ _rdftype = 'bald__Resource '
288
288
def __init__ (self , baseuri , relative_id , attrs = None , prefixes = None ,
289
289
aliases = None , alias_graph = None ):
290
290
"""
291
- A subject of metadata statements.
291
+ A resource of metadata statements.
292
292
293
293
attrs: an dictionary of key value pair attributes
294
294
"""
@@ -491,7 +491,7 @@ def _graph_elem_attrs(self, remaining_attrs):
491
491
if is_http_uri (vuri ):
492
492
vstr = self .link_template
493
493
vstr = vstr .format (url = vuri , key = val )
494
- elif isinstance (val , Subject ):
494
+ elif isinstance (val , Resource ):
495
495
vstr = ''
496
496
else :
497
497
vstr = '{key}' .format (key = val )
@@ -519,7 +519,7 @@ def _graph_elem_attrs(self, remaining_attrs):
519
519
520
520
def viewgraph (self ):
521
521
"""
522
- Return html to render the Subject as a graph diagram, using the JointJS engine.
522
+ Return html to render the Resource as a graph diagram, using the JointJS engine.
523
523
524
524
"""
525
525
@@ -555,7 +555,7 @@ def rdfnode(self, graph):
555
555
for obj in objs :
556
556
557
557
rdfpred = self .unpack_predicate (attr )
558
- if isinstance (obj , Subject ):
558
+ if isinstance (obj , Resource ):
559
559
if obj .identity is None :
560
560
rdfobj = obj .rdfnode (graph )
561
561
else :
@@ -582,7 +582,7 @@ def rdfnode(self, graph):
582
582
elif isinstance (objs , list ):
583
583
list_items .append (rdfobj )
584
584
# recurse and build the related objects
585
- if isinstance (obj , Subject ) and obj .identity is not None :
585
+ if isinstance (obj , Resource ) and obj .identity is not None :
586
586
obj_ref = rdflib .URIRef (obj .identity )
587
587
if not ((obj_ref , None , None ) in graph ):
588
588
node = obj .rdfnode (graph )
@@ -595,11 +595,11 @@ def rdfnode(self, graph):
595
595
596
596
def rdfgraph (self ):
597
597
"""
598
- Return an rdflib.Graph representing the Subject .
598
+ Return an rdflib.Graph representing the Resource .
599
599
600
600
"""
601
601
graph = rdflib .Graph ()
602
- graph .bind ('bald' , 'http://binary-array-ld.net/latest /' )
602
+ graph .bind ('bald' , 'http://def. binary-array-ld.net/development /' )
603
603
graph .bind ('this' , self .baseuri + '/' )
604
604
for prefix_name in self .prefixes ():
605
605
@@ -623,11 +623,11 @@ def rdfgraph(self):
623
623
return graph
624
624
625
625
626
- class Reference (Subject ):
626
+ class Reference (Resource ):
627
627
_rdftype = 'bald__Reference'
628
628
629
629
630
- class Array (Subject ):
630
+ class Array (Resource ):
631
631
_rdftype = 'bald__Array'
632
632
633
633
@property
@@ -662,7 +662,7 @@ def graph_elems(self):
662
662
return instances , links
663
663
664
664
665
- class Container (Subject ):
665
+ class Container (Resource ):
666
666
_rdftype = 'bald__Container'
667
667
668
668
def graph_elems (self ):
@@ -786,7 +786,7 @@ def load_netcdf(afilepath, baseuri=None, alias_dict=None, cache=None):
786
786
787
787
# check that default set is handled, i.e. bald__ and rdf__
788
788
if 'bald__' not in prefixes :
789
- prefixes ['bald__' ] = "http://binary-array-ld.net/latest /"
789
+ prefixes ['bald__' ] = "http://def. binary-array-ld.net/development /"
790
790
791
791
if 'rdf__' not in prefixes :
792
792
prefixes ['rdf__' ] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
@@ -934,7 +934,7 @@ def load_netcdf(afilepath, baseuri=None, alias_dict=None, cache=None):
934
934
var = Array (baseuri , name , sattrs , prefixes = prefixes ,
935
935
aliases = aliases , alias_graph = aliasgraph )
936
936
else :
937
- var = Subject (baseuri , name , sattrs , prefixes = prefixes ,
937
+ var = Resource (baseuri , name , sattrs , prefixes = prefixes ,
938
938
aliases = aliases , alias_graph = aliasgraph )
939
939
root_container .attrs ['bald__contains' ].add (var )
940
940
@@ -944,7 +944,7 @@ def load_netcdf(afilepath, baseuri=None, alias_dict=None, cache=None):
944
944
reference_prefixes = dict ()
945
945
reference_graph = copy .copy (aliasgraph )
946
946
947
- response = cache ['http://binary-array-ld.net/latest ' ]
947
+ response = cache ['http://def. binary-array-ld.net/development ' ]
948
948
reference_graph .parse (data = response .text , format = 'xml' )
949
949
950
950
# # reference_graph.parse('http://binary-array-ld.net/latest?_format=ttl')
@@ -959,7 +959,7 @@ def load_netcdf(afilepath, baseuri=None, alias_dict=None, cache=None):
959
959
960
960
# refs_ = reference_graph.query(qstr)
961
961
962
- qstr = ('prefix bald: <http://binary-array-ld.net/latest /> '
962
+ qstr = ('prefix bald: <http://def. binary-array-ld.net/development /> '
963
963
'prefix skos: <http://www.w3.org/2004/02/skos/core#> '
964
964
'prefix owl: <http://www.w3.org/2002/07/owl#> '
965
965
'select ?s '
@@ -969,7 +969,7 @@ def load_netcdf(afilepath, baseuri=None, alias_dict=None, cache=None):
969
969
'filter(?rtype = owl:Class) '
970
970
'}' )
971
971
972
- qstr = ('prefix bald: <http://binary-array-ld.net/latest /> '
972
+ qstr = ('prefix bald: <http://def. binary-array-ld.net/development /> '
973
973
'prefix skos: <http://www.w3.org/2004/02/skos/core#> '
974
974
'prefix owl: <http://www.w3.org/2002/07/owl#> '
975
975
'select ?s '
@@ -982,15 +982,15 @@ def load_netcdf(afilepath, baseuri=None, alias_dict=None, cache=None):
982
982
983
983
non_ref_prefs = [str (ref [0 ]) for ref in list (refs )]
984
984
985
- qstr = ('prefix bald: <http://binary-array-ld.net/latest /> '
985
+ qstr = ('prefix bald: <http://def. binary-array-ld.net/development /> '
986
986
'prefix skos: <http://www.w3.org/2004/02/skos/core#> '
987
987
'prefix owl: <http://www.w3.org/2002/07/owl#> '
988
988
'select ?s '
989
989
'where { '
990
- ' {?s rdfs:range bald:Subject .} '
990
+ ' {?s rdfs:range bald:Resource .} '
991
991
' UNION '
992
992
' {?s rdfs:range ?as . '
993
- ' ?as rdfs:subClassOf bald:Subject .} '
993
+ ' ?as rdfs:subClassOf bald:Resource .} '
994
994
'}' )
995
995
996
996
refs = reference_graph .query (qstr )
@@ -1121,21 +1121,21 @@ def validate(root_container, sval=None, cache=None, uris_resolve=False):
1121
1121
if sval is None :
1122
1122
sval = bv .StoredValidation ()
1123
1123
1124
- root_val = bv .ContainerValidation (subject = root_container , httpcache = cache ,
1124
+ root_val = bv .ContainerValidation (resource = root_container , httpcache = cache ,
1125
1125
uris_resolve = uris_resolve )
1126
1126
sval .stored_exceptions += root_val .exceptions ()
1127
- for subject in root_container .attrs .get ('bald__contains' , set ()):
1128
- if isinstance (subject , Array ):
1129
- array_val = bv .ArrayValidation (subject , httpcache = cache ,
1127
+ for resource in root_container .attrs .get ('bald__contains' , set ()):
1128
+ if isinstance (resource , Array ):
1129
+ array_val = bv .ArrayValidation (resource , httpcache = cache ,
1130
1130
uris_resolve = uris_resolve )
1131
1131
sval .stored_exceptions += array_val .exceptions ()
1132
- elif isinstance (subject , Container ):
1133
- sval = validate (subject , sval = sval , cache = cache ,
1132
+ elif isinstance (resource , Container ):
1133
+ sval = validate (resource , sval = sval , cache = cache ,
1134
1134
uris_resolve = uris_resolve )
1135
- elif isinstance (subject , Subject ):
1136
- subject_val = bv .SubjectValidation ( subject , httpcache = cache ,
1135
+ elif isinstance (resource , Resource ):
1136
+ resource_val = bv .ResourceValidation ( resource , httpcache = cache ,
1137
1137
uris_resolve = uris_resolve )
1138
- sval .stored_exceptions += subject_val .exceptions ()
1138
+ sval .stored_exceptions += resource_val .exceptions ()
1139
1139
1140
1140
return sval
1141
1141
0 commit comments