Hacker News new | past | comments | ask | show | jobs | submit login

It's reasonably trivial in RDF/OWL as well; Supplies would be a class whose instances have statements that point to supplier, part, and customer. In rough SPARQL that would be something like:

select distinct ?supplier where

?supplies hasSupplier ?supplier

?supplies hasPart ?part

?supplies hasCustomer ?customer

?supplier hasCountry "US"

?customer hasCountry "Japan"

?part hasPrice ?price

filter(?price < 10)

Not that bad, maybe more verbose than SQL, but not that difficult to express. You'd probably want type constraints on the variables, too.




OK, you are right, that wasn't so bad. Perhaps I will take a closer look at SPARQL one of these days.

BTW how does it do with things like spatial constrains. In relational databases it's easy to express spatial joins over relations. For example given

Structure(id, name, x, y, type)

you can query for things like all the structures of type 'pharmacy' within 1 km of a 'hospital'. It's simple to define functions like distance(x1,y1,x2,y2) that may be predicated on. Anything like that in SPARQL (yet)?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: