如何从 Perl(或其他脚本语言)访问 RDF-XML?

发布于 2024-08-04 20:02:13 字数 417 浏览 2 评论 0原文

我使用 Perl 脚本和 Net::Flickr: 在本地备份我的 Flickr 图片:备份模块。这会将原始图片、缩略图以及 RDF-XML 文件中的相关元数据(标题、标签等)拉下来。

我想提取此元数据的子集,以便生成“穷人的 Flickr”HTML 页面。这应该显示缩略图和指向较大版本的链接,以及选定的元数据(标题、标签和 Flickr 中设置的权限)。

我想从 Unix 命令行执行此操作,将其指向文件目录并返回 HTML 文档。

从 RDF-XML 文件中提取特定数据的最佳方法是什么? Perl 中的支持似乎有点粗略。如果 Python 或 Ruby 更容易用于 RDF 探索,我愿意尝试。

I'm backing up my Flickr pics locally using a Perl script and the Net::Flickr::Backup module. This pulls down the original picture, a thumbnail, and the associated metadata (title, tags etc) in a RDF-XML file.

I'd like to extract a subset of this metadata so I can generate a "poor man's Flickr" HTML page. This should display the thumbnail and a link to the larger version, along with selected metadata (title, tags, and the permissions set in Flickr).

I'd like to do this from the Unix command line, pointing it to a directory of files and getting a HTML document back.

What's the best way to extract specific data from an RDF-XML file? The support in Perl seems a bit sketchy. I'm willing to try Python or Ruby if that's easier to use for RDF spelunking.

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

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

发布评论

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

评论(2

怀念你的温柔 2024-08-11 20:02:13

我不确定我是否理解您的问题,但您不一定需要 SPARQL 引擎来提取您的元数据。如果您的 RDF/XML 始终看起来相同,您可以使用简单的 XSLT 样式表来提取您文档中的具体内容。

I'm not sure I understand your question , but you don't necessarily need a SPARQL engine to extract your metadata. If your RDF/XML always look the same, you can use a simple XSLT stylesheet to extract a specific content from your document.

吻风 2024-08-11 20:02:13

如果您有 RDF-XML,那么您可以使用 XML CPAN 模块来解析它,例如以下之一:

但是您可能想要查看 Net::Flickr::RDF 因为它看起来像它涵盖您的要求。

If you have the RDF-XML then you can parse it using a XML CPAN modules like one of these:

However you may want to look at Net::Flickr::RDF because it looks like it covers your requirement.

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