- From: Danny Ayers <danny.ayers@gmail.com>
- Date: Tue, 19 Jan 2010 01:04:21 +0100
- To: Kjetil Kjernsmo <kjetil@kjernsmo.net>
- Cc: semantic-web@w3.org
2010/1/18 Kjetil Kjernsmo <kjetil@kjernsmo.net>:
> On Monday 18. January 2010 18:57:37 Danny Ayers wrote:
>> and the ESW Wiki page which has unit-specific examples:
>>
>> http://esw.w3.org/topic/InterpretationProperties
>>
>> (note in particular the "train wreck" mentioned there - an easy trap
>> to fall into)
>
> Yep, but that page is several years old, and I've seen very little uptake,
> and I tend to think it is because it is too complex. It is not sufficient
> to say that "it can be done", it has be done in a way that people can live
> with. That's why I think this needs attention in RDF 1.1 or 2.0.
I can't see how it could be much simpler.
> I'll just throw something out there:
> @prefix : <http://example.org/> .
> @prefix u: <http://example.org/units> .
>
> :foo :weighs "15"¤u:kg .
> :bar :weighs "20"¤u:lb .
>
> where the ¤ character is used to say the literal has a unit, and expect a
> query like
>
> SELECT sum(?weight) AS ?totalweight¤u:kg
> WHERE {
> ?var :weighs ?weight .
> }
>
> and
>
> SELECT ?weight
> WHERE {
> ?var :weighs ?weight .
> FILTER (?weight > "10"¤u:kg)
> }
>
> and expect that to do the right thing (i.e. 24.07 kg and 15 kg).
>
> It would require some arithmetic on the query engine, but it can't be all
> that difficult, can it?
Why not -
:foo u:kg "15" .
:bar u:lb "20" .
There's still the issue of arithmetic, but something like this, maybe -
SELECT sum(?kgweight + 2.2*?lbweight)
WHERE {
OPTIONAL {
?x u:kg ?kgweight .
}
OPTIONAL {
?x u:kg ?lbweight .
}
}
surely easier?
Cheers,
Danny.
Received on Tuesday, 19 January 2010 00:04:56 UTC