Hi Adrian,
that documentation you looked at is outdated and no longer a reference
for Stanbol services.
It seems like the preferred way to manage an ontology in a scope is the
first create it in the ontologymanager, then attach it to the scope.
Remember that ontology management is a privileged action so you need
HTTP authentication (I'm using the default admin:admin here, which of
course you should change in production).
This is the sequence that worked for me:
# Load external ontology
$ curl -u admin:admin -X POST -F
"url=http://www.ontologydesignpatterns.org/cp/owl/agentrole.owl"
http://localhost:8080/ontonet
# Create scope
$ curl -u admin:admin -X PUT
http://localhost:8080/ontonet/ontology/r2HR
# Tell the scope to manage the ontology (use text/plain)
# Request body is the logical ID of the ontology, which in this case
matches with the URL it came from
$ curl -u admin:admin -X POST -H "Content-type: text/plain" -d
"http://www.ontologydesignpatterns.org/cp/owl/agentrole.owl"
http://localhost:8080/ontonet/ontology/r2HR
Still, it is true that the REST API and HTML interface of the ontology
manager need to be refreshed.
best
Alessandro
On 28/07/2015 20:33, Alessandro Adamou wrote:
Hi Adrian,
I am not in front of a Stanbol installation right now so I will double-check
that, but I think that since security was introduced in Stanbol, loading
ontologies has become a privileged action that requires HTTP authentication. If
you have not created custom users or set new passwords, try the same command
with -u
curl -u admin:admin -X POST -F
location="http://www.ontologydesignpatterns.org/cp/owl/agentrole.owl"
http://localhost:8080/ontonet/ontology/r2HR
If it works, it should be a more feasible alternative to starting stanbol with
the -no-security option
I will try that out myself asap
Alessandro
________________________________________
Da: Adrian Dinu <[email protected]>
Inviato: martedì 28 luglio 2015 19.56
A: [email protected]
Oggetto: Load ontology to scope -- does not work
I have a scope called 'r2HR' and I try to load an ontology,
http://www.ontologydesignpatterns.org/cp/owl/agentrole.owl , for testing
purposes. This ontology is mentioned in the examples at
http://stlab.istc.cnr.it/documents/KReS/KReS-Alpha/node25.html
I use
curl -X POST -F
location="http://www.ontologydesignpatterns.org/cp/owl/agentrole.owl"
http://localhost:8080/ontonet/ontology/r2HR
and the response is
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 400 Bad Request</title>
</head>
<body>
<h2>HTTP ERROR: 400</h2>
<p>Problem accessing /ontonet/ontology/r2HR. Reason:
<pre> Bad Request</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>
</body>
</html>
The same response I get when I try to load the ontology via the web interface (i.e.
Load an ontology -> From a URL -> Fetch )
In the Stanbol’s command window (DOS) no related information is displayed.
Can anyone please tell me how to upload the ontology to the scope ?
Thanks, Adrian
.
-- The Open University is incorporated by Royal Charter (RC 000391), an exempt
charity in England & Wales and a charity registered in Scotland (SC 038302).
The Open University is authorised and regulated by the Financial Conduct Authority.