Hi Adrian, thanks for the interest in this component
Let me try to help out.
On 9/12/12 9:54 PM, Adrian Gschwend wrote:
- loading them via REST does not work, I guessed I have to do this
according to docs & Firebug:
curl -X POST http://data.gemeindezukunft.ch:9090/ontonet/ -d
"location=http://purl.org/rss/1.0/"
To begin with, http://purl.org/rss/1.0/ is not returning RDF for me.
Even if I specify it in the Accept header it still returns some HTML
with the embedded RDF schema. Try http://purl.org/rss/1.0/schema.rdf
Then, the parameter for the URL is not "location" but "url".
Finally, you should use -F instead of -d, as the service expects
multipart form data. If the ontology is not very large you can use -d
(which passes it as form URLencoded), but then the payload must be the
actual ontology content, and you must specify the MIME type.
So, either:
curl -X POST -F "url=http://purl.org/rss/1.0/schema.rdf"
http://data.gemeindezukunft.ch:9090/ontonet/
or you download the RDF file and then
curl -H "Content-type: application/rdf+xml" -d @schema.rdf
http://data.gemeindezukunft.ch:9090/ontonet/
If posting to a scope or session, you can also -d the URL as text/plain e.g.
curl -H "Content-type: text/plain" -d
http://purl.org/rss/1.0/schema.rdf
http://data.gemeindezukunft.ch:9090/ontonet/ontology/schemas
I thought I had updated the REST live documentation to state this,
perhaps I forgot some spots though?
I also have a problem understanding the idea of the scope. When I load
an ontology via the form I can request it via (for example):
http://data.gemeindezukunft.ch:9090/ontonet/http://www.w3.org/1999/02/22-rdf-syntax-ns
Yes, you can request an ontology either standalone or managed (i.e.
within an ontology collector -- scope/space/session -- that is
referencing it). They will mostly be the same, however the managed
version can have some additional axioms and imports that could change
the interpretation of the ontology if you give it to, e.g. Protégé or a
reasoner.
Example: in session "Adrian" you load an ontology that contains the triple
:Adrian foaf:knows :Alessandro
If you feed this session to Protégé/HermiT/Pellet/OWL API etc. they will
think the triple is an annotation and not treat it as a logical axiom,
thus not using it for inferences.
But if you append a scope User, which contains e.g. the FOAF and SIOC
ontologies, to the session, then when you export it, these applications
will compute the triple as an object property assertion, because FOAF
says that foaf:knows is an object property - and therefore :Alessandro
is an owl:Thing and not just a literal.
Even better, a good reasoner will infer that :Adrian and :Alessandro are
foaf:Person s
Of course you could import FOAF in your ontology as well, but the
problem is that not many people think about doing that, especially in
Linked Data.
Also, having a managed ontology can help for maintaining multiple
versions simultaneously.
There's more to that, but I hope this helps for a start.
But all the REST API samples show a curl which posts to
curl -X POST "http://data.gemeindezukunft.ch:9090/ontonet/ontology/User
so we have "ontology" in between. So what is the difference between
/ontonet and /ontonet/ontology? And 'User' would be the scope, right?
Right. You can POST either in /ontonet or in /ontonet/ontology/{ScopeID}
or in /ontonet/session/{SessionID}
Note that some endpoints will change their URLs, most notably "ontonet"
will be replaced with something else for legal reasons. We haven't
decided what with, yet.
Oh and before you ask: ontology deletion is being implemented because
there are some dependency issues between ontologies to be handled.
Originally the feature was in the ontologymanater/store, but since it is
not part of canonical Stanbol, it looks like it will have to be
implemented in ontonet.
hth
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