I assume that the point of this query is to search for an association with either a subject or object that matches with id, but in fact it's only matching subjects.
@ns.route('/<id>/associations/')
class GenericAssociations(Resource):
@api.expect(core_parser)
@api.marshal_with(association_results)
def get(self, id):
"""
Returns associations for an entity regardless of the type
"""
return search_associations(subject=id, **core_parser.parse_args())
Moreover, this above method appears to be doing more or less the same thing as the following:
@ns.route('/from/<subject>')
@api.doc(params={'subject': 'Return associations emanating from this node, e.g. specifying NCBIGene:84570 will return gene-phenotype, gene-function etc for this gene'})
class AssociationsFrom(Resource):
@api.expect(parser)
@api.marshal_list_with(association_results)
def get(self, subject):
"""
Returns list of matching associations starting from a given subject (source)
"""
args = parser.parse_args()
return search_associations(subject=subject, **args)
It looks like the solr query being sent for /<id>/associations/ is:
It looks like 'fq' ought to be mapped to [''object_closure:"NCBIGene:84570"' OR subject_closure:"NCBIGene:84570"'] so as to match both subject and object ID's.
I assume that the point of this query is to search for an association with either a subject or object that matches with
id
, but in fact it's only matching subjects.https://github.com/biolink/biolink-api/blob/master/biolink/api/bio/endpoints/bioentity.py:
Moreover, this above method appears to be doing more or less the same thing as the following:
https://github.com/biolink/biolink-api/blob/master/biolink/api/link/endpoints/associations_from.py
It looks like the solr query being sent for
/<id>/associations/
is:{'facet.mincount': 1, 'start': 1, 'fq': ['subject_closure:"NCBIGene:84570"'], 'q': '*:*', 'facet': 'on', 'facet.field': ['subject_taxon_label', 'object_closure'], 'facet.limit': 25, 'rows': 1, 'fl': 'id,is_defined_by,source,subject,subject_label,subject_taxon,subject_taxon_label,relation,relation_label,object,object_label,object_taxon,object_taxon_label,evidence_object,evidence_graph'}
It looks like
'fq'
ought to be mapped to[''object_closure:"NCBIGene:84570"' OR subject_closure:"NCBIGene:84570"']
so as to match both subject and object ID's.