Skip to content

Commit

Permalink
use subject category for planteome
Browse files Browse the repository at this point in the history
  • Loading branch information
cmungall committed Jun 10, 2017
1 parent 53b01df commit 2b73569
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ontobio/golr/golr_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ def goassoc_fieldmap():
return {
M.SUBJECT: 'bioentity',
M.SUBJECT_CLOSURE: 'bioentity',
##M.SUBJECT_CATEGORY: 'type',
## In the GO AmiGO instance, the type field is not correctly populated
## See above in the code for hack that restores this for planteome instance
## M.SUBJECT_CATEGORY: 'type',
M.SUBJECT_CATEGORY: None,
M.SUBJECT_LABEL: 'bioentity_label',
M.SUBJECT_TAXON: 'taxon',
Expand Down Expand Up @@ -235,6 +237,7 @@ def _use_amigo_schema(self, object_category):
return True
return False


class GolrSearchQuery(GolrAbstractQuery):
"""
Queries over a search document
Expand Down Expand Up @@ -568,6 +571,12 @@ def solr_params(self):
#go_golr_url = "http://golr.berkeleybop.org/solr/"
#self.solr = pysolr.Solr(go_golr_url, timeout=5)
self.field_mapping=goassoc_fieldmap()

# awkward hack: we want to avoid typing on the amigo golr gene field,
# UNLESS this is a planteome golr
if "planteome" in self.get_config().amigo_solr_assocs.url:
self.field_mapping[M.SUBJECT_CATEGORY] = 'type'

fq['document_category'] = 'annotation'
if subject is not None:
subject = self.make_gostyle_identifier(subject)
Expand Down

0 comments on commit 2b73569

Please sign in to comment.