Should you require any more information or have encountered a problem, please call the support helpdesk on (07) 5456 6000.

The models and contexts in GELLO can be bespoke, that is they can be custom designed for a given implementation. In health FHIR could well be one such model, instead of the HL7 V2 VMR Medical Objects uses.

This section describes some simple two level models built and implemented against, in various non-health domains, purely by way of example.

What could be the advantages of using a functional approach like GELLO? Advantages people talk about include being side effect free, referentially transparent, loops can be done recursively (and can be tail recursive), programming style is declarative and functions are pure. Another advantage of GELLO is that is is fairly obscure so there is much less risk with importing dependencies.

Engineering example

This first example will walk through an idea of building a small mechanical engineering ontology that started life with reference to https://fastenerengineering.com/what-are-pins/ . This ontology then will be used in a GELLO query along with information model instance data.

Engineering ontology

The ontology was created using a traditional Concepts, Descriptions and Relationships table approach, which also borrowed column headers from SNOMED, to allow an easier import into a terminology server used to SNOMED. 97 concepts were assigned random alphanumeric identifiers and given hierarchical types:

A similar number of relationships were made, mostly of the Is_A type:


This example will be about a type of fastener called a grooved pin coded internally to 9377156411. A small parent child table about grooved pins, coiled pins, dowel pins, cotter pins, split pins and slotted pins (phew!) was made and saved as an imported csv file. This has five levels of hierarchy with parents of Pin (Part), Fastener (Part) , Part (BuiltThing) and BuiltThing (BuiltThing). There is a second hierarchy going through 6253914735 | MechanicalFirmLinkage (BuiltThing) | . This table serves as a small reference terminology or ontology and the GELLO will make an appeal to it. It could be further populated out of the Relationships table. The table will be used in the code to return a boolean if a child and a parent concept are in the same row. The table is shown here:

Engineering schema

The information model was built as a gello_model and an XSD schema.

Here is the gello_model:



Package OntoEngineering
Imports iso_21090_datatypes

    class Geometry extends Any
      name: String
      code: CD -- square, rectangle, circle, triangle, cylinder, cone, sphere, line , cube, cuboid
      area: PQ   --derived
      width: PQ
      length: PQ
      height: PQ
      volume: PQ  --derived
      radius: PQ
      circumference: PQ
      describingFunction: String
 --all horizontal relationships done up to here

    class BuiltThing extends Any
      code: CD
      hasGeometry: Sequence(Geometry)
      hasBehaviour: Behaviour
      hasRole: Role
      component: Sequence(Component)
      tensileStrength: PQ
      btArea: PQ
      btWidth: PQ
      btLength: PQ
      btVolume: PQ
      btRadius: PQ
      btCircumference: PQ
      btFluxEmmission: PQ
      spaceType: CD  -- negative, positive, negAndPos
      constructionMaterial: CD  -- wood, steel
      constructionMethod: CD  --  extruded, printed, cast, milled
      elasticity: PQ

    class Part extends BuiltThing
      partID: String
      usedWith: Sequence(Part)

    class Behaviour extends Any

    class Role extends Any
      participant1: Part
      participant2: Part
      roleType: CD -- fasten, support, join

    class Component extends Part
      componentID: String

    class Fastener extends Part  --reference https://fastenerengineering.com/what-are-pins/
      type: CD  --mechanical, electromagnetic, adhesive

    class Pin extends Fastener
      pinType: CD -- dowel, slotted, coiled (spiral), grooved, split, cotter
      chamfer: Chamfer

    class Chamfer extends Any
      angle: PQ
      chamferLength: PQ
      turnOffDistance: PQ
      chamferLocation: CD  -- proximal, distal

    class SpringPin extends Pin  --new
      springStrength: PQ

    class SlottedPin extends SpringPin
      sheetRevolutionDeg: PQ
      compressionTolerance: PQ

    class CoiledPin extends SpringPin
        -- sheetRevolutionDeg > 360 deg

    class GroovedPin extends Pin
      grooveNumber: Integer  --usually 3    -- done
      groove: Sequence(Component)

    class CotterPin extends Any
      taper: Geometry

    class SplitPin extends Pin
      end: Sequence(Component)

    class Bush extends Part
      -- spaceType = negative
      interferenceMeasure: PQ
      chamfer: Chamfer

    class InfrastructureRoot extends Any
       builtThing: Sequence(BuiltThing)

EndPackage


Data

A xml file was created that accords with the model. The OIDs in the CD's codeSystem and the codeSystemName attributes in this example and the next are made up.


<GroovedPin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <type
        code="5336670848"
        codeSystem="2.16.840.1.113883.6.8"
        codeSystemName="OntoEValueDomain">
        <displayName value = "Mechanical" />
    </type>
    <pinType
        code="9377156411"
        codeSystem="2.16.840.1.113883.6.8"
        codeSystemName="OntoEValueDomain">
        <displayName value = "Grooved Pin" />    
    </pinType>
    <partID value = '6787982-A'/>
    <hasGeometry> 
            <code
                code="7573194557"
                codeSystem="2.16.840.1.113883.6.8"
                codeSystemName="OntoEValueDomain">
                <displayName value = "Cylinder"/>
            </code>
    </hasGeometry>
    <spaceType
            code="8494431267"
            codeSystem="2.16.840.1.113883.6.8"
            codeSystemName="OntoEValueDomain">
            <displayName value = "PositiveSpace"/>    
    </spaceType>
    <btLength xsi:type = "PQ" value = "100" unit = "mm" />
    <btRadius xsi:type = "PQ" value = "10" unit = "mm" />
    <hasRole>
        <roleType code="4514449250"
                  codeSystem="2.16.840.1.113883.6.8"
                  codeSystemName="OntoEValueDomain">
                  <displayName value = "Fasten"/>
    </roleType>
    </hasRole>
    <usedWith>
        <partID value = '89u207-F'/>
        <code
            code="7715218853"
            codeSystem="2.16.840.1.113883.6.8"
            codeSystemName="OntoEValueDomain">
            <displayName value = "Bush"/>
        </code>
    </usedWith>
    <component>
        <componentID value = 'Groove1'/>
        <hasGeometry> 
            <code
                code="7573194557"
                codeSystem="2.16.840.1.113883.6.8"
                codeSystemName="OntoEValueDomain">
                <displayName value = "Cylinder"/>
            </code>
        </hasGeometry>
        <spaceType
            code="8999051355"
            codeSystem="2.16.840.1.113883.6.8"
            codeSystemName="OntoEValueDomain">
            <displayName value = "NegativeSpace"/>    
        </spaceType>
        <btLength xsi:type = "PQ" value = "75" unit = "mm" />
        <btRadius xsi:type = "PQ" value = "4" unit = "mm" />
    </component>

    
    <grooveNumber value = '1' />
</GroovedPin>

This data instance is about a grooved pin with one groove. The idea of a grooved pin is that is has two or more grooves usually which compress when the pin is inserted with force into a preformed hole, in this case a 'bush'. They are meant to not move. So there is a risk if the groove number is wrong as this part could slip due to a lack of friction in the linkage. At a semantic level we want a firm mechanical linkage and therefore want to use the correct part - would we discover that a grooved pin is a firm linkage if we looked it up in mechanical engineering textbooks? This is what the semantic appeal will attempt to address.

So lets move onto the actual GELLO:

GELLO

Imports OntoEngineering, DB.OntoEngineeringParentChildTable
Context GroovedPin

--validation rules:
Let groovedPinConcept:CD = pinType
Let grooveNumberOk: Boolean = grooveNumber >= 2
Let partTypeOk: Boolean  = type.displayName.value = 'Mechanical'
Let correctAssocPart: Boolean = usedWith->exists(code.displayName.value='Bush')

--implies
Let mechanicalFirmLinkage_Concept: CD = CD{code = '6253914735',
                                           codeSystem ='3.16.840.1.113883.6.8',
                                           codeSystemName = 'OntoEValueDomain',
                                           displayName = ST{value = 'Mechanical Firm Linkage'}}
Let groovedPin_Concept: CD = CD{code = '9377156411',
                                codeSystem ='3.16.840.1.113883.6.8',
                                codeSystemName = 'OntoEValueDomain',
                                displayName = ST{value = 'Grooved Pin'}} 
Let test: Boolean = groovedPinConcept = groovedPin_Concept
Let parentConcept: CD = mechanicalFirmLinkage_Concept
Let childConcept: CD = groovedPin_Concept
Let ontoETable: Sequence(TBL.csv)= csv
Let selectedRowOrRows: Sequence(TBL.csv) =
         ontoETable->select((LeafID = childConcept.code.toReal())
                             and (
                                  (If Parent1.oclIsDefined() then Parent1 = parentConcept.code.toReal() else False endif) or
                                  (If Parent2.oclIsDefined() then Parent2 = parentConcept.code.toReal() else False endif) or
                                  (If Parent3.oclIsDefined() then Parent3 = parentConcept.code.toReal() else False endif) or
                                  (If Parent4.oclIsDefined() then Parent4 = parentConcept.code.toReal() else False endif) or
                                  (If Parent5.oclIsDefined() then Parent5 = parentConcept.code.toReal() else False endif) or
                                  (If Parent6.oclIsDefined() then Parent6 = parentConcept.code.toReal() else False endif) or
                                  (If Parent7.oclIsDefined() then Parent7 = parentConcept.code.toReal() else False endif) or
                                  (If Parent8.oclIsDefined() then Parent8 = parentConcept.code.toReal() else False endif))
                                 )
Let impliesBoolean: Boolean = selectedRowOrRows.size()>0

-- result
Tuple { checkGrooveNumber = grooveNumberOk ,
        checkPartTyping =  partTypeOk,
        checkUsedWith = correctAssocPart,
        checkSemantics = impliesBoolean
        }


and here is the result:


Astronomy example

Astronomers use a type of star called a Cepheid variable to calculate distances to astronomical objects at galactic and extragalactic scales. This is because it was discovered that the period of the pulsations corresponds to their absolute brightness. There is a formula that then can also take the observed brightness of the object to calculate the distance of the star from Earth in parsecs. Type II Cepheids are usually used. These are population II stars with the characteristics of being metal poor, old, masses < 0.5 MSun and their periods determine subclasses. These subclasses are RV Tauri, W Vir and BL Her. RV Tauri stars including the star RV Tauri itself are massive supergiants. This example takes observations from a catalogue called SIMBAD for the RV Tauri object. The GELLO model is again bespoke but again uses ISO:21090 datatypes. There is an ontological appeal to a parent-child table based on the IVOA Ontology v. 1.3 for checking the supergiant relationship. We will assess a given star's suitability to be identified as a Type II Cepheid variable star and then check the subtype. (It should be RV Tauri as this is the type exemplar)

Astro-ontology

There is or was one called the IVOA Ontology v. 1.3 and for this example it formed the basis of a created small concept table of 400 rows, a created 511 strong relationships table and a created parent-child table of 381 rows. The function for subsumption in this example has been moved to a separate package but is similar to the engineering example above. Importantly, this asserts the proposition that 46612991 | RVTauri (AstrObject) |  Is_A  81261979 | SuperGiant (AstrObject) | :

The SIMBAD Observations GELLO Model

Here is the bespoke model made for this example:

Package SIMBADObjectPackage
imports
    iso_21090_datatypes


  class SIMBADObjectObservations extends Any
    designation: ST
    objectType: ObjectType
    otherObjectType: Sequence(ObjectType)
    coordinates: Sequence(Coordinates)
    properMotions: ProperMotions  --? Sequence
    radialVelocitiesAndOrRedshift: RadialVelocitiesAndOrRedshift --? Sequence
    parallaxes: Parallaxes
    spectralType: SpectralType
    fluxes: Sequence(Fluxes)
    identifiers: Sequence (II)
    references: Sequence(References)
    collectionsOfMeasurements: CollectionOfMeasurements
    morphologicalType: MorphologicalType
    galaxyDimension: GalaxyDimension
    notes:ST
    observingLogs: Sequence(ObservingLogs)
    externalArchives: Sequence(ExternalArchive)
    annotations: ST
    literatureDerivedParameters: Sequence (LiteratureDerivedParameters)

  class ObjectType extends Any
    code: CD  -- eg IVOA 1.3 local
    condensedDesignation: CD -- http://simbad.u-strasbg.fr/simbad/sim-display?data=otypes
    standardName: ST
    extendedExplanation: ST

  class Coordinates extends Any
    system: CD --ICRS, Gal, FK4
    epoch: CD  --J2000,B1950
    eq: CD -- 1950
    ra: ST
    dec: ST
    wType: CD -- wavelength class: Rad, mm, IR, Optical, UV, Xray, Gam
    errorEllipse: ST
    quality: CD -- A,B,C,D,E
    bibCode: ST

  class ProperMotions extends Any
    pm_ra: PQ
    pm_dec: PQ
    errorEllipse: ST -- in degrees
    quality: CD --A, B, C, D, E, ~
    bibCode: ST

  class RadialVelocitiesAndOrRedshift extends Any
    value: PQ
    error: PQ
    wavelength: CD -- Rad, mm, IR, Opt, UV, Xray, Gam or  '~'(unknown)
    quality: CD --A, B, C, D, E, ~
    bibCode: ST

  class Parallaxes extends Any
    value: PQ
    error: PQ
    quality: CD -- A=best quality -> E=worst quality, ~ =unknown quality
    bibCode: ST

  class SpectralType extends Any
    value: ST
    spectralClass: CD
    luminosityClass: CD
    peculiarities: ST
    quality: CD -- A=best quality?E=worst quality, ~ =unknown quality
    bibCode: ST

   class Fluxes extends Any
    filterName: CD -- U, B, V, R, I, G, J, H, K, u, g, r, i, z
    system: CD -- Vega - default, AB
    fluxValue: Real
    error: Real
    quality: CD -- A=best quality -> E=worst quality, ~ =unknown quality
    multVarFlags: ST
    bibCode: ST

   class CollectionOfMeasurements extends Any
    velocities: Sequence(Velocities)
    fe_H: Sequence(Fe_H)
    distance: Sequence(Distance)
    plx: Sequence(PLX)
    rot: Sequence(ROT)
    pm: Sequence(PM)
    variableStar: Sequence(VariableStarMeasurements)

   class MorphologicalType extends Any
    mtype: CD -- Hubble morphological class (spirals, ellipticals, etc)
    quality: CD -- (A=best quality -> E=worst quality, ~ =unknown quality)
    bibcode: ST

   class GalaxyDimension  extends Any
   -- Syntax of angular size is : "maj-axis min-axis angle (wtype) quality bibcode"
    majAxis: PQ -- arc minutes
    minAxis: PQ -- arc minutes
    angle: PQ -- orientation angle in degrees
    incl: PQ -- inclination (in units of 15° from 0 to 7)
    wType: CD -- wavelength class for the origin of the angular size (Rad, mm, IR, Opt, UV, Xray, Gam)
    quality: CD -- flag of quality of the angular size values ( A=best quality -> E=worst quality, ~ =unknown quality)
    bibcode: ST

  class References extends Any
    date: TS
    firstAuthor: ST
    title: ST
    journal: ST
    url: ST
    doi: ST
    abstract: ST

  class Velocities extends Any
    vStar: PQ
    me: PQ
    reference: References

  class ROT extends Any
    vSini: Real
    error: Real
    mes: ST
    q: ST
    reference: References

  class Distance extends Any
    distance: PQ
    merr: PQ
    perr: PQ
    method: CD -- cep
    reference: References

  class Fe_H extends Any
    tEff: PQ
    log_g: Real
    fe_H: Real
    compStar: ST
    catNo: ST
    reference: References

  class PLX extends Any
    plx: PQ
    m_e: Real
    r: ST
    reference: References

  class PM extends Any
    pm_ra: PQ
    pm_ra_m_e: PQ
    pm_de: PQ
    pm_de_m_e: PQ
    syst: CD
    reference: References

  class VariableStarMeasurements extends Any
    varType: CD -- eg DCEP
    vMax: PQ -- mag
    p: ST
    vMin: PQ -- mag
    period: PQ --d
    d_RT: PQ -- %
    epoch: ST
    reference: References

  class ObservingLogs extends Any

  class ExternalArchive extends Any

  class LiteratureDerivedParameters extends Any
    luminosity: Luminosity
    mass: Mass
    metallicity: Metallicity
    radius: Radius
    tEff: TEff
    variabilityPeriod: VariabilityPeriod

  class Luminosity extends Any
    l: PQ
    minusError: PQ
    plusError: PQ
    reference: References

  class Mass extends Any
    m: PQ
    minusError: PQ
    plusError: PQ
    reference: References

  class Metallicity extends Any
    met: Real
    minusError: Real
    plusError: Real
    reference: References

  class Radius extends Any
    r: PQ
    minusError: PQ
    plusError: PQ
    reference: References

  class TEff extends Any
    t: PQ
    minusError: PQ
    plusError: PQ
    reference: References

  class VariabilityPeriod extends Any
    p: PQ
    minusError: PQ
    plusError: PQ
    reference: References

  class InfrastructureRoot extends Any
    sIMBADObjectObservations: Sequence(SIMBADObjectObservations)


EndPackage

Data

A xml file was created that accords with the model:

<?xml version="1.0" encoding="UTF-8"?>

<SIMBADObjectObservations     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:noNamespaceSchemaLocation="./iso-21090-datatypes.xsd">

        <designation value = "RV Tau" />
        <objectType>
            <code code="46612991"
                  codeSystem="2.16.840.1.113883.6.8"
                  codeSystemName="IOVA">
                  <displayName value = "RVTauri (AstrObject)" />
            </code>
            <condensedDesignation code="V*"
                                  codeSystem="2.16.840.1.113883.6.7"
                                  codeSystemName="SIMBAD">
                                  <displayName value = "V*" />
            </condensedDesignation>
            <standardName value = "V*" />
            <extendedExplanation value = "Variable Star of Mira Cet type" />
        </objectType>
         <otherObjectType>
            <condensedDesignation code="Wi*"
                                  codeSystem="2.16.840.1.113883.6.7"
                                  codeSystemName="SIMBAD">
                                  <displayName value = "WV*" />
            </condensedDesignation>
            <standardName value = "PulsV*RVTau" />
            <extendedExplanation value = "Variable Star of Mira Cet type" />
        </otherObjectType>
        <coordinates>
            <system code="ICRS"
                    codeSystem="Local_Coordinates"
                    codeSystemName="Local">
                    <displayName value = "International Celestial Reference System" />
            </system>
            <epoch code="J2000"
                   codeSystem="Local_Epoch"
                   codeSystemName="Local">
                   <displayName value = "Julian 2000 (2000011200)" />
            </epoch>
            <ra value = '04 47 06.7238218181' />
            <dec value = '+26 10 45.530144720' />
            <wType code="Opt"
                   codeSystem="Local_wType"
                   codeSystemName="Local">
                   <displayName value = "Optical" />
            </wType>
            <errorEllipse value = "0.0645 0.0365 90" />
            <quality code="A"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "A" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2018yCat.1345....0G"    />        
        </coordinates>
        <coordinates>
            <system code="FK4"
                    codeSystem="Local_Coordinates"
                    codeSystemName="Local">
                    <displayName value = "Fourth Fundamental Catalogue" />
            </system>
            <epoch code="B1950"
                   codeSystem="Local_Epoch"
                   codeSystemName="Local">
                   <displayName value = "Besellian 1950" />
            </epoch>
            <eq code="1950"
                   codeSystem="Local_Eq"
                   codeSystemName="Local">
                   <displayName value = "1950" />
            </eq>            
            <ra value = '04 44 01.9109548643' />
            <dec value = '+26 05 26.002025683' />
            <errorEllipse value = "0.0645 0.0365 90" />
        </coordinates>
        <coordinates>
            <system code="Gal"
                    codeSystem="Local_Coordinates"
                    codeSystemName="Local">
                    <displayName value = "Galactic" />
            </system>
            <epoch code="J2000"
                   codeSystem="Local_Epoch"
                   codeSystemName="Local">
                   <displayName value = "Julian 2000 (2000011200)" />
            </epoch>
            <ra value = '174.7738171895735' />
            <dec value = '-12.1901909775067' />
            <errorEllipse value = "0.0645 0.0365 90" />
        </coordinates>
        <properMotions>
            <pm_ra xsi:type = "PQ" value = "1.557" unit = "mas/yr" />
            <pm_dec xsi:type = "PQ" value = "-4.717" unit = "mas/yr" />
            <errorEllipse value = '1.546 1.104 90' />
            <quality code="A"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "A" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2016A%26A...595A...2G"    />    
        </properMotions>
        <radialVelocitiesAndOrRedshift>
            <value xsi:type = "PQ" value = "30.0" unit = "km/s" />
            <error xsi:type = "PQ" value = "2" unit = "km/s" />
            <quality code="E"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "E" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=1953GCRV..C......0W"    />                
        </radialVelocitiesAndOrRedshift>
        <parallaxes>
            <value xsi:type = "PQ" value = "0.6926" unit = "arcseconds" />
            <error xsi:type = "PQ" value = "0.0605" unit = "arcseconds" />
            <quality code="A"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "A" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2018yCat.1345....0G"    />    
        </parallaxes>
        <spectralType>
            <value value = 'K0' />
            <spectralClass code="K0"
                           codeSystem="Local_SpectralClass"
                           codeSystemName="Local">
                           <displayName value = "K0" />
            </spectralClass>
            <!-- why no luminosity class?  -->
            <luminosityClass code=""
                             codeSystem="Local_LuminosityClass"
                             codeSystemName="Local">
                             <displayName value = "" />
            </luminosityClass>
            <quality code="E"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "E" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=1995A%26AS..110..367N"    />    
        </spectralType>
        <fluxes>
            <filterName code="B"
                        codeSystem="Local_FilterName"
                        codeSystemName="Local">
                        <displayName value = "B" />
            </filterName>
            <system code="Vega"
                    codeSystem="Local_FilterName"
                    codeSystemName="Local">
                    <displayName value = "Vega" />
            </system>
            <fluxValue xsi:type = "Real" value = "11.00" />
            <error xsi:type = "Real" value = "0.10" />
            <quality code="D"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "D" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2000A%26A...355L..27H"    />    
        </fluxes>
        <fluxes>
            <filterName code="V"
                        codeSystem="Local_FilterName"
                        codeSystemName="Local">
                        <displayName value = "V" />
            </filterName>
            <system code="Vega"
                    codeSystem="Local_FilterName"
                    codeSystemName="Local">
                    <displayName value = "Vega" />
            </system>
            <fluxValue xsi:type = "Real" value = "9.8" />
            <quality code="C"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "C" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2002yCat.2237....0D"    />    
        </fluxes>
        <fluxes>
            <filterName code="G"
                        codeSystem="Local_FilterName"
                        codeSystemName="Local">
                        <displayName value = "G" />
            </filterName>
            <system code="Vega"
                    codeSystem="Local_FilterName"
                    codeSystemName="Local">
                    <displayName value = "Vega" />
            </system>
            <fluxValue xsi:type = "Real" value = "9.2887" />
            <error xsi:type = "Real" value = "0.0195" />
            <quality code="C"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "C" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2018yCat.1345....0G"    />    
        </fluxes>
        <fluxes>
            <filterName code="J"
                        codeSystem="Local_FilterName"
                        codeSystemName="Local">
                        <displayName value = "J" />
            </filterName>
            <system code="Vega"
                    codeSystem="Local_FilterName"
                    codeSystemName="Local">
                    <displayName value = "Vega" />
            </system>
            <fluxValue xsi:type = "Real" value = "6.183" />
            <error xsi:type = "Real" value = "0.020" />
            <quality code="C"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "C" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2003yCat.2246....0C"    />    
        </fluxes>
        <fluxes>
            <filterName code="H"
                        codeSystem="Local_FilterName"
                        codeSystemName="Local">
                        <displayName value = "V" />
            </filterName>
            <system code="Vega"
                    codeSystem="Local_FilterName"
                    codeSystemName="Local">
                    <displayName value = "Vega" />
            </system>
            <fluxValue xsi:type = "Real" value = "5.488" />
            <error xsi:type = "Real" value = "0.020" />
            <quality code="C"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "C" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2003yCat.2246....0C"    />    
        </fluxes>
        <fluxes>
            <filterName code="K"
                        codeSystem="Local_FilterName"
                        codeSystemName="Local">
                        <displayName value = "K" />
            </filterName>
            <system code="Vega"
                    codeSystem="Local_FilterName"
                    codeSystemName="Local">
                    <displayName value = "Vega" />
            </system>
            <fluxValue xsi:type = "Real" value = "4.777" />
            <error xsi:type = "Real" value = "0.018" />
            <quality code="C"
                     codeSystem="Local_Quality"
                     codeSystemName="Local">
                     <displayName value = "C" />
            </quality>
            <bibCode value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2003yCat.2246....0C"    />    
        </fluxes>
        <identifiers root="HD" extension="283868" />
        <identifiers root="AG+" extension="+26 443" />
        <identifiers root="AN" extension="45.1905" />
        <identifiers root="ASAS" extension="J044707+2610.7" />
        <identifiers root="BD+" extension="+25 732" />
        <identifiers root="Elia" extension="3-20" />
        <identifiers root="GCRV" extension="2803" />
        <identifiers root="GSC2" extension="N301132129" />
        <identifiers root="GSC" extension="01835-01075" />
        <identifiers root="IRAS" extension="04440+2605" />
        <identifiers root="2MASS" extension="J04470673+2610455" />
        <identifiers root="PPM" extension="93762" />
        <identifiers root="TIC" extension="59838803" />
        <identifiers root="TYC" extension="1835-1075-1" />
        <identifiers root="V*" extension="RV Tau" />
        <identifiers root="WEB" extension="4279" />
        <identifiers root="WISE" extension="J044706.73+261045.5" />
        <identifiers root="WISE" extension="J044706.74+261045.7" />
        <identifiers root="[WWV2004]" extension="J0447067+261046" />
        <identifiers root="AAVSO" extension="0441+26" />
        <identifiers root="Gaia" extension="DR1 154255571501975936" />
        <identifiers root="Gaia" extension="DR2 154255575798532096" />
        <references></references>
        <collectionsOfMeasurements>
            <velocities>
                <vStar xsi:type = "PQ" value = "30.0" unit = "km/s" />
                <reference>
                    <date xsi:type = "TS" value = "2013" />
                    <firstAuthor value = "Mooley K" />
                    <title value = "B- and A-type stars in the Taurus-Auriga star-forming region." />
                    <journal value = "Astrophys. J." />
                    <url value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2013ApJ...771..110M" />
                </reference>
            </velocities>
            <fe_H></fe_H>
            <distance>
                <distance xsi:type = "PQ" value = "1443.8348" unit = "pc" />
                <merr xsi:type = "PQ" value = "126.1219" unit = "pc" />
                <perr xsi:type = "PQ" value = "126.1219" unit = "pc" />
                <method code="paral"
                        codeSystem="Local_Method"
                        codeSystemName="Local">
                        <displayName value = "paral" />
                </method>
                <reference>
                    <date xsi:type = "TS" value = "2018" />
                    <firstAuthor value = "GAIA COLLABORATION" />
                    <title value = "GAIA DR2" />
                    <journal value = "CDS/ADC Collection of Electronic Catalogues" />
                    <url value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2018yCat.1345....0G" />
                </reference> 
            </distance>
            <plx>
                <plx xsi:type = "PQ" value = "0.6926" unit = "arcseconds" />
                <m_e xsi:type = "Real" value = "0.0605" />
                <reference>
                    <date xsi:type = "TS" value = "2018" />
                    <firstAuthor value = "GAIA COLLABORATION" />
                    <title value = "GAIA DR2" />
                    <journal value = "CDS/ADC Collection of Electronic Catalogues" />
                    <url value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2018yCat.1345....0G" />
                </reference> 
            </plx>
            <plx>
                <plx xsi:type = "PQ" value = "1.210" unit = "arcseconds" />
                <m_e xsi:type = "Real" value = "0.360" />
                <reference>
                    <date xsi:type = "TS" value = "2016" />
                    <firstAuthor value = "GAIA COLLABORATION" />
                    <title value = "Gaia Data Release 1. Summary of the astrometric, photometric, and survey properties." />
                    <journal value = "Astronomy and Astrophysics" />
                    <url value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2016A%26A...595A...2G" />
                </reference> 
            </plx>
            <rot></rot>
            <pm></pm>
            <variableStar>
                <varType code="M"
                         codeSystem="Local_VarType"
                         codeSystemName="Local">
                         <displayName value = "M" />
                </varType>
                <vMax xsi:type = "PQ" value = "8.9585" unit = "mag" />
                <p  value = "R" />
                <vMin xsi:type = "PQ" value = "9.9695" unit = "mag" />
                <period xsi:type = "PQ" value = "236" unit = "d" />
                <reference>
                    <date xsi:type = "TS" value = "2004" />
                    <firstAuthor value = "Wozniak S,J" />
                    <title value = "Identifying red variables in the Northern Sky Variability Survey." />
                    <journal value = "Astron. J." />
                    <url value = "http://simbad.u-strasbg.fr/simbad/sim-ref?bibcode=2004AJ....128.2965W" />
                </reference> 
            </variableStar>
        </collectionsOfMeasurements>
        <literatureDerivedParameters>
            <luminosity>
                <l xsi:type = "PQ" value = "2800" unit = "Lsun" />
                <reference>
                    <date xsi:type = "TS" value = "201908" />
                    <firstAuthor value = "Manick R" />
                    <title value = "Spectroscopic binaries RV Tauri and DF Cygni" />
                    <journal value = "Astronomy and Astrophysics." />
                    <url value = "https://www.aanda.org/articles/aa/full_html/2019/08/aa34956-18/aa34956-18.html" />
                </reference> 
            </luminosity>
            <mass>
                <m xsi:type = "PQ" value = "0.53" unit = "Msun" />
                <reference>
                    <date xsi:type = "TS" value = "201908" />
                    <firstAuthor value = "Manick R" />
                    <title value = "Spectroscopic binaries RV Tauri and DF Cygni" />
                    <journal value = "Astronomy and Astrophysics." />
                    <url value = "https://www.aanda.org/articles/aa/full_html/2019/08/aa34956-18/aa34956-18.html" />
                </reference> 
            </mass>
            <metallicity>
                <met xsi:type = "Real" value = "-0.3"  />
                <minusError xsi:type = "Real" value = "0.2"  />
                <plusError xsi:type = "Real" value = "0.2"  />
                <reference>
                    <date xsi:type = "TS" value = "201908" />
                    <firstAuthor value = "Manick R" />
                    <title value = "Spectroscopic binaries RV Tauri and DF Cygni" />
                    <journal value = "Astronomy and Astrophysics." />
                    <url value = "https://www.aanda.org/articles/aa/full_html/2019/08/aa34956-18/aa34956-18.html" />
                </reference> 
            </metallicity>
            <tEff>
                <t xsi:type = "PQ" value = "4810" unit = "K" />
                <minusError xsi:type = "PQ" value = "200" unit = "K" />
                <plusError xsi:type = "PQ" value = "200" unit = "K" />
                <reference>
                    <date xsi:type = "TS" value = "201908" />
                    <firstAuthor value = "Manick R" />
                    <title value = "Spectroscopic binaries RV Tauri and DF Cygni" />
                    <journal value = "Astronomy and Astrophysics." />
                    <url value = "https://www.aanda.org/articles/aa/full_html/2019/08/aa34956-18/aa34956-18.html" />
                </reference> 
            </tEff>
        </literatureDerivedParameters>
</SIMBADObjectObservations>


<objectType> is a terminology binding to the IVOA Ontology (with local randomly generated and unique codes).


GELLO

Have we an instance of a Type II Cepheid variable and what subtype is it?

Imports SIMBADObjectPackage, IVOALib --, AstroLib
Context SIMBADObjectObservations

Let observedStar: SIMBADObjectObservations = Self


-- is Type II Cepheid and what subclass?
-- Type II cepheids are pop II stars, metal poor, old, masses < 0.5 MSun, periods determine subclass
-- -------------------- ------------ -------------- ------------- ---------- ------ ----- ------------
-- | TypeIICep subclass| Supergiant?| SpectralClass| Teff{K)     | period(d)| Lum  | Mass| Metallicity|
-- -------------------- ------------ -------------- ------------- ---------- ------ ----- ------------
-- | RV Tauri          |     Y      | G - K        | 4100 - 6000 |  > 20    | high | low |    low     |
-- | W Vir             |     N      | F6 - K2      | 4900 - 6200 |  10 - 20 |      | low |    low     |
-- | BL Her            |     N      | varies       |             |  1 - 4   | low  | low |    low     |
-- -------------------- ------------ -------------- ------------- ---------- ------ ----- ------------
Let observedVarPeriod: PQ = If observedStar.collectionsOfMeasurements.variableStar.first().period.oclIsDefined() then
                            observedStar.collectionsOfMeasurements.variableStar->sortedBy(r|r.reference.date).last().period
                           else null
                          endif
Let observedTeff: PQ = If observedStar.collectionsOfMeasurements.fe_H.first().tEff.oclIsDefined() then
                         observedStar.collectionsOfMeasurements.fe_H->sortedBy(r|r.reference.date).last().tEff
                        else null
                       endif
Let observedFe_H: Real = If observedStar.collectionsOfMeasurements.fe_H.first().fe_H.oclIsDefined() then
                           observedStar.collectionsOfMeasurements.fe_H->sortedBy(r|r.reference.date).last().fe_H
                          else null
                         endif
Let observedStarLumClass:CD = observedStar.spectralType.luminosityClass  -- use fluxes?
Let litCalculatedMass: PQ = If observedStar.literatureDerivedParameters.mass.first().m.oclIsDefined() then
                           observedStar.literatureDerivedParameters.mass->sortedBy(r|r.reference.date).last().m
                          else null
                         endif
Let lit_Luminosity: PQ = If observedStar.literatureDerivedParameters.luminosity.first().l.oclIsDefined() then
                           observedStar.literatureDerivedParameters.luminosity->sortedBy(r|r.reference.date).last().l
                          else null
                         endif
Let lit_Metallicity: Real = If observedStar.literatureDerivedParameters.metallicity.first().met.oclIsDefined() then
                              observedStar.literatureDerivedParameters.metallicity->sortedBy(r|r.reference.date).last().met
                             else null
                            endif
Let lit_TEff: PQ = If observedStar.literatureDerivedParameters.tEff.first().t.oclIsDefined() then
                              observedStar.literatureDerivedParameters.tEff->sortedBy(r|r.reference.date).last().t
                             else null
                            endif
Let lit_VarPeriod: PQ = If observedStar.literatureDerivedParameters.variabilityPeriod.first().p.oclIsDefined() then
                              observedStar.literatureDerivedParameters.variabilityPeriod->sortedBy(r|r.reference.date).last().p
                             else null
                            endif
--get best parameter values where needed
Let metallicityBest: Real = If observedFe_H.oclIsDefined() then observedFe_H else
                            If lit_Metallicity.oclIsDefined() then lit_Metallicity else
                            null endif endif
Let varPeriodBest: PQ = If observedVarPeriod.oclIsDefined() then observedVarPeriod else
                            If lit_VarPeriod.oclIsDefined() then lit_VarPeriod else
                            null endif endif
Let tEffBest: PQ = If observedTeff.oclIsDefined() then observedTeff else
                            If lit_TEff.oclIsDefined() then lit_TEff else
                            null endif endif
--Type II Cepheid query
Let isLowMass: Boolean = litCalculatedMass < PQ{value = 0.6, unit = "Msun"}
Let isMetalPoor: Boolean = metallicityBest < 0.05
Let isVariable: Boolean = varPeriodBest.oclIsDefined()
Let isTypeIICepheid: Boolean = isLowMass and isMetalPoor and isVariable
-- is Supergiant?
Let childIVOAConcept: CD = observedStar.objectType.code
Let parentIVOAConcept:CD = CD{code = '81261979', displayName = ST{value='SuperGiant'}, codeSystem = 'IVOA'}
Let isSuperGiant: Boolean = IVOAImplies(childIVOAConcept, parentIVOAConcept)

--Determine subclass If Type II cepheid variable
Let subclass: String =
  If isTypeIICepheid and varPeriodBest > PQ{value=20,unit='d'}
     and isSuperGiant and lit_Luminosity > PQ{value=1000,unit='Lsun'}
      and tEffBest > PQ{value=4100,unit='K'} and tEffBest < PQ{value=6000,unit='K'}
       then 'RV Tauri subclass' else
     if isTypeIICepheid and varPeriodBest > PQ{value=10,unit='d'} and varPeriodBest <= PQ{value=20,unit='d'}
        and tEffBest > PQ{value=4900,unit='K'} and tEffBest < PQ{value=6200,unit='K'}
         then 'W Vir subclass' else
        If isTypeIICepheid and varPeriodBest < PQ{value=4,unit='d'} and lit_Luminosity < PQ{value=1000,unit='Lsun'}
         then 'BL Her' else
      null endif endif endif
----
subclass

Here is the result:




  • No labels