org.biomart.martservice.query.Query类的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(163)

本文整理了Java中org.biomart.martservice.query.Query类的一些代码示例,展示了Query类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query类的具体详情如下:
包路径:org.biomart.martservice.query.Query
类名称:Query

Query介绍

暂无

代码示例

代码示例来源:origin: net.sf.taverna.t2.activities/biomart-activity

  1. private void buildOutputPorts(List<Edit<?>> editList) {
  2. Map<String, OutputPort> newOutputMap = new HashMap<String, OutputPort>();
  3. Query query = biomartQuery.getQuery();
  4. List<Attribute> attributes = query.getAttributes();
  5. String formatter = query.getFormatter();
  6. if (formatter == null) {

代码示例来源:origin: uk.org.mygrid.taverna.processors/taverna-biomart-processor

  1. Query query = new Query(biomartQuery.getQuery());
  2. List<Filter> filters = query.getFilters();
  3. for (Filter filter : filters) {
  4. String name = filter.getQualifiedName();
  5. Object[] resultList = biomartQuery.getMartService().executeQuery(
  6. query);
  7. if (biomartQuery.getQuery().getFormatter() == null) {
  8. Dataset dataset = biomartQuery.getQuery().getDatasets().get(0);
  9. results.put(dataset.getName(), new DataThing(resultList[0]));

代码示例来源:origin: net.sf.taverna.t2.ui-activities/biomart-activity-ui

  1. @Override
  2. protected String getRawTableRowsHtml() {
  3. MartQuery q = MartServiceXMLHandler.elementToMartQuery(getConfigBean(), null);
  4. String html="<tr><td>URL</td><td>"+q.getMartService().getLocation()+"</td></tr>";
  5. html+="<tr><td>Location</td><td>"+q.getMartDataset().getMartURLLocation().getDisplayName() + "</td></tr>";
  6. boolean firstFilter=true;
  7. for (Filter filter : q.getQuery().getFilters()) {
  8. html+=firstFilter ? "<tr><td>Filter</td><td>" : "<tr><td></td></td>";
  9. firstFilter=false;
  10. html+=filter.getName()+"</td></tr>";
  11. }
  12. boolean firstAttribute=true;
  13. for (Attribute attribute : q.getQuery().getAttributes()) {
  14. html+=firstAttribute ? "<tr><td>Attribute</td><td>" : "<tr><td></td><td>";
  15. firstAttribute=false;
  16. html+=attribute.getName()+"</td></tr>";
  17. }
  18. html+="<tr><td>Dataset</td><td>"+q.getMartDataset().getDisplayName()+"</td></tr>";
  19. return html;
  20. }

代码示例来源:origin: net.sf.taverna.t2.activities/biomart-activity

  1. private void buildInputPorts(List<Edit<?>> editList) {
  2. Map<String, ActivityInputPort> newInputMap = new HashMap<String, ActivityInputPort>();
  3. List<Filter> filters = biomartQuery.getQuery().getFilters();
  4. // Create new input ports corresponding to filters
  5. for (Filter filter : filters) {
  6. String name = filter.getQualifiedName() + "_filter";
  7. if (inputMap.containsKey(name)) {
  8. newInputMap.put(name, inputMap.remove(name));
  9. } else {
  10. ActivityInputPort inputPort = null;
  11. if (filter.isList()) {
  12. inputPort = edits.createActivityInputPort(name, 1, true,
  13. new ArrayList<Class<? extends ExternalReferenceSPI>>(),
  14. String.class);
  15. } else {
  16. inputPort = edits.createActivityInputPort(name, 0, true,
  17. new ArrayList<Class<? extends ExternalReferenceSPI>>(),
  18. String.class);
  19. }
  20. newInputMap.put(name, inputPort);
  21. editList.add(edits.getAddActivityInputPortEdit(this, inputPort));
  22. editList.add(createAddMimeTypeAnnotationEdit(inputPort, "text/plain"));
  23. }
  24. }
  25. //remove any ports still left in the map
  26. for (ActivityInputPort inputPort : inputMap.values()) {
  27. editList.add(edits.getRemoveActivityInputPortEdit(this, inputPort));
  28. }
  29. inputMap = newInputMap;
  30. }

代码示例来源:origin: uk.org.mygrid.taverna.processors/taverna-biomart-processor

  1. query.getQuery().addQueryListener(queryListener);

代码示例来源:origin: net.sf.taverna.t2.activities/biomart-activity-ui

  1. @Override
  2. protected String getRawTableRowsHtml() {
  3. MartQuery q = MartServiceXMLHandler.elementToMartQuery(getConfigBean(), null);
  4. String html="<tr><td>URL</td><td>"+q.getMartService().getLocation()+"</td></tr>";
  5. html+="<tr><td>Location</td><td>"+q.getMartDataset().getMartURLLocation().getDisplayName() + "</td></tr>";
  6. boolean firstFilter=true;
  7. for (Filter filter : q.getQuery().getFilters()) {
  8. html+=firstFilter ? "<tr><td>Filter</td><td>" : "<tr><td></td></td>";
  9. firstFilter=false;
  10. html+=filter.getName()+"</td></tr>";
  11. }
  12. boolean firstAttribute=true;
  13. for (Attribute attribute : q.getQuery().getAttributes()) {
  14. html+=firstAttribute ? "<tr><td>Attribute</td><td>" : "<tr><td></td><td>";
  15. firstAttribute=false;
  16. html+=attribute.getName()+"</td></tr>";
  17. }
  18. html+="<tr><td>Dataset</td><td>"+q.getMartDataset().getDisplayName()+"</td></tr>";
  19. return html;
  20. }

代码示例来源:origin: net.sf.taverna.t2/biomart-activity

  1. private void buildInputPorts() {
  2. List<Filter> filters = biomartQuery.getQuery().getFilters();
  3. // Create new input ports corresponding to filters
  4. for (Filter filter : filters) {
  5. String name = filter.getQualifiedName() + "_filter";
  6. if (filter.isList()) {
  7. addInput(name, 1, true,
  8. new ArrayList<Class<? extends ReferenceScheme<?>>>(),
  9. String.class);
  10. } else {
  11. addInput(name, 0, true,
  12. new ArrayList<Class<? extends ReferenceScheme<?>>>(),
  13. String.class);
  14. }
  15. }
  16. }

代码示例来源:origin: net.sf.taverna.t2/biomart-activity

  1. Query query = new Query(biomartQuery.getQuery());
  2. List<Filter> filters = query.getFilters();
  3. for (Filter filter : filters) {
  4. String name = filter.getQualifiedName();
  5. if (biomartQuery.getQuery().getFormatter() == null) {
  6. if (STREAM_RESULTS) {
  7. final List<Attribute> attributes = biomartQuery
  8. .executeQuery(query);
  9. assert resultList.length == 1;
  10. Dataset dataset = biomartQuery.getQuery().getDatasets()
  11. .get(0);
  12. String outputName = dataset.getName();

代码示例来源:origin: net.sf.taverna.t2/biomart-activity

  1. private void buildOutputPorts() {
  2. Query query = biomartQuery.getQuery();
  3. List<Attribute> attributes = query.getAttributes();
  4. String formatter = query.getFormatter();
  5. if (formatter == null) {
  6. // Create new output ports corresponding to attributes
  7. for (Attribute attribute : attributes) {
  8. String name = attribute.getQualifiedName();
  9. if (attribute.getAttributes() != null) {
  10. addOutput(name, 2, STREAM_RESULTS?1:2);
  11. } else {
  12. addOutput(name, 1, STREAM_RESULTS?0:1);
  13. }
  14. }
  15. } else if (attributes.size() > 0) {
  16. // create one port using the dataset name
  17. Attribute attribute = attributes.get(0);
  18. String name = attribute.getContainingDataset().getName();
  19. addOutput(name, 0, 0);
  20. }
  21. }

代码示例来源:origin: uk.org.mygrid.taverna.processors/taverna-biomart-processor

  1. private void buildInputPortsFromQuery() throws PortCreationException,
  2. DuplicatePortNameException {
  3. List filters = query.getQuery().getFilters();
  4. Set<String> filterNames = new HashSet<String>();

代码示例来源:origin: net.sf.taverna.t2.activities/biomart-activity

  1. Query query = new Query(biomartQuery.getQuery());
  2. List<Filter> filters = query.getFilters();
  3. for (Filter filter : filters) {
  4. String name = filter.getQualifiedName();
  5. if (biomartQuery.getQuery().getFormatter() == null) {
  6. if (STREAM_RESULTS) {
  7. final List<Attribute> attributes = biomartQuery
  8. .executeQuery(query);
  9. assert resultList.length == 1;
  10. Dataset dataset = biomartQuery.getQuery().getDatasets()
  11. .get(0);
  12. String outputName = dataset.getName();

代码示例来源:origin: uk.org.mygrid.taverna.processors/taverna-biomart-processor

  1. private void buildOutputPortsFromQuery() throws PortCreationException,
  2. DuplicatePortNameException {
  3. List<Attribute> attributes = query.getQuery().getAttributes();
  4. Set<String> attributeNames = new HashSet<String>();
  5. String formatter = query.getQuery().getFormatter();
  6. if (formatter == null) {

相关文章