Wednesday, 13. August 2008

SPARQL and number comparison in Sesame

A colleague of mine wanted to do a simple number comparison in Sesame2, and couldn't make it out of the box. Because you may also want to query for "?blogposts nao:numericRating ?rating. FILTER (?rating > 8)":
  • This won't work: FILTER (?rating > 8)
  • This will: FILTER (?depth <= '5'^^<http://www.w3.org/2001/XMLSchema#integer&gt)
  • If you didn't guess it already: its single hyphens, double hyphens won't work!
A whole query is:

SELECT ?blogpost ?rating WHERE {
?blogpost nao:numericRating ?rating.
FILTER (?rating >= '8'^^<http://www.w3.org/2001/XMLSchema#integer&gt) .
}


Thanks and kudos to Manuel Möller
What is NAO? An ontology used on the Semantic Desktop to rate things. So, if you give stars to something in KDE 4.0, its a NAO triple...
QR barcode by i-nigma.com/CreateBarcodes
icon

semantic weltbild 2.0

Building the Semantic Web is easier together

and then...

foaf explorer
foaf

Geo Visitors Map
I am a hard bloggin' scientist. Read the Manifesto.
www.flickr.com
lebard's photos More of lebard's photos
Skype Me™!

Search

 

Users Status

You are not logged in.

I support

Wikipedia Affiliate Button

Archive

August 2008
Sun
Mon
Tue
Wed
Thu
Fri
Sat
 
 
 
 
 
 1 
 2 
 3 
 5 
 7 
 9 
10
12
14
15
16
17
19
21
22
23
24
25
29
30
31
 
 
 
 
 
 
 

Credits


austriaca
Chucknorrism
digitalcouch
gnowsis
Jesus
NeueHeimat
route planning
SemWeb
travel
zoot
Profil
Logout
Subscribe Weblog