FAIRmat-NFDI / AreaA-data_modeling_and_schemas

The ELN custom schemas from synthesis experiments
https://fairmat-nfdi.github.io/AreaA-Documentation/
11 stars 6 forks source link

ConCat Inventory Management design #81

Open PeterKraus opened 12 months ago

PeterKraus commented 12 months ago

Hello everyone,

I would like to start using my Oasis as an inventory management system. I had a play around with the default schemas (Substance ELN, Sample ELN) that are built into NOMAD, and I believe I can implement most of what I want using the python plugins directly. However, I'd like to have the following fields in my "Chemical" schema:

Chemical:
  name:
  description:
  batch number:
  manufacture date:
  supplier:
  supplier ID:
  purity:
  packaging size:
  PureSubstance -> PubChem Pure Substance

I think the keys are fairly self-explanatory. I would like the supplier key to be one from a controlled vocabulary, imagine something like {Sigma-Aldrich, Fischer, VWR, ...} which would ideally be fairly easily added to using a separate GUI. What's the best way of doing this? A separate Supplier schema?

The manufacture date key should be a date. Can anyone point me to how to annotate that the field should use a "date-picker"?

Also, if anyone has a scraper that can populate things like purity, packaging size and ideally retrieve a SMILES / InChI / CAS number given a supplier and supplier ID, so that the PureSubstance can be generated automagically, that would be ace.

aalbino2 commented 11 months ago

Hi Peter!

for controlled vocabulary we have this enumeration quantity:

    measurement_type = Quantity(
        type=MEnum(
            'Assumed',
            'Quartz Crystal Microbalance',
            'RHEED',
        )
    )

other kinds of quantities can be found here:

https://nomad-lab.eu/prod/v1/staging/gui/dev/editquantity

they are written in yaml though. In this cases it can be useful to clone the official nomad repo https://github.com/nomad-coe/nomad and use the search engine of some IDE or editor to look all the occurrences that live in the code and may give you some insights on the use of the specific keyword you're looking at.

For manufacture, there is this DateTimeEditQuantity that looks like this:

    start_time = Quantity(
        type=Datetime,
        description='''
        my description
        ''',
        a_eln=ELNAnnotation(
            component='DateTimeEditQuantity',
            label='Starting time'
        ),
    )

If you use the PubChemPureSubstanceSection class, available in nomad.datamodel.metainfo.basesections, there is an API query performed from the pubchem database whenever the CAS quantity or the name quantity is filled with a recognised formula.

This section is usually wrapped up in the PureSubstance class, so you can decide to take the full one, or only reuse the PubChemPureSubstanceSection. You would need in both cases to fill the CAS or name inside the PubChemPureSubstanceSection section:

Screenshot from 2023-12-05 11-29-33

The other colleagues will say more, if they have more insights.

Sorry for late answer!