@@ -49,12 +49,26 @@ function process_dir(){
49
49
$ this ->setCheckPoint ('dataset ' );
50
50
51
51
$ ldir = parent ::getParameterValue ('indir ' );
52
+ $ odir = parent ::getParameterValue ('outdir ' );
53
+
54
+ $ graph_uri = parent ::getGraphURI ();
55
+
56
+ $ dataset_description = '' ;
57
+
58
+ $ gz = (strstr (parent ::getParameterValue ('output_format ' ),".gz " ) === FALSE )?false :true ;
59
+
60
+ //set graph URI to dataset graph
61
+ if (parent ::getParameterValue ('dataset_graph ' ) == true ) parent ::setGraphURI (parent ::getDatasetURI ());
52
62
53
63
//make sure directories end with slash
54
64
if (substr ($ ldir , -1 ) !== "/ " ){
55
65
$ ldir = $ ldir ."/ " ;
56
66
}
57
67
68
+ if (substr ($ odir , -1 ) !== "/ " ){
69
+ $ odir = $ odir ."/ " ;
70
+ }
71
+
58
72
if ($ lhandle = opendir ($ ldir )) {
59
73
while (($ lfilename = readdir ($ lhandle )) !== FALSE ) {
60
74
if ($ lfilename != ". " && $ lfilename != ".. " ) {
@@ -69,20 +83,18 @@ function process_dir(){
69
83
closedir ($ lhandle );
70
84
}
71
85
72
-
73
86
$ source_file = (new DataResource ($ this ))
74
87
->setURI ("http://www.ncbi.nlm.nih.gov/pubmed " )
75
88
->setTitle ("NCBI PubMed " )
76
89
->setRetrievedDate ( date ("Y-m-d\TG:i:s\Z " , filemtime ($ ldir )))
77
90
->setFormat ("text/xml " )
78
- ->setFormat ("application/zip " )
79
91
->setPublisher ("http://ncbi.nlm.nih.gov/ " )
80
92
->setHomepage ("http://www.ncbi.nlm.nih.gov/pubmed/ " )
81
93
->setRights ("use-share-modify " )
82
94
->setLicense ("http://www.nlm.nih.gov/databases/license/license.html " )
83
95
->setDataset ("http://identifiers.org/pubmed/ " );
84
96
85
- $ prefix = $ this -> getPcbPrefix ();
97
+ $ prefix = parent :: getPrefix ();
86
98
$ bVersion = parent ::getParameterValue ('bio2rdf_release ' );
87
99
$ date = date ("Y-m-d\TG:i:s\Z " );
88
100
$ output_file = (new DataResource ($ this ))
@@ -105,8 +117,11 @@ function process_dir(){
105
117
106
118
$ dataset_description .= $ source_file ->toRDF ().$ output_file ->toRDF ();
107
119
120
+ //set graph URI back to default
121
+ parent ::setGraphURI ($ graph_uri );
122
+
108
123
// write the dataset description
109
- $ this ->setWriteFile ($ this -> getParameterValue ( ' outdir ' ). " /bioassay/ " .$ this ->getBio2RDFReleaseFile ());
124
+ $ this ->setWriteFile ($ odir .$ this ->getBio2RDFReleaseFile ());
110
125
$ this ->getWriteFile ()->write ($ dataset_description );
111
126
$ this ->getWriteFile ()->close ();
112
127
}//process)dir
0 commit comments