简体   繁体   English

RDF4J SAIL API 实现

[英]RDF4J SAIL API implementation

I am trying to build a federated RDF application based on rdf4j and FedX.我正在尝试构建一个基于 rdf4j 和 FedX 的联合 RDF 应用程序。 What I need is to be able to:我需要的是能够:

  1. Optimize the querying plan and joining strategies.优化查询计划和加入策略。
  2. To expose different and heterogeneous databases (A timeseries or a relational DB for example) in a federated fashion.以联合方式公开不同的异构数据库(例如时间序列或关系数据库)。

I went a little bit through the rdf4j documentation and I got a grasp.我稍微浏览了 rdf4j 文档,然后就掌握了。 And therefore I have some little questions:因此我有一些小问题:

  1. Is there any documentation that explains how to implement the SAIL API?是否有任何文档解释了如何实现 SAIL API? I tried to debug and follow the flow of execution of an example query using a RDF memory store and I got lost.我尝试使用 RDF 内存存储调试并遵循示例查询的执行流程,但我迷路了。
  2. Suppose I want to expose a relational database in my datacenter, Should I implement a SPARQL repository or an HTTP repository?假设我想在我的数据中心公开一个关系数据库,我应该实现 SPARQL 存储库还是 HTTP 存储库? should I in anyway implement the SAIL api?我应该无论如何实现SAIL api吗?
  3. Concerning fedX, how can I make it possible to use the SERVICE and VALUES terms as proposed in the SPARQL 1.1 federated queries?关于 fedX,我如何才能使用 SPARQL 1.1 联合查询中建议的 SERVICE 和 VALUES 术语? How can I change the Joning strategies?如何更改 Joning 策略? the query plan?查询计划?

I know that this can be answered if I dive deeply into the code but I wonder if someone has already exposed some kind of a database using the rdf4j API or even worked and tuned RDF4J.我知道如果我深入研究代码就可以回答这个问题,但我想知道是否有人已经使用 rdf4j API 公开了某种数据库,甚至工作和调整了 RDF4J。

Thanks to you all!谢谢大家!

Is there any documentation that explains how to implement the SAIL API?是否有任何文档解释了如何实现 SAIL API? I tried to debug and follow the flow of execution of an example query using a RDF memory store and I got lost.我尝试使用 RDF 内存存储调试并遵循示例查询的执行流程,但我迷路了。

There is a basic design draft but it's incomplete.有一个基本的设计草案,但它是不完整的。 A more comprehensive HowTo has been in the planning for a while but it never quite gets the priority it needs.一个更全面的 HowTo 已经在规划中了一段时间,但它从来没有得到它需要的优先级。

That said, I don't think you need to implement your own SAIL for what you have in mind.也就是说,我认为您不需要根据自己的想法实施自己的 SAIL。 There's plenty of existing implementations that can do what you need.有很多现有的实现可以满足您的需求。

Suppose I want to expose a relational database in my datacenter, Should I implement a SPARQL repository or an HTTP repository?假设我想在我的数据中心公开一个关系数据库,我应该实现 SPARQL 存储库还是 HTTP 存储库?

I don't understand the question.我不明白这个问题。 HTTPRepository is a client-side proxy for an RDF4J Server. HTTPRepository 是 RDF4J 服务器的客户端代理。 SPARQLRepository is a client-side proxy for a (non-RDF4J) SPARQL endpoint. SPARQLRepository 是(非 RDF4J)SPARQL 端点的客户端代理。 Neither has anything to do with relational database.两者都与关系数据库无关。

should I in anyway implement the SAIL api?我应该无论如何实现SAIL api吗?

It depends on your use case, but I doubt it - at least not right at the outset.这取决于您的用例,但我对此表示怀疑 - 至少一开始就不是。 I'd probably use an existing R2RML library that is compatible with RDF4J, like for example the R2RML API , or CARML - either a live mapping or an offline batch mapping between the relational data and your triplestore may solve your problem.我可能会使用与 RDF4J 兼容的现有R2RML库,例如R2RML APICARML - 关系数据和三元组之间的实时映射或离线批处理映射可能会解决您的问题。

Concerning fedX, how can I make it possible to use the SERVICE and VALUES terms as proposed in the SPARQL 1.1 federated queries?关于 fedX,我如何才能使用 SPARQL 1.1 联合查询中建议的 SERVICE 和 VALUES 术语?

You don't need to "make it possible" to do that, FedX supports this out of the box.你不需要“让它成为可能”来做到这一点,FedX 支持开箱即用。

How can I change the Joning strategies?如何更改 Joning 策略? the query plan?查询计划?

You can't (at least not easily), nor should you want to.你不能(至少不容易),也不应该想要。 Quite a lot of research and development went into RDF4J's and FedX query planning strategies. RDF4J 和 FedX 查询规划策略进行了大量的研究和开发。 I'm not saying either is perfect, but you're unlikely to do better.我并不是说两者都是完美的,但你不太可能做得更好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM