Prolog 网络编程 [英] Prolog web programming

查看:58
本文介绍了Prolog 网络编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作中,有人讨论过使用 prolog 作为网络应用程序规则引擎的后端.

这将如何与现有系统绑定?

是否有其他语言的可用 prolog 库允许调用 prolog 模块?

解决方案

对于 SWI-Prolog,你可以看看 Thea2 支持 SWRL 在 Prolog 中,也可以通过 JPL 例如 HermiT 用于 OWL/SWRL 推理,或 Pellet

就个人而言,我过去曾多次使用 JPL使用 SWI-Prolog 后端启用 Web 应用程序,如果您打算使用可在 JVM 上执行的语言(例如 Java、Groovy 或 Scala)来对 Web 应用程序进行编程,则该后端工作正常.另一种选择是将 SWI-Prolog 连接到 CC++ 环境,我还没有尝试过用于网络应用程序.>

如果您的网络应用程序使用另一种不在 JVM 或 C/C++ 上运行的开发语言,那么这对您来说可能不是正确的路径,因为连接正在运行的应用程序似乎有点困难SWI-Prolog 环境到其他语言环境.然而,话虽如此,我们已经使用 成功实现了 SWI-Prolog-to-anything 桥接HTTP 之前,但如果性能是必需的,这不太理想.

At work, there was a discussion of using prolog as the backend for a rules engine on a web-app.

How would this get tied into existing systems?

Are there available prolog libraries for other languages allowing the invocation of prolog modules?

解决方案

For SWI-Prolog, you could look to Thea2 which has support for SWRL in Prolog and can also be attached to external reasoners via JPL such as HermiT for OWL/SWRL reasoning, or Pellet, etc.

On a personal note, I have used JPL several times in the past to enable web-apps with a SWI-Prolog backend, which works just fine if you intend to program your web app using a language which is executable on a JVM, like Java, Groovy, or Scala, for example. Another alternative would be to hook SWI-Prolog into a C or C++ environment, which I haven't tried for a web-app.

If your web-app is using another development language that doesn't run on a JVM or in C/C++, then this mightn't be the right path for you as it seems to be a bit harder to connect a running SWI-Prolog environment to other language environments. However, that said, we have successfully implemented a SWI-Prolog-to-anything bridge using HTTP before, but this is less than ideal if performance is a necessity.

这篇关于Prolog 网络编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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