<commit_before>package org.flymine.web.widget;

/*
 * Copyright (C) 2002-2009 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import org.intermine.objectstore.ObjectStore;
import org.intermine.pathquery.Constraints;
import org.intermine.pathquery.PathQuery;
import org.intermine.web.logic.bag.InterMineBag;
import org.intermine.web.logic.widget.WidgetURLQuery;

/**
 * Builds a query to get all the genes (in bag) associated with specified go term.
 * @author <NAME>
 */
public class TiffinURLQuery implements WidgetURLQuery
{

    private InterMineBag bag;
    private String key;
    private ObjectStore os;
    private static final String DATASET = "Tiffin";
    
    /**
     * @param key which bar the user clicked on
     * @param bag bag
     * @param os object store
     */
    public TiffinURLQuery(ObjectStore os, InterMineBag bag, String key) {
        this.bag = bag;
        this.key = key;
        this.os = os;
    }

    /**
     * {@inheritDoc}
     */
    public PathQuery generatePathQuery() {        
        // can't do this properly until #2184 if fixed
        PathQuery q = new PathQuery(os.getModel());
//        String viewStrings = "Gene.secondaryIdentifier";
//        String tiffin  = "Gene.upstreamIntergenicRegion.overlappingFeatures[TFBindingSite].motif.primaryIdentifier";
        String tiffin = "TFBindingSite.motif.primaryIdentifier";
//        q.setView(viewStrings);
        q.addView(tiffin);
//        q.addConstraint(bag.getType(),  Constraints.in(bag.getName()));
        q.addConstraint(tiffin, Constraints.eq
                        (key));
        q.addConstraint("TFBindingSite.dataSets.title", Constraints.eq(DATASET));
        q.setConstraintLogic("A and B");
        q.syncLogicExpression("and");
        q.setOrderBy(tiffin);
        return q;
    }
}
<commit_msg>check in broken widget so Matthew can see it.<commit_after>package org.flymine.web.widget;

/*
 * Copyright (C) 2002-2009 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import org.intermine.objectstore.ObjectStore;
import org.intermine.pathquery.Constraints;
import org.intermine.pathquery.PathQuery;
import org.intermine.web.logic.bag.InterMineBag;
import org.intermine.web.logic.widget.WidgetURLQuery;

/**
 * Builds a query to get all the genes (in bag) associated with specified go term.
 * @author <NAME>
 */
public class TiffinURLQuery implements WidgetURLQuery
{

    private InterMineBag bag;
    private String key;
    private ObjectStore os;
    private static final String DATASET = "Tiffin";
    
    /**
     * @param key which bar the user clicked on
     * @param bag bag
     * @param os object store
     */
    public TiffinURLQuery(ObjectStore os, InterMineBag bag, String key) {
        this.bag = bag;
        this.key = key;
        this.os = os;
    }

    /**
     * {@inheritDoc}
     */
    public PathQuery generatePathQuery() {
        PathQuery q = new PathQuery(os.getModel());
        String viewStrings = "Gene.secondaryIdentifier";
        String tiffin  = "Gene.upstreamIntergenicRegion.overlappingFeatures[TFBindingSite].motif.primaryIdentifier";
//        String tiffin = "TFBindingSite.motif.primaryIdentifier";
        q.setView(viewStrings);
//        q.addView(tiffin);
        q.addConstraint(bag.getType(),  Constraints.in(bag.getName()));
        q.addConstraint(tiffin, Constraints.eq (key));
        q.addConstraint("TFBindingSite.dataSets.title", Constraints.eq(DATASET));
        q.setConstraintLogic("A and B and C");
        q.syncLogicExpression("and");
        q.setOrderBy(tiffin);
        return q;
    }
}

{'fraction_non_alphanumeric': 0.10580034851879512, 'fraction_numerical': 0.004978839930296241, 'mean_word_length': 2.927663734115347, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2495040', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1187, 'n_words': 314}