This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

VFB APIs

All available VFB APIs and underlying schemas.

VFB provides access to its data through several APIs and databases. The core data infrastructure consists of Neo4j graph databases that store integrated neuroanatomical data, complemented by OWL reasoning services for advanced ontological queries and SOLR search for fast text-based queries.

User Access Options

For Regular Users (GUI Access):

For Programmatic Access:

For Advanced Data Access:

  • Direct APIs (documented below): Low-level access to underlying databases and reasoning services

Important Notes

These API documentations describe the schemas used for data storage and basic interfaces. Most VFB queries are constructed from combined query chains that integrate multiple services (Neo4j, OWL reasoning, SOLR search) rather than single API calls. For details on how queries are orchestrated, see the VFB query chains documentation.

The APIs documented here are intended for:

  • Advanced users needing direct database access
  • Developers building custom tools or integrations
  • Researchers requiring low-level data access for specialized analyses

For most use cases, we recommend starting with the VFBconnect library or the web interface.

1 - Production Database (PDB) API

The VFB Production Database (PDB) is a Neo4j graph database containing integrated neuroanatomical data from multiple sources.

The VFB Production Database (PDB) is the main Neo4j graph database containing integrated neuroanatomical data from multiple sources, including ontology data, expression patterns, image annotations, and connectivity information. It serves as the primary data store for comprehensive queries across VFB’s knowledge graph.

Browser Access

You can explore the PDB interactively using the Neo4j browser:

https://pdb.virtualflybrain.org/browser/

Data Structure Overview

The PDB contains over 1.1 million nodes and 43 million relationships, representing a comprehensive knowledge graph of Drosophila neuroanatomy. Below is an overview of the available node labels, relationship types, and property keys.

Node Labels (Gross Classifications)

The PDB uses hierarchical node labels to classify different types of entities:

Core Ontology Nodes:

  • Class, Individual - OWL ontology elements
  • Property - Relationships and attributes

Anatomical Classifications:

  • Anatomy, Neuron, Glial_cell, Muscle, Sense_organ
  • Nervous_system, Synaptic_neuropil, Ganglion, Neuromere
  • Neuron_projection_bundle, Template

Cell Types and Lineages:

  • Motor_neuron, Sensory_neuron, Neuroblast
  • lineage_* (200+ lineage classifications for neural development)

Molecular and Functional:

  • Gene, Expression_pattern, Clone, Feature
  • Receptor, Channel, Transporter, Enzyme
  • Neurotransmitter_receptor (Cholinergic, GABAergic, Glutamatergic, etc.)

Data and Metadata:

  • DataSet, Sample, License, Person
  • pub (Publications), Site, Template
  • VFB, Deprecated, Individual

Dataset-Specific:

  • FAFB, FlyCircuit, L1EM, FANC (Different connectome datasets)
  • has_image, has_neuron_connectivity, has_region_connectivity

Relationship Types

The PDB defines 200+ relationship types for connecting entities:

Core Ontology Relationships:

  • INSTANCEOF, SUBCLASSOF - Class hierarchies
  • has_part, part_of - Anatomical composition
  • located_in, overlaps - Spatial relationships

Connectivity Relationships:

  • synapsed_to - Basic synaptic connections
  • has_presynaptic_terminals_in, has_postsynaptic_terminal_in - Detailed synapse locations
  • sends_synaptic_output_to_region, receives_synaptic_input_in_region - Functional connectivity
  • synapsed_via_type_*_bouton_to - Specific bouton types

Developmental and Temporal:

  • develops_from, develops_into - Developmental progression
  • happens_during, existence_starts_during - Temporal relationships
  • has_member - Group memberships

Functional and Molecular:

  • expresses - Gene expression relationships
  • has_role, capable_of - Functional classifications
  • regulates, positively_regulates, negatively_regulates - Regulatory interactions

Metadata and Attribution:

  • has_reference, created_by, has_license - Provenance
  • database_cross_reference - External identifiers
  • depicts - Image relationships

Property Keys

Properties provide additional metadata and attributes for nodes and relationships:

Identifiers and Labels:

  • id, short_form, label, symbol, name
  • iri, curie, unique_id

Descriptions and Definitions:

  • definition, description, comment
  • example_of_usage, elucidation

References and Attribution:

  • PMID, PMCID, DOI, FlyBase
  • created_by, creation_date, creator
  • has_reference, miniref, pub

Spatial and Quantitative:

  • center, orientation, volume, voxel
  • Tbars, cell_count, cubic_micrometer_overlap
  • NBLAST_score, neuronbridge_score

Quality and Status:

  • confidence_value, curation_status
  • is_obsolete, deprecated, hide_in_terminfo
  • has_curation_status, obsolescence_reason

Technical Metadata:

  • filename, link_base, thumbnail, nrrd, swc
  • dataset_link, license_url, homepage

Query Examples

Note: These are direct Cypher queries for programmatic access to the PDB. The VFB web application typically uses higher-level query chains that combine multiple data sources and reasoning services. For user-friendly querying, use the VFB web interface.

Find all expression patterns for a gene

MATCH (ep:Expression_pattern)-[:expresses]->(gene:Gene {symbol: 'gene_name'})
RETURN ep

Find neurons with presynaptic terminals in a brain region

MATCH (neuron:Neuron)-[:has_presynaptic_terminals_in]->(region:Synaptic_neuropil {label: 'antennal lobe'})
RETURN neuron, region

Find neurons with specific neurotransmitter types

MATCH (neuron:Neuron)-[:INSTANCEOF]->(type:Class)
WHERE type.label CONTAINS 'GABAergic'
RETURN neuron, type

Find neurons in a specific lineage

MATCH (neuron:Neuron)-[:INSTANCEOF]->(type:Class)-[:has_member]->(lineage)
WHERE lineage:lineage_DL1
RETURN neuron, type, lineage

Find synaptic connections between neurons

MATCH (n1:Neuron)-[syn:synapsed_to]->(n2:Neuron)
WHERE n1:FAFB AND n2:FAFB
RETURN n1, syn, n2
LIMIT 10

Find neurons by morphology similarity (NBLAST)

MATCH (n1:Neuron)-[sim:has_similar_morphology_to]->(n2:Neuron)
WHERE sim.NBLAST_score[0] > 0.8
RETURN n1, n2, sim.NBLAST_score[0] AS score
ORDER BY score DESC
LIMIT 10

Find anatomical parts of a brain region

MATCH (part:Anatomy)-[:part_of]->(region:Anatomy {label: 'adult brain'})
RETURN part

Find genes expressed in a specific cell type

MATCH (gene:Gene)<-[:expresses]-(ep:Expression_pattern)-[:overlaps]->(cell:Neuron)
WHERE cell.label CONTAINS ' Kenyon cell '
RETURN DISTINCT gene, ep

Schema Details

OLS OWL Representation

The core schema follows OLS conventions for representing OWL in Neo4j:

  • Classes are represented as nodes with label Class
  • Individuals as nodes with label Individual
  • Properties as nodes with label Property
  • Relationships use Related edges with property labels

Denormalizations

For query performance, the schema includes denormalized named relationships alongside the generic Related edges. This allows efficient pattern matching without attribute filtering.

Expression Data Model

Expression patterns are modeled as:

(ep:Class:Expression_pattern)-[:SUBCLASSOF]->(:Class {label: 'expression pattern'})
(ep)-[:expresses]->(gene:Class)
(ep)<-[:INSTANCEOF]-(individual:Individual)
(ep)-[:overlaps]->(anatomy:Class)

Connectivity Data

Synaptic connections are represented as:

(neuron1:Individual)-[:synapsed_to {count: N}]->(neuron2:Individual)

Or with detailed synapse partonomy using GO terms.

Image Data Model

Image data in the PDB follows the VFB knowledge base specification for image annotation. Images are represented as OWL individuals, linked to anatomical entities they depict through image channels and registration to templates.

Basic Image Structure: Images consist of channels that depict anatomical content and are registered to template spaces:

(Anatomical_Image:Individual)<-[:depicts]-(Image_Channel:Individual)-[:in_register_with]->(Template_Channel:Template:Individual)-[:depicts]->(Template:Individual)

Where:

  • Anatomical_Image: The anatomical individual being depicted (e.g., expression pattern instance)
  • Image_Channel: The image channel containing the actual image data
  • Template_Channel: The reference template channel for spatial registration
  • Template: The template brain or anatomical reference space

Example: Expression Pattern Image

// Anatomical individual (expression pattern instance)
(anatomical_image:Individual {short_form: 'VFB_00020468', label: 'JRC_R10A06 GAL4 in the adult brain'})

// Image channel depicting the anatomical individual
(anatomical_image)<-[:depicts]-(image_channel:Individual {short_form: 'VFBc_00020468', label: 'GMR_10A06_AE_01_08-fA01b_c'})

// Registration to template channel
(image_channel)-[:in_register_with {thumbnail: 'http://www.virtualflybrain.org/data/VFB/i/0002/0468/VFB_00017894/thumbnail.png', nrrd: 'http://www.virtualflybrain.org/data/VFB/i/0002/0468/VFB_00017894/volume.nrrd'}]->(template_channel:Template:Individual {short_form: 'VFBc_00017894', label: 'JFRC2_template_c'})

// Template depicted by template channel
(template_channel)-[:depicts]->(template:Individual {short_form: 'VFB_00017894', label: 'adult brain template JFRC2'})

Querying Images:

// Find images depicting a specific anatomical individual
MATCH (anatomical:Individual {short_form: 'VFB_00020468'})<-[:depicts]-(channel:Individual)
RETURN channel, anatomical

// Find expression pattern images registered to a specific template
MATCH (anatomical:Individual)<-[:depicts]-(channel:Individual)
-[:in_register_with]->(template_channel:Template:Individual)-[:depicts]->(template:Individual {label: 'adult brain template JFRC2'})
RETURN anatomical.label, channel.label

Images include metadata properties such as filenames, thumbnails, voxel sizes, orientations, and links to data sources, stored as node properties on the image channel individuals.

Data Sources

The PDB integrates data from:

  • FlyBase (ontology terms, features, annotations)
  • VFB Knowledge Base (connectivity data)
  • External ontologies (FBbt, GO, etc.)
  • Image datasets and annotations
  • Third-party connectivity datasets
  • Expression pattern data

Updates and Maintenance

The PDB is updated regularly to incorporate new data releases and maintain consistency with upstream sources.

2 - Knowledge Base (KB) API

The VFB Knowledge Base (KB) provides specialized storage and query capabilities for VFB-specific data and annotations.

The VFB Knowledge Base (KB) is a specialized Neo4j database that complements the Production Database (PDB). While the PDB handles integrated ontology data, expression patterns, and image annotations, the KB serves specific VFB requirements and workflows.

Browser Access

Explore the KB using the Neo4j browser:

https://kb.virtualflybrain.org/browser/

Purpose and Scope

The KB serves as:

  1. VFB-Specific Data Repository: Storage for VFB-specific annotations, metadata, and derived data
  2. Workflow Support: Specialized storage supporting VFB curation and integration workflows

Note: Ontology data, expression patterns, image annotations, and connectivity data are stored in the Production Database (PDB).

Schema Requirements

The KB schema is designed with specific requirements:

  • Updateability: Ontology terms and FlyBase features must be updateable via CI
  • ID Stability: Derived class IDs (e.g., expression patterns) must be preserved during updates
  • OWL Compatibility: Subset of content convertible to OWL using standard patterns
  • Dataset Isolation: Ability to generate OWL files for individual datasets

Expression Patterns

Expression patterns in the KB follow the general semantic specification:

  • Definition: Mereological sum of all cells in an anatomical structure expressing a gene/transgene
  • Classification: Hierarchical organization via OWL reasoning
  • Stability: IDs must remain stable across updates

Pattern Types

  • Complete Expression Pattern: All cells in an organism expressing a gene
  • Regional Expression Pattern: Subset of expression in specific anatomical regions

Integration with PDB

The KB and PDB work together in VFB’s data architecture:

  • KB: Specialized storage for VFB-specific annotations, metadata, and derived data
  • PDB: Integrated storage for ontology data, expression patterns, image annotations, connectivity data, and cross-referenced information
  • Data Flow: VFB-specific data from KB supports curation and integration workflows alongside PDB data

Note: For queries involving ontology data, expression patterns, or image annotations, use the Production Database (PDB).

Maintenance and Updates

The KB is maintained through:

  • Manual curation workflows
  • Automated data loading pipelines
  • Integration with external data sources
  • Quality control and validation processes

For more details on the underlying schema, see the VFB Neo4j documentation.

3 - Owlery API

The Owlery API provides OWL reasoning services for VFB’s ontologies, enabling complex queries over class hierarchies and relationships.

The Owlery API is VFB’s OWL (Web Ontology Language) reasoning service, providing advanced query capabilities over the ontologies used in VFB. It enables Description Logic (DL) queries, SPARQL queries with OWL reasoning, and access to multiple knowledgebases.

API Endpoint

Base URL: https://owl.virtualflybrain.org/

Note: VFB provides a single knowledgebase (vfb) containing all VFB ontologies and reasoning data. All examples in this documentation use the vfb knowledgebase.

Knowledgebase Operations

Note: VFB provides access to a single knowledgebase (vfb) containing all VFB ontologies and reasoning data. The general /kbs endpoint is not accessible - all operations must use /kbs/vfb/.

Get Knowledgebase Information

GET /kbs/vfb

Display information and status for the VFB knowledgebase.

Response: JSON object with KB information

DL Queries (Description Logic)

Owlery provides standard OWL DL query operations for reasoning over class hierarchies and relationships using Manchester syntax.

Subclasses

GET /kbs/vfb/subclasses

Get subclasses of a named class or class expression.

Parameters:

  • object (query): Manchester-syntax OWL class expression
  • prefixes (query): JSON format prefix map for expanding prefixes
  • direct (query): true for direct subclasses only (default: true)
  • includeEquivalent (query): Include equivalent classes (default: false)
  • includeNothing (query): Include owl:Nothing (default: false)
  • includeDeprecated (query): Include deprecated terms (default: true)

Superclasses

GET /kbs/vfb/superclasses

Get superclasses of a named class or class expression.

Parameters:

  • object (query): Manchester-syntax OWL class expression
  • prefixes (query): JSON format prefix map
  • direct (query): true for direct superclasses only (default: true)
  • includeEquivalent (query): Include equivalent classes (default: false)
  • includeThing (query): Include owl:Thing (default: false)
  • includeDeprecated (query): Include deprecated terms (default: true)

Equivalent Classes

GET /kbs/vfb/equivalent

Get equivalent classes of a named class or class expression.

Parameters:

  • object (query): Manchester-syntax OWL class expression
  • prefixes (query): JSON format prefix map
  • direct (query): true for direct equivalents only (default: true)
  • includeDeprecated (query): Include deprecated terms (default: true)

Satisfiability

GET /kbs/vfb/satisfiable

Check if a class expression is satisfiable.

Parameters:

  • object (query): Manchester-syntax OWL class expression
  • prefixes (query): JSON format prefix map

Response: Boolean indicating satisfiability

Instances

GET /kbs/vfb/instances

Get instances of a named class or class expression.

Parameters:

  • object (query): Manchester-syntax OWL class expression
  • prefixes (query): JSON format prefix map
  • direct (query): true for direct instances only (default: true)
  • includeDeprecated (query): Include deprecated terms (default: true)

Types

GET /kbs/vfb/types

Get types (classes) of a named individual.

Parameters:

  • object (query): Individual IRI
  • prefixes (query): JSON format prefix map
  • direct (query): true for direct types only (default: true)
  • includeThing (query): Include owl:Thing (default: false)
  • includeDeprecated (query): Include deprecated terms (default: true)

SPARQL Services

Owlery provides SPARQL query capabilities with OWL reasoning support using Owlet-style embedded class expressions.

SPARQL Query (GET)

GET /kbs/vfb/sparql

Perform SPARQL query encoded in URL parameter.

Parameters:

  • query (query): SPARQL query string

Response: SPARQL results in XML format (application/sparql-results+xml)

SPARQL Query (POST)

POST /kbs/vfb/sparql

Perform SPARQL query contained in request body.

Request Body:

  • Content-Type: application/sparql-query
  • Body: SPARQL query text

Response: SPARQL results

SPARQL Query Expansion (GET)

GET /kbs/vfb/expand

Expand a SPARQL query by transforming Owlet-style embedded class expressions into FILTERs.

Parameters:

  • query (query): SPARQL query string

Response: Expanded SPARQL query (application/sparql-query)

SPARQL Query Expansion (POST)

POST /kbs/vfb/expand

Expand a SPARQL query contained in request body.

Request Body:

  • Content-Type: application/sparql-query
  • Body: SPARQL query text

Response: Expanded SPARQL query

VFB Query Integration

VFB extensively uses Owlery for its high-level query operations. The following table shows how VFB’s named query operations map to Owlery API endpoints, focusing on the vfb knowledgebase:

VFB Query Operation Owlery API Call Description
Owlery Subclasses of GET /kbs/vfb/subclasses?object={IRI}&direct=false&includeDeprecated=false&includeEquivalent=true Get all subclasses of a class
Owlery Part of GET /kbs/vfb/superclasses?object={IRI}&direct=false&includeDeprecated=false&includeEquivalent=true Get all superclasses/parts containing a class
Owlery Neuron class with part here GET /kbs/vfb/subclasses?object=<http://purl.obolibrary.org/obo/FBbt_00005106> and <http://purl.obolibrary.org/obo/RO_0002131> some {IRI}&direct=false&includeDeprecated=false&includeEquivalent=true Find neuron classes with anatomical parts in a region
Owlery Neurons Synaptic GET /kbs/vfb/subclasses?object=<http://purl.obolibrary.org/obo/FBbt_00005106> and <http://purl.obolibrary.org/obo/RO_0002130> some {IRI}&direct=false&includeDeprecated=false&includeEquivalent=true Find neurons with synaptic terminals in a region
Owlery Neurons Presynaptic GET /kbs/vfb/subclasses?object=<http://purl.obolibrary.org/obo/FBbt_00005106> and <http://purl.obolibrary.org/obo/RO_0002113> some {IRI}&direct=false&includeDeprecated=false&includeEquivalent=true Find neurons with presynaptic terminals in a region
Owlery Neurons Postsynaptic GET /kbs/vfb/subclasses?object=<http://purl.obolibrary.org/obo/FBbt_00005106> and <http://purl.obolibrary.org/obo/RO_0002110> some {IRI}&direct=false&includeDeprecated=false&includeEquivalent=true Find neurons with postsynaptic terminals in a region
Owlery Neuron classes fasciculating here GET /kbs/vfb/subclasses?object=<http://purl.obolibrary.org/obo/FBbt_00005106> and <http://purl.obolibrary.org/obo/RO_0002101> some {IRI}&direct=false&includeDeprecated=false&includeEquivalent=true Find neurons that fasciculate together in a region
Owlery tracts in GET /kbs/vfb/subclasses?object=<http://purl.obolibrary.org/obo/FBbt_00005099> and <http://purl.obolibrary.org/obo/RO_0002134> some {IRI}&direct=false&includeDeprecated=false&includeEquivalent=true Find tracts/nerves innervating a region
Owlery Lineage Clones GET /kbs/vfb/subclasses?object=<http://purl.obolibrary.org/obo/FBbt_00007683> and <http://purl.obolibrary.org/obo/RO_0002131> some {IRI}&direct=false&includeDeprecated=false&includeEquivalent=true Find lineage clones in a region
Owlery Transgenes expressed in GET /kbs/vfb/subclasses?object=<http://purl.obolibrary.org/obo/SO_0001059> and <http://purl.obolibrary.org/obo/RO_0002292> some {IRI}&direct=false&includeDeprecated=false&includeEquivalent=true Find transgenes expressed in a region
Owlery Images of neurons with some part here GET /kbs/vfb/instances?object=<http://purl.obolibrary.org/obo/FBbt_00005106> and <http://purl.obolibrary.org/obo/RO_0002131> some {IRI}&direct=false&includeDeprecated=false Find individual neurons with anatomical parts in a region
Owlery individual parts GET /kbs/vfb/instances?object=<http://purl.obolibrary.org/obo/BFO_0000050> some {IRI}&direct=false&includeDeprecated=false Find individuals that are part of some anatomical entity
Images of neurons that develops from this GET /kbs/vfb/instances?object=<http://purl.obolibrary.org/obo/FBbt_00005106> and <http://purl.obolibrary.org/obo/RO_0002202> some {IRI}&direct=false&includeDeprecated=false Find individual neurons that develop from a particular anatomical entity

Common VFB Query Patterns

Find all anatomical subclasses of the adult brain

GET /kbs/vfb/subclasses?object=FBbt_00003624&direct=false&includeDeprecated=false&includeEquivalent=true

Used in: PartsOf, SubclassesOf queries

Find all neurons with some part in the antennal lobe

GET /kbs/vfb/subclasses?object=<http://purl.obolibrary.org/obo/FBbt_00005106> and <http://purl.obolibrary.org/obo/RO_0002131> some FBbt_00007484&direct=false&includeDeprecated=false&includeEquivalent=true

Used in: NeuronsPartHere, neuron classification queries

Find all synaptic neuropils in the brain

GET /kbs/vfb/subclasses?object=FBbt_00005106&direct=false&includeDeprecated=false&includeEquivalent=true

Used in: NeuronsSynaptic, connectivity queries

Check if a class expression is valid

GET /kbs/vfb/satisfiable?object=FBbt_00003624

Used in: Query validation and reasoning checks

Complex Query Examples

Many VFB queries combine Owlery with other services. For example, the “Neurons with presynaptic terminals in antennal lobe” query typically involves:

  1. Owlery reasoning: Find anatomical subclasses of the antennal lobe
  2. Neo4j lookup: Find neurons with presynaptic terminals in those regions
  3. SOLR search: Retrieve associated images and metadata

While these complex queries are handled by VFB’s query orchestration system, the individual Owlery components can be called directly for custom analyses.

Usage Examples

Note: VFB supports both full IRIs (e.g., http://purl.obolibrary.org/obo/FBbt_00003624) and short forms (e.g., FBbt_00003624) for class identifiers.

Basic Ontology Queries

Find all parts of the adult brain

GET /kbs/vfb/subclasses?object=FBbt_00003624
# or using full IRI:
GET /kbs/vfb/subclasses?object=http://purl.obolibrary.org/obo/FBbt_00003624

Find all neurons in the antennal lobe

GET /kbs/vfb/instances?object=FBbt_00007484

Find all synaptic neuropil subclasses

GET /kbs/vfb/subclasses?object=FBbt_00005106

SPARQL Reasoning Examples

Find GABAergic neurons using OWL reasoning

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?neuron ?label
WHERE {
  ?neuron rdfs:subClassOf <http://purl.obolibrary.org/obo/FBbt_00005106> .
  ?neuron rdfs:label ?label .
  FILTER(CONTAINS(?label, "GABA"))
}

Find anatomical parts with expression data

PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT ?part ?expression
WHERE {
  ?part rdfs:subClassOf <http://purl.obolibrary.org/obo/FBbt_00003624> .
  ?expression <http://purl.obolibrary.org/obo/RO_0002292> ?part .
}

Response Formats

Owlery returns results in JSON format by default. Available formats include:

  • application/json (default)
  • text/plain
  • application/rdf+xml
  • text/turtle

Specify format using the Accept header or format query parameter.

Error Handling

Owlery returns standard HTTP status codes:

  • 200: Success
  • 400: Bad request (invalid query/parameters)
  • 404: Knowledgebase or resource not found
  • 500: Server error

Error responses include JSON with error details:

{
  "error": "Error message",
  "details": "Additional information"
}

Integration with VFB

Owlery is a core component of VFB’s query system, providing the reasoning capabilities that power complex anatomical and connectivity queries. It’s used in combination with the PDB (Neo4j) and SOLR search services to deliver comprehensive results to users.

4 - SOLR Search API

The SOLR Search API provides fast text search and autocomplete functionality for VFB entities, datasets, and publications.

The SOLR Search API powers VFB’s search and autocomplete functionality, providing fast text-based queries across all VFB entities including anatomical terms, neurons, datasets, publications, and more.

Note: Search and autocomplete functionality is also built into VFBconnect by default. The vfb.term() method will automatically attempt to match partial terms and provide autocomplete suggestions. See the VFBconnect documentation for programmatic access.

API Endpoint

Base URL: https://solr.virtualflybrain.org/solr/ontology/select

Note: VFB uses JSON-formatted parameter requests for complex queries.

Search Parameters

Core Search Parameters

Parameter Description VFB Default Example
q Main search query (supports SOLR query syntax) Complex expansion (medulla OR medulla* OR *medulla OR *medulla*)
defType Query parser type edismax edismax
mm Minimum match percentage for multi-term queries 45% 45%
qf Query fields with boost values label^110 synonym^100 label_autosuggest synonym_autosuggest shortform_autosuggest label^110 synonym^100...
fl Fields to return short_form,label,synonym,id,facets_annotation,unique_facets short_form,label,synonym,id,facets_annotation,unique_facets
rows Number of results to return 150 50
start Starting offset for pagination 0 0
wt Response format json json
indent Pretty-print JSON response true true

Query Field Boosting (qf)

VFB uses sophisticated field boosting for optimal search results:

  • label^110 - Primary labels get highest boost
  • synonym^100 - Synonyms get high boost
  • label_autosuggest - Autosuggest-optimized labels
  • synonym_autosuggest - Autosuggest-optimized synonyms
  • shortform_autosuggest - Autosuggest-optimized short forms

Query Expansion

VFB automatically expands search terms for better matching:

  • Original term: medulla
  • Expanded to: (medulla OR medulla* OR *medulla OR *medulla*)

This catches prefix, suffix, and infix matches.

Filter Queries (fq)

VFB applies specific filter queries to focus results on relevant entities:

fq=(short_form:VFB* OR short_form:FB* OR facets_annotation:DataSet OR facets_annotation:pub) AND NOT short_form:VFBc_*

This filter includes:

  • VFB entities (VFB*) including anatomical individuals (VFB_*), expression patterns (VFBexp*), and extension ontology terms (VFBext*)
  • FlyBase entities (FB*)
  • Datasets (facets_annotation:DataSet)
  • Publications (facets_annotation:pub)

And excludes:

  • VFB image channel node entries (VFBc_*) - as opposed to anatomical individuals (VFB_*)

Boost Parameters (bq)

VFB uses boost queries to prioritize certain types of results:

bq=short_form:VFBexp*^10.0 short_form:VFB*^100.0 short_form:FBbt*^100.0 short_form:FBbt_00003982^2 facets_annotation:Deprecated^0.001 facets_annotation:DataSet^500.0 facets_annotation:pub^100.0

Boost Priorities:

  • Expression patterns (VFBexp*): 10x boost
  • VFB entities (VFB*): 100x boost
  • Anatomy terms (FBbt*): 100x boost
  • Adult brain (FBbt_00003982): 2x boost
  • Datasets: 500x boost
  • Publications: 100x boost
  • Deprecated items: 0.001x (demoted)

Additional Parameters

Parameter Description Default
pf Phrase fields for exact phrase boosting true
indent Pretty-print JSON response true

Response Format

JSON Response Structure

{
  "responseHeader": {
    "status": 0,
    "QTime": 15,
    "params": {...}
  },
  "response": {
    "numFound": 1234,
    "start": 0,
    "docs": [
      {
        "short_form": "FBbt_00007484",
        "label": "antennal lobe",
        "synonym": ["antennal lobe"],
        "id": "http://purl.obolibrary.org/obo/FBbt_00007484",
        "facets_annotation": ["Adult", "Nervous_system"],
        "unique_facets": ["adult antennal lobe", "nervous system"]
      }
    ]
  }
}

Field Descriptions

Field Description
short_form VFB/FlyBase short identifier
label Primary display name
synonym Alternative names and synonyms
id Full IRI/URI identifier
facets_annotation Categorization facets (e.g., “Adult”, “Nervous_system”)
unique_facets Processed facet combinations for display

Search Examples

JSON Parameter Format (VFB Standard)

VFB uses JSON-formatted parameter requests for complex queries:

GET /solr/ontology/select?json={"params":{"q":"(medulla OR medulla* OR *medulla OR *medulla*)","q.op":"OR","defType":"edismax","mm":"45%","qf":"label^110 synonym^100 label_autosuggest synonym_autosuggest shortform_autosuggest","indent":"true","fl":"short_form,label,synonym,id,facets_annotation,unique_facets","start":"0","pf":"true","fq":["(short_form:VFB* OR short_form:FB* OR facets_annotation:DataSet OR facets_annotation:pub) AND NOT short_form:VFBc_*"],"rows":"150","wt":"json","bq":"short_form:VFBexp*^10.0 short_form:VFB*^100.0 short_form:FBbt*^100.0 short_form:FBbt_00003982^2 facets_annotation:Deprecated^0.001 facets_annotation:DataSet^500.0 facets_annotation:pub^100.0"}}

URL-Encoded Parameters (Alternative)

For simpler queries, you can use traditional URL parameters:

GET /solr/ontology/select?q=medulla&fl=short_form,label,synonym,id&rows=10&wt=json

Autocomplete Query Example

The medulla autocomplete query expands to match various forms:

Query Breakdown:

  • q: (medulla OR medulla* OR *medulla OR *medulla*) - Matches medulla at start, middle, or end
  • defType: edismax - Extended dismax query parser for complex queries
  • mm: 45% - At least 45% of query terms must match
  • qf: Field boosting for optimal relevance
  • fq: Filters to include relevant entities only
  • bq: Boosts for prioritizing certain result types

Simple Search Examples

GET /solr/ontology/select?q=antennal&rows=10&wt=json&fl=short_form,label
GET /solr/ontology/select?q=dataset&fq=facets_annotation:DataSet&rows=20&wt=json
GET /solr/ontology/select?q=connectome&fq=facets_annotation:pub&rows=10&wt=json

Autocomplete Usage

VFB’s autocomplete functionality uses this SOLR API with specific parameters optimized for fast, relevant suggestions:

Autocomplete Query

GET /solr/vfb_olympiad/select?q=antennal&fl=short_form,label,synonym,id,facets_annotation,unique_facets&start=0&rows=150&wt=json&pf=true&fq=(short_form:VFB*%20OR%20short_form:FB*%20OR%20facets_annotation:DataSet%20OR%20facets_annotation:pub)%20AND%20NOT%20short_form:VFBc_*&bq=short_form:VFBexp*^10.0%20short_form:VFB*^100.0%20short_form:FBbt*^100.0%20short_form:FBbt_00003982^2%20facets_annotation:Deprecated^0.001%20facets_annotation:DataSet^500.0%20facets_annotation:pub^100.0

Integration with VFB

The SOLR API is a core component of VFB’s search infrastructure:

  1. Web Interface: Powers the main search box and autocomplete
  2. Query Chains: Used in combination with PDB and Owlery queries
  3. Result Ranking: Complex sorting logic prioritizes relevant results
  4. Facet Filtering: Enables filtering by categories like “Adult”, “Larva”, etc.

Result Processing

VFB applies additional client-side processing to SOLR results:

  • Sorting: Custom ranking based on match quality and entity type
  • Deduplication: Removes duplicate entries
  • Facet Processing: Converts facet annotations to user-friendly labels

Performance Notes

  • Caching: VFB implements caching for frequently searched terms
  • Pagination: Use start and rows for large result sets
  • Query Optimization: Complex queries may benefit from the pf (phrase fields) parameter
  • Rate Limiting: Consider implementing delays between rapid autocomplete requests

Error Handling

SOLR returns standard HTTP status codes:

  • 200: Success
  • 400: Bad request (malformed query)
  • 500: Server error

Error responses include details in the response header.