@@ -89,8 +89,9 @@ function Run()
89
89
foreach ($ ontologies AS $ i => $ o ) {
90
90
$ label = (string ) $ o ->name ;
91
91
$ abbv = (string ) $ o ->acronym ;
92
-
93
- if (array_search ($ abbv ,$ exclude_list ) !== FALSE ) continue ;
92
+ if (array_search ($ abbv ,$ exclude_list ) !== FALSE ) {
93
+ continue ;
94
+ }
94
95
if ($ include_list [0 ] != 'all ' ) {
95
96
// ignore if we don't find it in the include list OR we do find it in the exclude list
96
97
if ( (array_search ($ abbv ,$ include_list ) === FALSE )
@@ -106,9 +107,7 @@ function Run()
106
107
if (!isset ($ ls ['hasOntologyLanguage ' ])) {echo 'insufficient metadata ' .PHP_EOL ;continue ;}
107
108
108
109
$ format = strtolower ($ ls ['hasOntologyLanguage ' ]);
109
- /***********/
110
110
if ($ format != 'owl ' and $ format != 'obo ' ) continue ;
111
-
112
111
echo "Processing ( $ i/ $ total) $ abbv ... " ;
113
112
114
113
$ version = $ ls ['version ' ];
@@ -117,7 +116,6 @@ function Run()
117
116
118
117
$ rfile = $ ls ['ontology ' ]['links ' ]['download ' ];
119
118
120
-
121
119
$ lfile = $ abbv .". " .$ format .".gz " ;
122
120
if (parent ::getParameterValue ('download ' ) == 'true ' ) {
123
121
echo "downloading ... " ;
@@ -138,6 +136,7 @@ function Run()
138
136
if (isset ($ m [1 ])) {
139
137
$ filename = $ m [1 ];
140
138
if (strstr ($ filename ,".zip " )) continue ;
139
+
141
140
} else {echo "error: no filename " .PHP_EOL ;continue ;}
142
141
143
142
$ body = substr ($ ret , $ header_size );
@@ -148,6 +147,7 @@ function Run()
148
147
149
148
$ lz = "compress.zlib:// " .$ idir .$ lfile ;
150
149
file_put_contents ($ lz ,$ body );
150
+
151
151
echo "done " .PHP_EOL ;
152
152
}
153
153
@@ -160,6 +160,11 @@ function Run()
160
160
// process
161
161
echo "converting ... " ;
162
162
set_time_limit (0 );
163
+ // let's double check the format
164
+ $ fp = gzopen ($ idir .$ lfile ,"r " );
165
+ $ l = gzgets ($ fp );
166
+ if (strstr ($ l ,"xml " )) $ format = "owl " ;
167
+ gzclose ($ fp );
163
168
if ($ format == 'obo ' ) {
164
169
$ this ->OBO2RDF ($ abbv );
165
170
} else if ($ format == 'owl ' ) {
@@ -366,6 +371,7 @@ function OBO2RDF($abbv)
366
371
if ($ abbv == "doid " ) $ abbv = "do " ;
367
372
$ minimal = (parent ::getParameterValue ('detail ' ) == 'min ' )?true :false ;
368
373
$ minimalp = (parent ::getParameterValue ('detail ' ) == 'min+ ' )?true :false ;
374
+ $ version = parent ::getParameterValue ("bio2rdf_release " );
369
375
370
376
$ tid = '' ;
371
377
$ first = true ;
@@ -374,7 +380,7 @@ function OBO2RDF($abbv)
374
380
$ min = $ buf = '' ;
375
381
$ ouri = "http://bio2rdf.org/lsr: " .$ abbv ;
376
382
377
- $ dataset_uri = $ abbv ."_resource:bio2rdf.dataset. $ abbv.R3 " ;
383
+ $ dataset_uri = $ abbv ."_resource:bio2rdf.dataset. $ abbv.R " . $ version ;
378
384
parent ::setGraphURI ($ dataset_uri );
379
385
$ buf = parent ::triplify ($ ouri ,"rdf:type " ,"owl:Ontology " );
380
386
$ graph_uri = '< ' .parent ::getRegistry ()->getFQURI (parent ::getGraphURI ()).'> ' ;
0 commit comments