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
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
--
M.Sc. Alessandro Adamou
Alma Mater Studiorum - Università di Bologna
Department of Computer Science
Mura Anteo Zamboni 7, 40127 Bologna - Italy
Semantic Technology Laboratory (STLab)
Institute for Cognitive Science and Technology (ISTC)
National Research Council (CNR)
Via Nomentana 56, 00161 Rome - Italy
"I will give you everything, just don't demand anything."
(Ettore Petrolini, 1917)
Not sent from my iSnobTechDevice