Querying the Wikipedia XML dump

Sunday, 14 February 2010 · 2 messages
CG
Christian Grünin reply to Jason Priem, 14 Feb 2010, 01:0214 Feb 2010 00:25 #

Dear Jason,

Quoted text · Jason Priem · 6 lines
> I set up a database in BaseX with the Wikipedia articles dump (all 25 GB of > it). I'm able to access individual articles though the treemap display (by > clicking on them), but I get null responses for every xpath query run, even > really basic stuff like "//title." I'm sorry if this is a very obvious > question; I'm a beginner to XML databases. Any ideas as the problem, or > what to do to find out more? Thanks!

You need to specify the namespace of the Wikipedia document in the prolog of your query:

  declare default element namespace "http://www.mediawiki.org/xml/export-0.3/";
  //title

If you prefer short expressions, just add a prefix wildcard in front of the tag names:

//*:title

Hope this helps, Christian ___________________________

Christian Gruen Universitaet Konstanz Department of Computer & Information Science D-78457 Konstanz, Germany Tel: +49 (0)7531/88-4449, Fax: +49 (0)7531/88-3577 http://www.inf.uni-konstanz.de/~gruen

JP
Jason Priem14 Feb 2010 01:02 #

Hi, I set up a database in BaseX with the Wikipedia articles dump (all 25 GB of it). I'm able to access individual articles though the treemap display (by clicking on them), but I get null responses for every xpath query run, even really basic stuff like "//title." I'm sorry if this is a very obvious question; I'm a beginner to XML databases. Any ideas as the problem, or what to do to find out more? Thanks! j

-- Jason Priem UNC Royster Fellow School of Library and Information Science University of Carolina at Chapel Hill

⚡Generated with XQuery