RDF Data Cube uses property as object?

362 views Asked by At

as i read the RDF Data Cube Vocabulary document, one thing confuses me: MeasureProperties (in the following example I use eg:lifeExpectancy are first defined as properties. however, when defining the data structure they are used as objects. is this allowed? please see the following example taken directly from the specification document.

so, first the MeasureProperty itself gets defined as an rdf:property. see the following example of eg:lifeExpectancy:

eg:lifeExpectancy  a rdf:Property, qb:MeasureProperty;
    rdfs:label "life expectancy"@en;
    rdfs:subPropertyOf sdmx-measure:obsValue;
    rdfs:range xsd:decimal . 

later, this MeasureProperty is used to define a data structure:

eg:dsd-le a qb:DataStructureDefinition;
    # The dimensions
    [...]
    # The measure(s)
    qb:component [ qb:measure eg:lifeExpectancy];
    # The attributes
    [...]

as you can see eg:lifeExpectancy here is used as an object, which shouldn't be allowed, since it is a property?! or am I thinking wrong?

later, when actually expressing the observations, eg:lifeExpectancy is us as a property:

eg:o1 a qb:Observation;
    qb:dataSet  eg:dataset-le1 ;
    eg:refArea                 ex-geo:newport_00pr ;                  
    sdmx-dimension:sex         sdmx-code:sex-M ;
    sdmx-attribute:unitMeasure <http://dbpedia.org/resource/Year> ;
    eg:lifeExpectancy          76.7 ;
    .

how is it possible/allowed to use eg:lifeExpectancy as an object, as it is done in the qb:DataStructureDefinition above?

1

There are 1 answers

4
Joshua Taylor On BEST ANSWER

The key is in the document that you linked to:

6. Creating data structure definitions

A qb:DataStructureDefinition defines the structure of one or more datasets. In particular, it defines the dimensions, attributes and measures used in the dataset along with qualifying information such as ordering of dimensions and whether attributes are required or optional.

The whole example that you've shown us a part of is:

EXAMPLE 4

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; ] .

eg:dsd-le is a data structure definition, and there are five components to it. Recall that the structure of the dataset was:

life expectancy dataset

You can see that it takes three dimensions to index an individual cell. You need the date range (e.g., 2005–2007), the area (e.g., Cardiff), and a sex (e.g., Male). The values in those cells are life expectancy values; i.e., the each value is a eb:lifeExpectancy of something. That's what qb:component [ qb:measure eg:lifeExpectancy ] is telling us.


Other uses of properties in non-property positions

This section is a bit more commentary on use of properties as subjects and objects in triples. RDF doesn't make much distinction about the roles that resources can play in triples. Subjects of triples can be IRIs and blank nodes; properties of triples can only be IRIs; and objects of triples can IRIs, blank nodes, or literals. In RDF triples, you'll often need to use IRIs that are typically used a properties as objects or subjects in order to describe them. E.g,:

# :hasParent used as property
:isaac :hasParent :abraham .

# :hasParent used as subject
:hasParent rdfs:label "has father"@en ;
           rdfs:comment "used to indicate that the object is a parent of the subject"@en ;
           rdf:type :FamilialRelationship .

# :hasParent used as object
:hasChild owl:inverseOf :hasParent .

Your specific example

Different uses of the property, in general RDF

It's worth looking at what's actually happening in the example you mention. In the first:

eg:lifeExpectancy  a rdf:Property, qb:MeasureProperty;
  … .

qb:MeasureProperty actually appears as the object of a triple:

eg:lifeExpectancy rdf:type qb:MeasureProperty

which means that qb:MeasureProperty is a class. As its name suggests, it's a class of properties. I.e., when you see x rdf:type qb:MeasureProperty, you can expect to see x used in other triples a property. eg:lifeExpectancy, then, is a property, though in this triple it is a subject. Later on, we see the triple

eg:o1 eg:lifeExpectancy 76.7 .

in which eg:lifeExpectancy is used as property.

Different uses of the property for RDF Data Cube