Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"In the example above (likes julie ?x), x refers to everyone in the database defined in the second place of the binary relation likes. Note that the variable x must mean the same person in (likes julie ?x) and (likes ?x ?y). Similarly, the variable y must mean the same thing in (likes ?x ?y) and (girl ?y). Intuitively, the clause above says that Julie likes some person x if there is some person y that x likes who is a girl. Or, as we said originally, Julie likes anyone who likes girls. Can you represent this information in a traditional database?"

Yes/no depending on your perspective. "anyone who likes girls" is a variable so you have to convert it to a domain: "everyone who likes girls."

Is there a difference? Using a domain seems more useful to me, but maybe my brain has been corrupted by too much database work.



You can convert this to a domain, but I'm still not sure how to say Julie likes everyone who likes girls. Using dependent data definitions in SQL gets very tricky very quickly. You can do it in a view, but a view is not designed to represent information, merely to present it.

Assuming you could easily state that "Julie likes everyone who likes girls" once you converted the variable to a domain, you're still forced into a very rigid structure. If you're in a situation where a piece of knowledge in the database is unique for a given row, you wouldn't be able to convert everything to domains. Consider a situation where you're representing information about patients' blood tests. There are some basic tests that you can pigeonhole in a domain, but what about very specialized tests that only a handful of patients ever take?

I think this is definitely a case of Blub for both of us. If we were to be set free from the relational way of thinking, we'd be solving problems we can't even think up now.


Same with "Bob's age is not 30". Age is a variable so you have to covert it to a domain. In order to do that you have to explicitly say what "not 30" means. I'd say it means 1 - 29, 31 - 120. But look what happened. The original, variable, version depended on implicit information in people's brains regarding the possible range of human ages. The domain version makes this information explicit.

This is exactly what rules/sucks about relational databases. Everything is harder because you can't get away with statements that are subjectively ambiguous.




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

Search: