I'm not sure if this is the source of the problem, but the rules endpoint seems to be handling CORS preflight only on the root resource and not in the subresources. And there are a few GET methods that still need to add the CORS origin.

I'm afraid I don't have the time to fix and test it myself, but a ticket could be opened in the meantime.

Alessandro


On 8/1/12 12:01 PM, Melanie Reiplinger wrote:
Hi Alessandro and all,


Is CORS access to the rules endpoint granted?

When I do e.g. a PUT to
http://<stanbol>/rules/recipe/http://www.dfki.de/mere01/recipe/melaniesRecipe in order to create a new recipe "http://www.dfki.de/mere01/recipe/melaniesRecipe";,
I'm getting a real strange response header:

Allow:
OPTIONS,POST,GET,DELETE,HEAD,PUT

This looks a bit ancient, most of the other endpoints return at least

Access-Control-Allow-Origin
and

1.
   Access-Control-Allow-Headers
2.
   Access-Control-Allow-Methods




Best,
melanie

Am 15.07.2012 13:21, schrieb Melanie Reiplinger:
Hi Alessandro.

Sorry to bother you again, but I have a few more questions for the rules endpoint.

Am 13.07.2012 16:09, schrieb Alessandro Adamou:
On 7/13/12 3:57 PM, Melanie Reiplinger wrote:
Am 13.07.2012 15:33, schrieb Alessandro Adamou:
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

The last one with query parameters is correct. Try this:

curl -H "Accept: application/rdf+xml" http://[stanbol]/rules/find/rules?name=rans

curl -H "Accept: application/rdf+xml" http://[stanbol]/rules/find/rules?description=irst

hmm, ok, so one could assume that it works analogously for the rules/find/recipes. But when doing

curl -H "Accept: text/turtle" http://<stanbol>/rules/find/recipes?name=r2
or
curl -H "Accept: text/turtle" http://<stanbol>/rules/find/recipes?name=http://www.dfki.de/mere01/recipe/r2

I get a 404 Not Found.
(for a recipe named 'r2', created by
curl -i -X PUT http://lnv-89012.dfki.uni-sb.de:9001/rules/recipe/http://www.dfki.de/mere01/recipe/r2
)

what am I doing wrong?


Also: How do we then remove rules from a recipe, if we cannot address them simply by attaching their URI or name to the endpoint's URL?

And one more: For the refactoring functionality I didn't get very far. First thing I wanted to give some minimal toy RDF graph as an input and refactor via the RESTful Interface. This gives me the (not very informative) message:
"The site <stanbol> says: Error".
(in the form of an alert window). This error might be due to virtually anything. My toy example is

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    xmlns:dbpedia="http://dbpedia.org/property/";>
    <rdf:Description rdf:about="urn:example:person:ernie">
        <dbpedia:Person>Ernie</dbpedia:Person>
        <dbpedia:profession>Friend of Bert</dbpedia:profession>
    </rdf:Description>
</rdf:RDF>

and I was hoping for something like an application of the "peopleProfessionRule" rule or something. (I already checked on http://www.w3.org/RDF/Validator/ to make sure it is well-formed).

best
melanie



You can also ask for:

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

Theoretically, it should also support

application/json (JSON-LD)
text/plain

but I don't see a body writer registered with rule lists so it didn't work for me.

Best,
Alessandro


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

Reply via email to