@@ -74,20 +74,50 @@ function Run()
74
74
parent ::writeRDFBufferToWriteFile ();
75
75
parent ::getWriteFile ()->close ();
76
76
echo "Done! " .PHP_EOL ;
77
+
78
+
79
+
80
+ parent ::setGraphURI (parent ::getDatasetURI ());
81
+
82
+ // dataset description
83
+ $ source_version = parent ::getDatasetVersion ();
84
+ $ source_file = (new DataResource ($ this ))
85
+ ->setURI ($ rfile )
86
+ ->setTitle ("InterPro v $ source_version " )
87
+ ->setRetrievedDate ( date ("Y-m-d\TG:i:s\Z " , filemtime ($ lfile )))
88
+ ->setFormat ("application/xml " )
89
+ ->setFormat ("application/g-zip " )
90
+ ->setPublisher ("http://www.ebi.ac.uk/ " )
91
+ ->setHomepage ("http://www.ebi.ac.uk/interpro/ " )
92
+ ->setRights ("InterPro - Integrated Resource Of Protein Domains And Functional Sites. Copyright (C) 2001 The InterPro Consortium " )
93
+ ->setLicense ("http://www.ebi.ac.uk/interpro/faqs.html " )
94
+ ->setDataset ("http://identifiers.org/interpro/ " );
77
95
78
- // generate the release file
79
- $ desc = parent ::getBio2RDFDatasetDescription (
80
- parent ::getPrefix (),
81
- "https://github.com/bio2rdf/bio2rdf-scripts/blob/master/interpro/intepro.php " ,
82
- parent ::getBio2RDFDownloadURL (parent ::getPrefix ()).$ outfile ,
83
- "http://www.ebi.ac.uk/interpro/ " ,
84
- array ("use-share-modify " ),
85
- null , // license
86
- parent ::getParameterValue ('download_url ' ),
87
- $ this ->version
88
- );
89
- parent ::setWriteFile ($ odir .parent ::getBio2RDFReleaseFile (parent ::getPrefix ()));
90
- parent ::getWriteFile ()->write ($ desc );
96
+ $ prefix = parent ::getPrefix ();
97
+ $ bVersion = parent ::getParameterValue ('bio2rdf_release ' );
98
+ $ date = date ("Y-m-d\TG:i:s\Z " );
99
+ $ output_file = (new DataResource ($ this ))
100
+ ->setURI ("http://download.bio2df.org/release/ $ bVersion/ $ prefix/ $ outfile " )
101
+ ->setTitle ("Bio2RDF v $ bVersion RDF version of $ prefix v $ source_version " )
102
+ ->setSource ($ source_file ->getURI ())
103
+ ->setCreator ("https://github.com/bio2rdf/bio2rdf-scripts/blob/master/interpro/interpro.php " )
104
+ ->setCreateDate ($ date )
105
+ ->setHomepage ("http://download.bio2rdf.org/release/ $ bVersion/ $ prefix/ $ prefix.html " )
106
+ ->setPublisher ("http://bio2rdf.org " )
107
+ ->setRights ("use-share-modify " )
108
+ ->setRights ("by-attribution " )
109
+ ->setRights ("restricted-by-source-license " )
110
+ ->setLicense ("http://creativecommons.org/licenses/by/3.0/ " )
111
+ ->setDataset (parent ::getDatasetURI ());
112
+
113
+ if ($ gz ) $ output_file ->setFormat ("application/gzip " );
114
+ if (strstr (parent ::getParameterValue ('output_format ' ),"nt " )) $ output_file ->setFormat ("application/n-triples " );
115
+ else $ output_file ->setFormat ("application/n-quads " );
116
+
117
+ $ dataset_description = $ source_file ->toRDF ().$ output_file ->toRDF ();
118
+
119
+ parent ::setWriteFile ($ odir .parent ::getBio2RDFReleaseFile ());
120
+ parent ::getWriteFile ()->write ($ dataset_description );
91
121
parent ::getWriteFile ()->close ();
92
122
93
123
return true ;
@@ -105,11 +135,17 @@ function Parse($xml)
105
135
parent ::setDatasetVersion ($ o ->attributes ()->version );
106
136
}
107
137
}
138
+ // get a potential id list
139
+ $ id_list = explode (", " ,parent ::getParameterValue ("id_list " ));
140
+
108
141
// now interate over the entries
109
142
foreach ($ xml ->interpro AS $ o ) {
110
143
parent ::writeRDFBufferToWriteFile ();
111
144
112
145
$ interpro_id = $ o ->attributes ()->id ;
146
+ if (isset ($ id_list ) && !in_array ($ interpro_id ,$ id_list )) {
147
+ continue ;
148
+ }
113
149
echo "Processing $ interpro_id " .PHP_EOL ;
114
150
115
151
$ name = $ o ->name ;
0 commit comments