如何轻松地将RDF三元组转换为自动Java POJO业务对象? [英] How can I easily convert RDF triples to/from an idomatic Java POJO business object?

查看:173
本文介绍了如何轻松地将RDF三元组转换为自动Java POJO业务对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Java开发人员,刚刚开始使用链接数据/ RDF。我可以创建三元组,将它们放在三重存储中,查询它们等,但它非常尴尬。我的大多数代码都专注于RDF的机制,我真的很想以一种更惯用的Java方式处理这些数据。

I'm a Java developer just getting started with linked data/RDF. I can create triples, put them in a triple store, query them, etc, but it's very awkward. Most of my code is focused on the mechanics of RDF and I'd really like to work with this data in a way that's more idiomatic Java.

我如何转换为去往/来自RDF的POJ三合一与耶拿没有手工编码所有东西?

How can I convert a POJO to/from RDF triples with Jena without hand-coding everything?

我想要一些可以转换成堆的东西在Java POJO和RDF之间来回定义结构的三元组。就像JAXB或ORM分别用于XML和关系数据库一样。

I'd like something that can convert a pile of triples with a defined structure back and forth between a Java POJO and RDF. Like JAXB or and ORM does for XML and a relational database, respectively.

此外,我不能被锁定在特定的三重存储中。我真的很喜欢与Apache Jena API一起使用的东西,因为它似乎最接近行业标准。项目建筑师也告诉我使用它,因为三重商店他们正在调查所有支持它。

Also, I can't be locked in too closely a particular triple store. I'd really like something that works with the Apache Jena API, since that seems to be the closest to an "industry standard." Also the project architect told me to use that, since the triple stores they're investigating all support it.

东西我看了看:

我试用一个图书馆那种做了我想要的,但它做了一些奇怪的选择,我真的不认为它对我有用。

I try out one library that sort of does what I want, but it made some weird choices and I don't really think it will work for me.

Elmo / Alibaba 听起来很有希望,但它看起来只有它与Sesame三重商店合作,听起来它可能带有一个巨大的巨型框架和/或服务器。耶拿有没有人成功使用它?我还没有尝试过。

Elmo/Alibaba also sounds promising, but it looks like it only works with the Sesame triple store and it also sounds like it may carry a big giant framework and/or server along with it. Has anyone had any success using it with Jena? I haven't actually tried it out.

推荐答案

Empire ,它是用于对象三重映射的JPA 1.0的部分实现。它支持Jena,Sesame和Stardog开箱即用,并且很容易添加对其他数据库的支持。

There's Empire which is a partial implementation of JPA 1.0 for Object-Triple mapping. It supports Jena, Sesame, and Stardog out of the box, and is pretty easy to add support for other databases.

还有 Pinto 更像是杰克逊。它比Empire更轻巧,只是往返于RDF& ;; Java bean。它很快将成为Empire内部的引擎。

There's also Pinto which is more akin to Jackson. It's more lightweight than Empire and just does round-tripping to/from RDF & Java beans. It will soon be the engine inside of Empire.

免责声明:我是两者的作者。

Disclaimer: I'm the author of both.

这篇关于如何轻松地将RDF三元组转换为自动Java POJO业务对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆