导入维基百科的 xml.bz2 选项

发布于 2025-01-01 06:45:21 字数 154 浏览 2 评论 0原文

我想到了编写一个可以使用 XML 并将其插入数据库的 Java 程序的可能性。我提取了压缩的维基百科页面文件,因此我现在将其保存在 xml 中,而不仅仅是 xml.bz2 中。我查看了维基百科的网站,但没有成功。找不到东西。我想这不应该是一个非常困难的过程,它应该很简单,这就是我问你的原因:)

I thought of the possibility of writing a Java program that could use the XML and insert it into the database. I extracted the compressed Wikipedia pages file so I have it in xml right now, not only in xml.bz2. I've looked on Wikipedia's website but with no success. Couldn't find something. I imagine this is not supposed to be a very hard process and it should be straightforward and that's why I'm asking you :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

埋情葬爱 2025-01-08 06:45:21

.bz2 后缀表示 bzip2 压缩。如果您使用的是 Linux 或其他 Unixish 操作系统,您可能已经安装了 bzip2 解压缩器;如果您使用的是 Windows,则可以此处下载一个。

请注意,有些 Java 库可让您直接读取 bzip2 压缩的流,而无需外部解压缩器。其中之一可以在此处找到。

编辑:等等,我想我误解了你的问题。您似乎已经成功解压缩了 XML 转储,现在您想知道如何处理它。在这种情况下,您可能需要查看 mwdumper

The .bz2 suffix denotes bzip2 compression. If you're on Linux or another Unixish OS, you probably already have a bzip2 decompresor installed; if you're on Windows, you can download one here.

Note that there are Java libraries that let you read bzip2-compressed streams directly without the need for an external decompressor. One of them can be found here.

Edit: Wait, I think I misread your question. It seems like you've already managed to decompress the XML dump, and now you want to know what to do with it. In that case, you might want to take a look at mwdumper.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文