Hi Alessandro.

Am 13.07.2012 15:33, schrieb Alessandro Adamou:
Hi Melanie,

On 7/13/12 2:51 PM, Melanie Reiplinger wrote:
Thank you for your instructions. I was able to create a recipe "http://www.dfki.de/mere01/recipe/r1"; via PUT. Now, when trying to upload/create a new rule, I again get the Method not allowed error.

curl -i -X POST -F "recipe=http://www.dfki.de/mere01/recipe/r1"; -F "description=first_rule" -F "rule=http://www.dfki.de/mere01/rules/R.has_transitive"; -F "kres-syntax=has(, ?x, ?z) . has(, ?z, ?y) -> has(, ?x, ?y)" http://<stanbol>/rules/recipe/
HTTP/1.1 100 Continue

HTTP/1.1 405 Method Not Allowed
Allow: GET,OPTIONS,HEAD
Content-Type: text/html; charset=iso-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1396
Server: Jetty(6.1.x)

(the same if I send it just to <stanbol>/rules, as it sais in the docu). I guess my request is not correct?

After a quick look at the resource code, it looks like the documentation is outdated again.

The recipe ID is now a Path parameter. There's no "kres-syntax" parameter anymore, and "rule" is now "rules" and it accommodates the rule name and the syntax as well.

Here is what worked for me:

curl -X POST -F "rules=transitivity[has(?r, ?x, ?z) . has(?r, ?z, ?y) -> has(?r, ?x, ?y)]" -F "description=Test rule" http://[stanbol]/rules/recipe/http://www.dfki.de/mere01/recipe/r1

great, works fine. Now, if I want to get the rule itself, to what URL do I send the GET? I tested
<stanbol>/rules/rule/transitivity
<stanbol>/rules/transitivity
<stanbol>/rule/transitivity
<stanbol>/rules/find/rules




To check if it has been stored (and therefore parsed), you can do a GET on

http://[stanbol]/rules/recipe/http://www.dfki.de/mere01/recipe/r1

requesting text/plain or some KR format such as

text/turtle
application/rdf+xml
text/owl-manchester

Hope this helps,

Alessandro



Reply via email to