This is a simple sample session with rdfdb. Queries are terminated with "</>. The query returns any answers (as applicable) and an error code. The error code 0 is returned for successful operations.
telnet 209.157.132.197 7001
Connected to govinda.guha.meer.net (209.157.132.197).
Escape character is '^]'.
create database test1 </>
#0
insert into test1 (<DanB> <type> <Person>) (<DanB> <name> 'Dan Brickley') </>
#0
insert into test1 (<DanB> <worksFor> <W3C>) (<DanC> <worksFor> <W3C>) </>
#0
insert into test1 (<DanC> <name> 'Dan Connolly') </>
#0
select ?x ?y from test1 where (?x <worksFor> <W3C>) (?x <name> ?y) </>
?x      ?y
<DanC>  "Dan Connolly"
<DanB>  "Dan Brickley"
#0
<quit>

Here is a simple www front end browser for the dmoz hierarchy based on rdfDB DBI. Here is the code behind that.