databases:

  chebi.ex:
    name: ChEBI example connector
    description: An example connector for ChEBI.
    compound.db: true
    entry.content.encoding: UTF-8
    entry.content.type: xml
    parsing.expr:
      accession: substring-after(//chebi:return/chebi:chebiId,'CHEBI:')
      formula:
        - //chebi:Formulae/chebi:source[text()='ChEBI']/../chebi:data
        - (//chebi:Formulae/chebi:data)[1]
      inchi: //chebi:return/chebi:inchi
      inchikey: //chebi:return/chebi:inchiKey
      mass: //chebi:mass
      monoisotopic.mass: //chebi:monoisotopicMass
      name:
        - //chebi:chebiAsciiName
      smiles: //chebi:return/chebi:smiles
    searchable.fields:
      - name
      - monoisotopic.mass
      - molecular.mass
    remote: true
    scheduler.t: 1
    scheduler.n: 3
    urls:
      base.url: https://www.ebi.ac.uk/chebi/
      ws.url: https://www.ebi.ac.uk/webservices/chebi/2.0/
    xml.ns:
      chebi: https://www.ebi.ac.uk/webservices/chebi
      xsd: http://www.w3.org/2001/XMLSchema

fields:

  chebi.ex.id:
    description: ChEBI ID
    type: id
    card: many
    forbids.duplicates: true
    case.insensitive: true
