/// For some of our types, we want fields that are defined in remote specs
/// and not in our local spec (even though our local spec can "add on"
/// fields to the remote types. This is where we define our extra fields on
/// a per-type basis.
For some of our types, we want fields that are defined in remote specs
and not in our local spec (even though our local spec can "add on"
fields to the remote types. This is where we define our extra fields on
a per-type basis.
For some of our types we want fields that are defined in remote specs and not in our local spec ( even though our local spec can " add on " fields to the remote types . This is where we define our extra fields on a per - type basis .
fn extra_fields(&self) -> Vec<Field> {
        match self {
            DataType::SpatialThing => {
                vec![
                    Field::new(
                            "http://www.w3.org/2003/01/geo/wgs84_pos#lat",
                            "lat",
                            &DataType::Double,
                            Some("The WGS84 latitude of a SpatialThing (decimal degrees)."),
                            Some(false),
                            Some(false),
                    ),
                    Field::new(
                            "http://www.w3.org/2003/01/geo/wgs84_pos#long",
                            "long",
                            &DataType::Double,
                            Some("The WGS84 longitude of a SpatialThing (decimal degrees)."),
                            Some(false),
                            Some(false),
                    ),
                    Field::new(
                            "http://www.w3.org/2003/01/geo/wgs84_pos#alt",
                            "alt",
                            &DataType::Double,
                            Some("The WGS84 altitude of a SpatialThing (decimal meters above the local reference ellipsoid)."),
                            Some(false),
                            Some(false),
                    ),
                ]
            }
            DataType::ProductBatch => {
                vec![
                    Field::new(
                            "http://www.virtual-assembly.org/DataFoodConsortium/BusinessOntology#batchNumber",
                            "batch_number",
                            &DataType::String,
                            None,
                            Some(false),
                            Some(true),
                    ),
                    Field::new(
                            "http://www.virtual-assembly.org/DataFoodConsortium/BusinessOntology#expiryDate",
                            "expiry_date",
                            &DataType::DateTime,
                            None,
                            Some(false),
                            Some(false),
                    ),
                    Field::new(
                            "http://www.virtual-assembly.org/DataFoodConsortium/BusinessOntology#productionDate",
                            "production_date",
                            &DataType::DateTime,
                            None,
                            Some(false),
                            Some(false),
                    ),
                ]
            }
            _ => vec![]
        }
    }
fn extra_fields ( & self ) -> Vec < Field > { match self { DataType :: SpatialThing => { vec ! [ Field new ( " " " " DataType Double Some ( " " ) Some ( false ) Some ( false ) ) Field new ( " " " " DataType Double Some ( " " ) Some ( false ) Some ( false ) ) Field new ( " " " " DataType Double Some ( " " ) Some ( false ) Some ( false ) ) ] } DataType :: ProductBatch => { vec ! [ Field new ( " " " " DataType String None Some ( false ) Some ( true ) ) Field new ( " " " " DataType DateTime None Some ( false ) Some ( false ) ) Field new ( " " " " DataType DateTime None Some ( false ) Some ( false ) ) ] } _ => vec ! [ ] } }
For some of our types, we want fields that are defined in remote specs
and not in our local spec (even though our local spec can "add on"
fields to the remote types.
For some of our types we want fields that are defined in remote specs and not in our local spec ( even though our local spec can " add on " fields to the remote types .
&self