本文介绍了是否存在用于回答一般 Prolog 查询的 JSON-RPC 服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了这篇关于写作的教程SWI-Prolog 的 JSON-RPC 服务器.不幸的是,它所做的只是将两个数字相加.我想知道是否存在 SWI-Prolog 的 RPC 服务器,它可以定义新规则并回答一般 Prolog 查询、返回 JSON 列表等?

I saw this tutorial for writing a JSON-RPC server for SWI-Prolog. Unfortunately, all it does is add two numbers. I'm wondering if there exists a RPC server for SWI-Prolog that can define new rules and answer general Prolog queries, returning JSON lists, etc?

推荐答案

当您浏览 SWI-Prolog 网站,自豪地自供电,您可以在工作中看到 http 包.

When you take a tour on SWI-Prolog website, proudly self-powered, you can see at work some of the features offered by http package.

这是一个相当广泛的工具,要掌握系统的基础知识,最简单的方法是遵循特定的如何部分,一步一步.您应该注意 LOD Crawler 中的一个小错误:在 lod.pl 的第 42 行添加一个选项:

It's a fairly large range of tools, and to grasp the basic of the system, the easiest way it's to follow the specific How to section, step by step. There is a small bug you should be aware in the LOD Crawler: add an option on line 42 of lod.pl:

...
    ;   rdf_load(URI2, [format(xml)]),
....

或者你可能会得到

内部服务器错误

域错误:content_type' 预期,找到 text/xml;charset=UTF-8'

Domain error: content_type' expected, found text/xml;charset=UTF-8'

运行示例时.

IDE 的一个重要特性是调试 HTTP 请求的能力.

An important feature of the IDE it's the ability to debug the HTTP requests.

完成 HowTo 后,您可以查看 Cliopatria,专门介绍接口RDF 转 HTML.它带有一个pirates demo,我必须说我觉得它对我的口味来说有点太粗糙"了,而且我不知道 YUI,用于获奖的 MultimediaN 项目.然后我使用 Bootstrap 来获得前端的现代外观,并获得了可观的结果(我抱歉,我不能 - 还 - 发布它,需要更多时间来设计系统).

When done with the HowTo, you can take a look to Cliopatria, dedicated to interfacing RDF to HTML. It come with a pirates demo, I must say I find it a bit too 'crude' for my taste, and I don't know about YUI, used in the award winning MultimediaN project. Then I've used Bootstrap to gain a modern look for the front end, with appreciable result (I'm sorry I can't - yet - publish it, need more time to engineering the system).

HTH

这篇关于是否存在用于回答一般 Prolog 查询的 JSON-RPC 服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 05:18