How to query Solr using the Command Line

For this we will use the Golr endpoint: https://golr.geneontology.org/solr

Note this endpoint doesn’t use Solr cores - all collections are in a single core and are differentiated by the document_category field.

Specifying a Solr backend on the command line:

We can specify this directly on the CLI. Following does a facet count query on the source slot:

[1]:
%%bash
linkml-store -d solr:https://golr.geneontology.org/solr --set collection_type_slot=document_category -c ontology_class fq -S source
{
  "source": {
    "ncbi_taxonomy": 30916,
    "biological_process": 30715,
    "molecular_function": 12597,
    "cellular_component": 4513,
    "eco": 2004,
    "sequence": 106,
    "go/extensions/gorel": 74,
    "external": 66,
    "gene_ontology": 3,
    "AGI_LocusCode": 0,
    "CGD": 0,
    "ComplexPortal": 0,
    "FB": 0,
    "GeneDB": 0,
    "JaponicusDB": 0,
    "MGI": 0,
    "PR": 0,
    "PlasmoDB": 0,
    "PomBase": 0,
    "PseudoCAP": 0,
    "RGD": 0,
    "RNAcentral": 0,
    "RefSeq": 0,
    "SGD": 0,
    "SGN": 0,
    "TAIR": 0,
    "TriTrypDB": 0,
    "UniProtKB": 0,
    "WB": 0,
    "Xenbase": 0,
    "ZFIN": 0,
    "dictyBase": 0
  }
}

Using a configuration

Rather than specifying the same information again each time, we can use a configuration.

See input/golr.config.yaml.

[3]:
%%bash
linkml-store -C input/golr.config.yaml -c ontology_class fq -S source
{
  "source": {
    "ncbi_taxonomy": 30916,
    "biological_process": 30712,
    "molecular_function": 12596,
    "cellular_component": 4513,
    "eco": 2004,
    "sequence": 106,
    "go/extensions/gorel": 74,
    "external": 66,
    "gene_ontology": 3,
    "AGI_LocusCode": 0,
    "CGD": 0,
    "ComplexPortal": 0,
    "FB": 0,
    "GeneDB": 0,
    "JaponicusDB": 0,
    "MGI": 0,
    "PR": 0,
    "PlasmoDB": 0,
    "PomBase": 0,
    "PseudoCAP": 0,
    "RGD": 0,
    "RNAcentral": 0,
    "RefSeq": 0,
    "SGD": 0,
    "SGN": 0,
    "TAIR": 0,
    "TriTrypDB": 0,
    "UniProtKB": 0,
    "WB": 0,
    "Xenbase": 0,
    "ZFIN": 0,
    "dictyBase": 0
  }
}