[redland-dev] dbpedia + redland basics

Gregory Williams greg at evilfunhouse.com
Sun Mar 2 16:25:00 GMT 2008


On Mar 2, 2008, at 9:36 AM, Andrew (Chuan) Khoo wrote:

> So, to list down my questions:
> 1) How do I import .nt data into mySQL?
> 2) If there is code provided to parse the data into the mysql store,  
> how do I compile and run it?

rdfproc should be able to do this for you. For example, using the geo  
coordinates data:

rdfproc -n -s mysql -t  
"host='localhost',database='test',user='test',password='test'" dbpedia  
parse geo_en.nt ntriples

This will create a model named "dbpedia" in the "test" database. For  
future data loading, you'll want to drop the "-n" argument so that  
you're not creating a new store (and deleting what you've already  
loaded) on each command.

> 2) How do I call SPARQL queries (using rasqal?) from php?

On the command line, you can again use rdfproc:

rdfproc -s mysql -t  
"host='localhost',database='test',user='test',password='test'" dbpedia  
query sparql - "SELECT * WHERE { ?thing a <http://dbpedia.org/class/yago/landmark 
 > }"

This is also possible through the PHP bindings, but someone else will  
have to comment on the exact APIs to use.

hope that helps,
.greg

-- 
"Turns out the Z-machine (yes, the engine that does Zork) has
  continuations. Who'd've thunk it? Not only are we 30 years behind  
Lisp,
  we're 25 years behind text adventure engines..."    - Dan Sugalski

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
Url : http://lists.usefulinc.com/pipermail/redland-dev/attachments/20080302/c0b2a5d4/smime.bin


More information about the redland-dev mailing list