Example Solr Queries: Difference between revisions

From GO Wiki
Jump to navigation Jump to search
No edit summary
Line 23: Line 23:


URL
URL
  http://skewer.lbl.gov:8080/solr/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=10&indent=on&q=*:*&start=0
  http://golr.berkeleybop.org/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=10&indent=on&q=*:*&start=0


GOOSE
GOOSE
Line 31: Line 31:


URL
URL
  http://skewer.lbl.gov:8080/solr/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=20&indent=on&q=*:*&start=0
  http://golr.berkeleybop.org/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=20&indent=on&q=*:*&start=0


GOOSE
GOOSE
Line 40: Line 40:


URL
URL
  http://skewer.lbl.gov:8080/solr/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=50&indent=on&q=*:*&fq=document_category:%22bioentity%22&start=50
  http://golr.berkeleybop.org/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=50&indent=on&q=*:*&fq=document_category:%22bioentity%22&start=50


GOOSE
GOOSE
Line 51: Line 51:


URL
URL
  http://skewer.lbl.gov:8080/solr/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=1&q=id:%22GO:0005634%22&fq=document_category:%22ontology_class%22
  http://golr.berkeleybop.org/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=1&q=id:%22GO:0005634%22&fq=document_category:%22ontology_class%22


GOOSE
GOOSE
Line 60: Line 60:


URL
URL
  http://skewer.lbl.gov:8080/solr/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=1&q=label:%22nucleus%22&fq=document_category:%22ontology_class%22
  http://golr.berkeleybop.org/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=1&q=label:%22nucleus%22&fq=document_category:%22ontology_class%22


GOOSE
GOOSE
Line 70: Line 70:


URL
URL
  http://skewer.lbl.gov:8080/solr/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=50&q=document_category:%22ontology_class%22&fq=is_obsolete:%22true%22
  http://golr.berkeleybop.org/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=50&q=document_category:%22ontology_class%22&fq=is_obsolete:%22true%22


GOOSE
GOOSE
Line 80: Line 80:


URL
URL
  http://skewer.lbl.gov:8080/solr/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=0&facet=true&facet.field=type&q=document_category:%22annotation%22
  http://golr.berkeleybop.org/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=0&facet=true&facet.field=type&q=document_category:%22annotation%22


==IEA Annotations from TAIR (first 10)==
==IEA Annotations from TAIR (first 10)==


URL
URL
  http://skewer.lbl.gov:8080/solr/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=10&indent=on&q=*:*&fq=document_category:annotation&start=0
  http://golr.berkeleybop.org/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=10&indent=on&q=*:*&fq=document_category:annotation&start=0


GOOSE
GOOSE
Line 96: Line 96:


URL
URL
  http://skewer.lbl.gov:8080/solr/select?qt=standard&indent=on&wt=json&version=2.2&rows=10&start=0&fl=*%2Cscore&facet=true&facet.field=document_category&facet.field=type&facet.field=evidence_type&facet.field=evidence_closure&facet.field=source&facet.field=taxon&facet.field=isa_partof_label_closure&facet.field=annotation_extension_class_label_closure&fq=&q=*:*&fq=document_category:"annotation"&fq=isa_partof_label_closure:"macromolecule biosynthetic process"&fq=isa_partof_label_closure:"cellular response to stress"
  http://golr.berkeleybop.org/select?qt=standard&indent=on&wt=json&version=2.2&rows=10&start=0&fl=*%2Cscore&facet=true&facet.field=document_category&facet.field=type&facet.field=evidence_type&facet.field=evidence_closure&facet.field=source&facet.field=taxon&facet.field=isa_partof_label_closure&facet.field=annotation_extension_class_label_closure&fq=&q=*:*&fq=document_category:"annotation"&fq=isa_partof_label_closure:"macromolecule biosynthetic process"&fq=isa_partof_label_closure:"cellular response to stress"


GOOSE (facets generated, but not shown)
GOOSE (facets generated, but not shown)

Revision as of 19:07, 19 April 2012

Overview

This page has examples of various kinds of queries possible on the GO Solr document store (GOlr), Preliminary schema information can be found in the repo.

Preliminary information about the schema can be found on SF.net.

Usage

The current testing ground for GOlr is:

http://golr.berkeleybop.org/

This is a naked Solr server; you can access it with any http client, including a web browser. In addition, there is an experimental version of GOOSE that can talk to Solr (select a Solr mirror from the list):

http://amigo2.berkeleybop.org/cgi-bin/amigo2/goose

This method is currently a little slower, but may make learning a little bit easier.

Example Queries

All documents (first 10)

URL

http://golr.berkeleybop.org/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=10&indent=on&q=*:*&start=0

GOOSE

q=*:*

All documents (first 20)

URL

http://golr.berkeleybop.org/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=20&indent=on&q=*:*&start=0

GOOSE

q=*:*
rows=20

All bioentities (50-100)

URL

http://golr.berkeleybop.org/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=50&indent=on&q=*:*&fq=document_category:%22bioentity%22&start=50

GOOSE

q=*:*
fq=document_category:"bioentity"
rows=50
start=50

Find term information for GO ID, for example "GO:0005634"

URL

http://golr.berkeleybop.org/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=1&q=id:%22GO:0005634%22&fq=document_category:%22ontology_class%22

GOOSE

q=id:"GO:0005634"
fq=document_category:"ontology_class"

Find term by (preferred) name, for example "nucleus"

URL

http://golr.berkeleybop.org/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=1&q=label:%22nucleus%22&fq=document_category:%22ontology_class%22

GOOSE

q=label:"nucleus"
fq=document_category:"ontology_class"
rows=1 

To find (first 50) obsolete terms

URL

http://golr.berkeleybop.org/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=50&q=document_category:%22ontology_class%22&fq=is_obsolete:%22true%22

GOOSE

q=document_category:"ontology_class"
fq=is_obsolete:"true"
rows=50

Counts of types in annotations (illustrates the use of solr 'facets')

URL

http://golr.berkeleybop.org/select?qt=standard&fl=*&version=2.2&wt=json&indent=on&rows=0&facet=true&facet.field=type&q=document_category:%22annotation%22

IEA Annotations from TAIR (first 10)

URL

http://golr.berkeleybop.org/select?qt=standard&fl=*%2Cscore&version=2.2&wt=json&rows=10&indent=on&q=*:*&fq=document_category:annotation&start=0

GOOSE

q=*:*
fq=document_category:annotation
fq=source:"TAIR"
fq=evidence_type:"IEA"

Annotations to both "macromolecule biosynthetic process" and "cellular response to stress" (first 10, plus facets)

URL

http://golr.berkeleybop.org/select?qt=standard&indent=on&wt=json&version=2.2&rows=10&start=0&fl=*%2Cscore&facet=true&facet.field=document_category&facet.field=type&facet.field=evidence_type&facet.field=evidence_closure&facet.field=source&facet.field=taxon&facet.field=isa_partof_label_closure&facet.field=annotation_extension_class_label_closure&fq=&q=*:*&fq=document_category:"annotation"&fq=isa_partof_label_closure:"macromolecule biosynthetic process"&fq=isa_partof_label_closure:"cellular response to stress"

GOOSE (facets generated, but not shown)

q=*:*
fq=document_category:"annotation"
fq=isa_partof_label_closure:"macromolecule biosynthetic process"
fq=isa_partof_label_closure:"cellular response to stress"
facet=true
facet.field=document_category
facet.field=type
facet.field=evidence_type
facet.field=evidence_closure
facet.field=source
facet.field=taxon
facet.field=isa_partof_label_closure
facet.field=annotation_extension_class_label_closure