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?
The key is in the document that you linked to:
The whole example that you've shown us a part of is:
eg:dsd-le is a data structure definition, and there are five components to it. Recall that the structure of the dataset was:
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,:
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:
qb:MeasureProperty actually appears as the object of a triple:
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
in which eg:lifeExpectancy is used as property.
Different uses of the property for RDF Data Cube