vsoch / freegenes

FreeGenes BioNode with Django
https://vsoch.github.io/freegenes/
Mozilla Public License 2.0
2 stars 4 forks source link

Naming Conventions #114

Open vsoch opened 4 years ago

vsoch commented 4 years ago

As discussed in https://github.com/vsoch/freegenes/issues/113, since there are no naming conventions for various objects (aside from tags) we can't easily parse a search query to do something like remove invalid / uninteresting characters, as we might actually lose a result. This issue is opened for discussion and future work around developing a standard. What will need to be done is:

Once this is done, the search query can be further parsed without worrying about losing content.

marc4-stanford commented 4 years ago

What is considered white space/word delmiters? Are a space, comma, underscore, dash, period, end of line, etc all treated word terminators?

vsoch commented 4 years ago

This is largely up to the FreeGenes team to decide - with regular expressions we can parse the search query input however is desired. Currently there is no parsing.

vsoch commented 4 years ago

You can read about queries here we have a custom query based on the model type that looks over a subset of fields using icontains. For example:

def distributions_query(q):
    '''specific search for distributions
    '''
    return Distribution.objects.filter(
                    Q(name__icontains=q) |
                    Q(description__icontains=q)).distinct()

where q is whatever is provided by the user, and icontains ensures that casing doesn't matter. See here for the functions and full logic for each model.