ONSdigital / application-profile

Other
7 stars 3 forks source link

Component Problems #15

Closed robons closed 1 year ago

robons commented 1 year ago

Fundamental Misunderstanding of Components

The 'components' discussed in the components section are actually the component's properties. There is some misunderstanding in the document as to what a component is. See the DSD section in the spec for more information.

Components have the order, not the component properties

See Example 4 in the the DSD section in the spec. It's the components which have the order, not the component properties. In example 4 we see that the component properties (the dimensions are things like eg:refArea), but it's the component itself which has the qb:order triple.

eg:dsd-le a qb:DataStructureDefinition;
    # The dimensions
    qb:component [ qb:dimension eg:refArea;         qb:order 1 ];
    qb:component [ qb:dimension eg:refPeriod;       qb:order 2 ];
    qb:component [ qb:dimension sdmx-dimension:sex; qb:order 3 ];
    # The measure(s)
    qb:component [ qb:measure eg:lifeExpectancy];
    # The attributes
    qb:component [ qb:attribute sdmx-attribute:unitMeasure; 
                   qb:componentRequired "true"^^xsd:boolean;
                   qb:componentAttachment qb:DataSet; ] .

Dimension can't have string range and a code list

As per the spec:

Example 15

eg:sex a qb:DimensionProperty, qb:CodedProperty;
   qb:codeList sdmx-code:sex ;
   rdfs:range sdmx-code:Sex .

https://www.w3.org/TR/vocab-data-cube/#h3_schemes-intro

The following RDF contained in the application profile is incorrect as it declares an inappropriate range given it has a code list:

ex:dimension1 a qb:DimensionProperty ;
    rdfs:label "Dimension 1"@en ;
    rdfs:comment "A dimension property"@en ;
    rdfs:range xsd:string ;
    qb:codeList <http://data.gov.uk/codelist/some-codelist> ;
    qb:order 2 ;
    .
rossbowen commented 1 year ago

Cheers, qb:order was a quick addition and I didn't take enough care adding it rather than it being a fundamental misunderstanding. Hopefully corrected that now, added a section on the data structure definition, the component specification (which has qb:order) and then the component properties themselves.

Have swapped out the range.