Other than coolness, why reinvent this wheel? It's very easy to load and query RDF graphs with jena and sparql <a href="http://openjena.org/ARQ/Tutorial/query1.html" rel="nofollow">http://openjena.org/ARQ/Tutorial/query1.html</a> you don't even have to do something horrible like learn basic java syntax, there is a command line...
bin/sparql --data=doc/Tutorial/vc-db-1.rdf --query=doc/Tutorial/q1.rq<p>Jena's the defacto standard library for dealing with RDF atm, it's pretty easy to use.