DAP4 Attribute Model

From OPeNDAP Documentation
Revision as of 21:07, 21 January 2009 by Ndp (talk | contribs) (New page: === dap:Attribute === I think we need to rethink the XML representation of dap:Attribute. Right now we have one XML type, da:Attrbute, which has an xml attribute named type that controls ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
⧼opendap2-jumptonavigation⧽

dap:Attribute

I think we need to rethink the XML representation of dap:Attribute. Right now we have one XML type, da:Attrbute, which has an xml attribute named type that controls the "type" of the dap:Attribute. Each value of "type" implies different semantics, content and possibly different structure for an instance of dap:Attribute. This reflects the Java (and possibly C++) implementations of the DAP.

I think it's a bad thing. ndp

jimg 15:23, 17 January 2009 (PST) Why?

Well, I don't think it's a bad thing that it mimics the java and C++ implementations. It's a bad thing that they are in fact different types, and yet we treat them bundle them as a single type whose semantics are a function of the type attributes value. My thinking is that we should just explicitly represent them as individual types. I think that would improve the XML representation of them. I don't think it means that the C++ or Java implementations need to be re-factored (beyond what it would take to support the different XML representation) ndp 21:53, 20 January 2009 (PST)

Whe should consider make each Attribute type it's own "class":

  • <AttByte /> - Holds a Byte valued Attribute.
  • <AttInt16 /> - Holds a 16 bit integer valued Attribute.
  • <AttUInt16 /> - Holds an unsigned 16 bit integer valued Attribute.
  • <AttInt32 /> - Holds a 32 bit integer valued Attribute.
  • <AttUInt32 /> - Holds an unsigned 32 bit integer valued Attribute.
  • <AttFloat32 /> - Holds a 32 bit floating point valued Attribute.
  • <AttFloat64 /> - Holds a 64 bit floating point valued Attribute.
  • <AttString /> - Holds a String valued Attribute.
  • <AttURL /> - Holds a URL valued Attribute.
  • <AttContainer /> - Holds a Container Attribute.

I think this will make for a much better XML representation. One in which we can more effectively use an XML schema to clearly define the content model. jimg 15:23, 17 January 2009 (PST) Again, Why?

Of course, the next logical step is probably to dump the concept of: Attributes all together.

DAP QUESTION: What is the difference between Attributes and DAP variables?
  • Is it that Attributes get sent along with the syntactic (structural) metadata description? jimg 15:22, 17 January 2009 (PST) Do you mean 'that attribute values get sent along with the syntactic metadata? Ans: No, Attributes are labeled as such because the person who built the dataset labeled some of the information as variable and some as attributes where the latter describe the former. Is the distinction arbitrary? Yes, at some level, but by preserving the distinction in DAP we are avoiding loosing it when the dataset is viewed by a remote client. BTW, the Attribute values are not part of the syntactic metadata in the DAS/DDS, on in the DDX.
  • Is it that they cannot be constrained? jimg 15:22, 17 January 2009 (PST) It's true that they cannot be constrained and that the values are present, but the most important distinction is the fidelity of representation; they are attributes in the dataset so they are attributes in the DAP representation of the dataset, too.

In the DDX we end up sending all of the Attributes in the DataDDX. Is that really what we want? jimg 15:40, 17 January 2009 (PST) Yes, I want each of the responses to be complete. I think it's a worthwhile concession to make to transport some information twice.


ndp 09:18, 21 January 2009 (PST)
Another way to look at this might be to simply create another namespace for Attributes.

For example:

  • <att:Byte /> - Holds a Byte valued Attribute.
  • <att:Int16 /> - Holds a 16 bit integer valued Attribute.
  • <att:UInt16 /> - Holds an unsigned 16 bit integer valued Attribute.
  • <att:Int32 /> - Holds a 32 bit integer valued Attribute.
  • <att:UInt32 /> - Holds an unsigned 32 bit integer valued Attribute.
  • <att:Float32 /> - Holds a 32 bit floating point valued Attribute.
  • <att:Float64 /> - Holds a 64 bit floating point valued Attribute.
  • <att:String /> - Holds a String valued Attribute.
  • <att:URL /> - Holds a URL valued Attribute.
  • <att:Container /> - Holds a Container Attribute.
  • <att:XML /> - Holds any XML and identifies it as an Attribute. (Assuming we want to wrap foreign XML in an Attribute tag)

This is interesting because the syntactic information is easily separable from the semantic using the namespaces and the Attributes really become the things that they represent (classes and values)
ndp 09:18, 21 January 2009 (PST)


Source XML

<?xml version="1.0" encoding="UTF-8"?>
<Dataset name="200803061600_HFRadar_USEGC_6km_rtv_SIO.nc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xml.opendap.org/ns/DAP2"
xsi:schemaLocation="http://xml.opendap.org/ns/DAP2  http://xml.opendap.org/dap/dap2.xsd">



  <Attribute name="wcsStuff" type="xml" >
    <CoverageDescription xmlns="http://www.opengis.net/wcs/1.1" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:owcs="http://www.opengis.net/wcs/1.1/ows" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:schemaLocation="http://www.opengis.net/wcs/1.1  http://schemas.opengis.net/wcs/1.1.0/wcsDescribeCoverage.xsd  http://www.opengis.net/ows/1.1  http://schemas.opengis.net/ows/1.1.0/owsAll.xsd  http://www.opengis.net/wcs/1.1/ows http://schemas.opengis.net/wcs/1.1.0/owsDataIdentification.xsd http://www.opengis.net/gml/3.2  http://schemas.opengis.net/gml/3.2.1/gml.xsd">
        <ows:Title>Near-Real Time Surface Ocean Velocity</ows:Title>
        <ows:Abstract>CoverageDescription generated by OPeNDAP WCS UseCase 2.0</ows:Abstract>
        <Identifier>coverage/200803061600_HFRadar_USEGC_6km_rtv_SIO.nc</Identifier>
        <Domain>
            <SpatialDomain>
                <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::4326">
                    <ows:LowerCorner>-97.8839 21.736</ows:LowerCorner>
                    <ows:UpperCorner>-57.2312 46.4944</ows:UpperCorner>
                </ows:BoundingBox>
            </SpatialDomain>
            <TemporalDomain>
                <gml:timePosition>2008-03-27T16:00:00.000Z</gml:timePosition>
            </TemporalDomain>
        </Domain>
        <Range>
        </Range>
        <SupportedCRS>urn:ogc:def:crs:EPSG::4326</SupportedCRS>
        <SupportedFormat>netcdf-cf1.0</SupportedFormat>
        <SupportedFormat>dap2.0</SupportedFormat>
    </CoverageDescription>

    <CoverageSummary xmlns="http://www.opengis.net/wcs/1.1" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:owcs="http://www.opengis.net/wcs/1.1/ows" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:schemaLocation="http://www.opengis.net/wcs/1.1  http://schemas.opengis.net/wcs/1.1.0/wcsDescribeCoverage.xsd  http://www.opengis.net/ows/1.1  http://schemas.opengis.net/ows/1.1.0/owsAll.xsd  http://www.opengis.net/wcs/1.1/ows http://schemas.opengis.net/wcs/1.1.0/owsDataIdentification.xsd http://www.opengis.net/gml/3.2  http://schemas.opengis.net/gml/3.2.1/gml.xsd">
       <ows:Title>6km HF Radar data</ows:Title>
       <ows:Abstract>A test dataset for use developing WCS services.</ows:Abstract>
       <ows:Metadata xlink:href="http://ndp.opendap:8080/opendap/coverage/200803061600_HFRadar_USEGC_6km_rtv_SIO.nc.das"/>
       <ows:WGS84BoundingBox>
          <ows:LowerCorner>-97.8839 21.736</ows:LowerCorner>
          <ows:UpperCorner>-57.2312 46.4944</ows:UpperCorner>
       </ows:WGS84BoundingBox>
       <Identifier>coverage/200803061600_HFRadar_USEGC_6km_rtv_SIO.nc</Identifier>
    </CoverageSummary>
  </Attribute>

    <Attribute name="NC_GLOBAL" type="Container">
        <Attribute name="title" type="String">
            <value>Near-Real Time Surface Ocean Velocity</value>
        </Attribute>
        <Attribute name="institution" type="String">
            <value>Scripps Institution of Oceanography</value>
        </Attribute>
        <Attribute name="source" type="String">
            <value>Surface Ocean HF-Radar</value>
        </Attribute>
        <Attribute name="history" type="String">
            <value>12-Mar-2008 22:26:19:  NetCDF file created</value>
        </Attribute>
        <Attribute name="references" type="String">
            <value>Terrill, E. et al., 2006. Data Management and Real-time\\012Distribution in the HF-Radar National Network. Proceedings\\012of the MTS/IEEE Oceans 2006 Conference, Boston MA,\\012September 2006.</value>
        </Attribute>
    </Attribute>

    <Grid name="u">
      <Attribute name="wcsStuff" type="xml" >
        <Field>
            <ows:Title>surface_eastward_sea_water_velocity</ows:Title>
            <ows:Abstract>Eastward component of a 2D sea surface velocity vector.</ows:Abstract>
            <Identifier>u</Identifier>
            <Definition>
                <ows:AnyValue/>
            </Definition>
            <NullValue>-32768</NullValue>
            <owcs:InterpolationMethods>
                <owcs:DefaultMethod>nearest</owcs:DefaultMethod>
            </owcs:InterpolationMethods>
        </Field>
      </Attribute>
        <Attribute name="standard_name" type="String">
            <value>surface_eastward_sea_water_velocity</value>
        </Attribute>
        <Attribute name="units" type="String">
            <value>m s-1</value>
        </Attribute>
        <Attribute name="_FillValue" type="Int16">
            <value>-32768</value>
        </Attribute>
        <Attribute name="scale_factor" type="Float32">
            <value>0.009999999776</value>
        </Attribute>
        <Attribute name="ancillary_variables" type="String">
            <value>DOPx</value>
        </Attribute>
        <Array name="u">
            <Int16/>
            <dimension name="time" size="1"/>
            <dimension name="lat" size="460"/>
            <dimension name="lon" size="701"/>
        </Array>
        <Map name="time">
            <Int32/>
            <dimension name="time" size="1"/>
        </Map>
        <Map name="lat">
            <Float32/>
            <dimension name="lat" size="460"/>
        </Map>
        <Map name="lon">
            <Float32/>
            <dimension name="lon" size="701"/>
        </Map>
    </Grid>

    <dataBLOB href=""/>
</Dataset>