@@ -153,16 +153,16 @@ def dataSource(rowobj):
153
153
pref = prefs [list (prefs .keys ())[colnum ]]
154
154
val = vals [list (vals .keys ())[colnum ]]
155
155
156
- datasource_dict = {'GenBank' :{'Replace Example' :'https://www.ncbi.nlm.nih.gov/nuccore/{REPLACE_HERE}' , 'Literal Part' :'TRUE' , 'Namespace' :'https://www.ncbi.nlm.nih.gov/nuccore' },
157
- 'PubMed' :{'Replace Example' :'https://pubmed.ncbi.nlm.nih.gov/{REPLACE_HERE}/' , 'Literal Part' :'FALSE' , 'Namespace' :'' },
158
- 'iGEM registry' :{'Replace Example' :'http://parts.igem.org/Part:{REPLACE_HERE}' , 'Literal Part' :'TRUE' , 'Namespace' :'http://parts.igem.org' },
159
- 'AddGene' :{'Replace Example' :'https://www.addgene.org/{REPLACE_HERE}/' , 'Literal Part' :'FALSE' , 'Namespace' :'' },
160
- 'Seva plasmids' :{'Replace Example' :'http://www.sevahub.es/public/Canonical/{REPLACE_HERE}/1' , 'Literal Part' :'TRUE' , 'Namespace' :'' },
161
- 'Tax_id' :{'Replace Example' :'https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id={REPLACE_HERE}' , 'Literal Part' :'FALSE' , 'Namespace' :'' },
162
- 'SynBioHub' :{'Replace Example' :'{REPLACE_HERE}' , 'Literal Part' :'TRUE' , 'Namespace' :'' },
163
- 'Local Sequence File' :{'Replace Example' :'' , 'Literal Part' :'FALSE' , 'Namespace' :'' },
164
- 'URL for GenBank file' :{'Replace Example' :'{REPLACE_HERE}' , 'Literal Part' :'TRUE' , 'Namespace' :'' },
165
- 'URL for FASTA file' :{'Replace Example' :'{REPLACE_HERE}' , 'Literal Part' :'TRUE' , 'Namespace' :'' }
156
+ datasource_dict = {'GenBank' :{'Replace Example' :'https://www.ncbi.nlm.nih.gov/nuccore/{REPLACE_HERE}' , 'Literal Part' :'TRUE' , 'Namespace' :'https://www.ncbi.nlm.nih.gov/nuccore' , 'Prefix' : 'gb' },
157
+ 'PubMed' :{'Replace Example' :'https://pubmed.ncbi.nlm.nih.gov/{REPLACE_HERE}/' , 'Literal Part' :'FALSE' , 'Namespace' :'' , 'Prefix' : '' },
158
+ 'iGEM registry' :{'Replace Example' :'http://parts.igem.org/Part:{REPLACE_HERE}' , 'Literal Part' :'TRUE' , 'Namespace' :'http://parts.igem.org' , 'Prefix' : 'igem' },
159
+ 'AddGene' :{'Replace Example' :'https://www.addgene.org/{REPLACE_HERE}/' , 'Literal Part' :'FALSE' , 'Namespace' :'' , 'Prefix' : '' },
160
+ 'Seva plasmids' :{'Replace Example' :'http://www.sevahub.es/public/Canonical/{REPLACE_HERE}/1' , 'Literal Part' :'TRUE' , 'Namespace' :'' , 'Prefix' : '' },
161
+ 'Tax_id' :{'Replace Example' :'https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id={REPLACE_HERE}' , 'Literal Part' :'FALSE' , 'Namespace' :'' , 'Prefix' : '' },
162
+ 'SynBioHub' :{'Replace Example' :'{REPLACE_HERE}' , 'Literal Part' :'TRUE' , 'Namespace' :'' , 'Prefix' : '' },
163
+ 'Local Sequence File' :{'Replace Example' :'' , 'Literal Part' :'FALSE' , 'Namespace' :'' , 'Prefix' : '' },
164
+ 'URL for GenBank file' :{'Replace Example' :'{REPLACE_HERE}' , 'Literal Part' :'TRUE' , 'Namespace' :'' , 'Prefix' : '' },
165
+ 'URL for FASTA file' :{'Replace Example' :'{REPLACE_HERE}' , 'Literal Part' :'TRUE' , 'Namespace' :'' , 'Prefix' : '' }
166
166
}
167
167
168
168
literal = datasource_dict [pref ]['Literal Part' ]
@@ -173,6 +173,9 @@ def dataSource(rowobj):
173
173
else :
174
174
ns = datasource_dict [pref ]['Namespace' ]
175
175
if len (ns ) > 0 :
176
+ if datasource_dict [pref ]['Prefix' ] not in rowobj .doc .pref_terms :
177
+ rowobj .doc .bind (datasource_dict [pref ]['Prefix' ], ns )
178
+ rowobj .doc .pref_terms .append (datasource_dict [pref ]['Prefix' ])
176
179
print (rowobj .obj .display_id , ns , rowobj .doc_pref_terms )
177
180
rowobj .doc .change_object_namespace ([rowobj .obj ], ns )
178
181
0 commit comments