On 7/4/12 4:00 PM, Melanie Reiplinger wrote:
Hello all.
I'm still on the ontonet endpoint, now trying to implement access to
the session and the library manager. I'm somehow confused about the
documentation. On
http://incubator.apache.org/stanbol/docs/trunk/ontologymanager/
<http://incubator.apache.org/stanbol/docs/trunk/ontologymanager/ontonet/>,
there are two branches:
ontologymanager/{registry|ontonet}/
and
ontonet.
I do know why this is happening, but it must be due to the way Markdown
processes the documentation sources. I removed the trunk/ontonet path
long ago, but somehow it still makes its way into the staging build...
The correct paths are ontologymanager/{registry|ontonet}/
Both do not state examples for creating or deleting sessions. On the
RESTful docu, there is an example for a POST request that should
create a session. But that command does not work for me. Even the curl
command throws me a 'Method not allowed' when I do something like:
curl -i -X POST
"<server>/ontonet/session?scope=<scope>&session=<id>&location=<url>"
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: 1398
Server: Jetty(6.1.x)
Was I again following the wrong documentation here?
No, this time the documentation is outdated, sorry for that.
This is because the session APIs were reworked and simplified in the
past months
To create a session:
- If you want to decide which ID to give it, just do a PUT
[stanbol-host]/ontonet/session/[ID]
- If you want Stanbol to decide the ID, do a POST
[stanbol-host]/ontonet/session
The latter I just reimplemented in revision 1357301 right after your
message, so if you svn update now, POST should be there again. It will
return 201 CREATED with the new session URL in the Location, or 503
FORBIDDEN if you've reached the active session quota. Right now the ID
is simply the creation timestamp.
Other than that, adding ontologies now works almost the same as in
scopes. Just do the appropriate POST with form-multipart or
form-urlencoded as for scopes. There are only these differences:
- there's no ontology addition in the PUT method at session creation
time. This is because, unlike scopes, sessions do not have a privileged
space for core ontologies.
- you can also append one entire scope (or more) to a session, so they
will be part of the overall ontology network (and the OWL artifact that
corresponds to the session will have owl:imports declarations on the
scopes), e.g.
% curl -X POST -F scope=social [stanbol-host]/ontonet/session/melanie666
Hope this brings you a little further
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