You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Adrian Gschwend <ml...@netlabs.org> on 2012/09/12 21:54:00 UTC

Understanding OntoNet CRUD

Hi group,

I'm trying to load a bunch of ontologies into OntoNet, with mixed results:

- loading them in the web form works, I can specify an URI and it
fetches it properly
- 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/"

But all I get back is:

HTTP/1.1 415 Unsupported Media Type
Content-Type: text/html; charset=iso-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 1399
Server: Jetty(6.1.x)

I get this error back on various URIs which are shown in the REST API
page of Stanbol. Note that I tried various different URIs to post in but
no luck.

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

this works fine with curl, I get the requested serializations.

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?

A working example of how I post with curl would be appreciated.

thanks

Adrian



Re: Understanding OntoNet CRUD

Posted by Alessandro Adamou <ad...@cs.unibo.it>.
Sorry for the delay, I'm not feeling very well.

On 9/25/12 7:33 PM, Adrian Gschwend wrote:
> Either that or I was lucky with the resources I tried :-D Are you sure 
> that REST doesn't allow you to set the ID on your own

I have the code before me right now, and can't see any PUT or POST 
methods for *subresources* of /ontonet, /ontonet/session or 
/ontonet/ontology. But given your valuable input, I guess it's time to 
add some.

>> It seems however that you would like to specify a public key
>> manually. To my knowledge this wasn't possible earlier, but since I
>> have now implemented aliasing, I guess it is not a problem to have
>> the client specify new aliases. We can figure out together the best
>> way to do so, though.
> That would be great, otherwise the caching stuff I do won't really work

Ok I'll look into it shortly and open a ticket for it. Shouldn't be very 
hard since aliasing was implemented recently.

> You propose that or they should work? I think PUT/POST is more correct 
> then if it's about choosing the right way. 

They need to be implemented, but come to think of it, perhaps it could 
be useful to implement both services together.

Best,

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


Re: Understanding OntoNet CRUD

Posted by Adrian Gschwend <ml...@netlabs.org>.
On 25.09.12 18:04, Alessandro Adamou wrote:

Hi Alessandro,

> You could do that earlier? Hmmmmm, that's odd, it should have never
> been that way - not very RESTful.

Either that or I was lucky with the resources I tried :-D Are you sure
that REST doesn't allow you to set the ID on your own?

> To be named, an ontology needs to have a single named resource typed 
> with owl:Ontology . DC elements is in RDFS and has no OWL
> statements. Resource "http://purl.org/dc/elements/1.1/" is not even
> typed in the schema.

ok as mentioned in the proposal I'm using Stanbol as a cache for
ontologies as well. Our framework now first checks if it finds the
ontology in Stanbol, if not it fetches it and posts it there as well. So
I do need the URI of the prefix as an identifier, otherwise I cannot
look it up properly.

> You see all those annotation properties because there is no statement
> in the ontology that claims them to be something more powerful, such
> as object properties. That's normal for OWL axiom interpretation
> praxis (and a known cause of problems e.g. for OWL reasoners - but
> we're working on that).

ok tnx for the clarification! Was confused because I remembered the
turtle I posted.

> It seems however that you would like to specify a public key
> manually. To my knowledge this wasn't possible earlier, but since I
> have now implemented aliasing, I guess it is not a problem to have
> the client specify new aliases. We can figure out together the best
> way to do so, though.

That would be great, otherwise the caching stuff I do won't really work

> Some ways to do so could be:

You propose that or they should work? I think PUT/POST is more correct
then if it's about choosing the right way.

> What you saw was not for deleting ontologies, yet. An HTTP DELETE on
> an ontology within a scope or session will simply release the handle
> from that scope/session on the ontology - hopefully making it
> deletable if there are no other handles.

ah ok

> The actual deletion of ontologies was implemented in the commit I did
> a few minutes ago. You may want to update and rebuild the
> ontologymanager and try it out.

ok cool tnx

cu

Adrian

Re: Understanding OntoNet CRUD

Posted by Alessandro Adamou <ad...@cs.unibo.it>.
Hi Adrian,

On 9/24/12 10:36 AM, Adrian Gschwend wrote:
> I can post now but figured out one change to the release before which is
> not handy for me: When I uploaded an ontology from file/POST I could
> before create the name like this:
>
> curl -i -H "Content-type: text/turtle" -d @dc-elements.ttl
> http://data.gemeindezukunft.ch:8080/ontonet/ontology/ACME/http://purl.org/dc/elements/1.1/

You could do that earlier? Hmmmmm, that's odd, it should have never been 
that way - not very RESTful.

> Now I have to post it to ../ACME and what I get is a identifier like
>
> /ontonet/ontology/ACME/org.apache.stanbol.ontologymanager.ontonet.api.io.GraphContentInputSource-time:1348474817978

That's because the DublinCore elements ontology [1] is anonymous, so a 
public key is generated on the fly (in your case 
org.apache.stanbol.ontologymanager.ontonet.api.io.GraphContentInputSource-time:1348474817978 
)

To be named, an ontology needs to have a single named resource typed 
with owl:Ontology . DC elements is in RDFS and has no OWL statements. 
Resource "http://purl.org/dc/elements/1.1/" is not even typed in the 
schema.

Some APIs implement additional methods to guess ontology IDs (e.g. the 
xml:base or xmlns for RDF/XML documents), but they are nonstandard and 
not implemented in Stanbol right now.

[1] http://dublincore.org/2012/06/14/dcelements.rdf

> Also the content of the POSTed ontology is totally different:
>
> --
> Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>
> Prefix: owl: <http://www.w3.org/2002/07/owl#>
> Prefix: xml: <http://www.w3.org/XML/1998/namespace>
> Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>
> Ontology:
> Import: <http://data.gemeindezukunft.ch:8080/ontonet/ontology/ACME/core>
>
> AnnotationProperty: rdfs:seeAlso
> AnnotationProperty: <http://purl.org/dc/terms/modified>
> AnnotationProperty: <http://www.w3.org/2004/02/skos/core#note>
> AnnotationProperty: rdfs:isDefinedBy
> AnnotationProperty: <http://purl.org/dc/terms/issued>
> AnnotationProperty: <http://purl.org/dc/terms/description>
> AnnotationProperty: <http://purl.org/dc/terms/hasVersion>
> AnnotationProperty: rdfs:label
> AnnotationProperty: rdfs:comment
> AnnotationProperty: <http://purl.org/dc/terms/publisher>
> AnnotationProperty: <http://purl.org/dc/terms/title>
> Datatype: xsd:date
> Datatype: rdf:PlainLiteral
> --

Aside from the owl:imports statement (added by the Scope export), this 
should be exactly the Manchester Syntax version of the ontology. It is 
the format returned by default when you use the browser, but you can 
negotiate other formats such as RDF/XML, JSON-LD, Turtle etc. Any POSTed 
ontology can be exported to any supported format.

You see all those annotation properties because there is no statement in 
the ontology that claims them to be something more powerful, such as 
object properties. That's normal for OWL axiom interpretation praxis 
(and a known cause of problems e.g. for OWL reasoners - but we're 
working on that).

> I could successfully post an ontology which had a URI in there which was
> defined as an OWL:Ontology. Do you check for that? If so, what happens
> if this is not the case like in my example with dc-elements?

A generated public key is applied, as in the above case. I understand 
this can be awkward but at least it is conservative.

It seems however that you would like to specify a public key manually. 
To my knowledge this wasn't possible earlier, but since I have now 
implemented aliasing, I guess it is not a problem to have the client 
specify new aliases. We can figure out together the best way to do so, 
though.

The example you specified is intuitively ok, but does not totally 
conform to the REST guidelines. If you know exactly the URI of the 
resource to create, you should PUT it. However, I'm not sure what's the 
best way to pass parameters such as the ontology content to a PUT.

Some ways to do so could be:

1) Create the resource, which will be an orphan until you POST the 
content to it:

PUT 
http://data.gemeindezukunft.ch:8080/ontonet/ontology/ACME/http://purl.org/dc/elements/1.1/

and then:

POST -d @dc-elements.ttl
http://data.gemeindezukunft.ch:8080/ontonet/ontology/ACME/http://purl.org/dc/elements/1.1/

2) let Stanbol use its generated public key and then add an alias:

POST -F "alias=http://purl.org/dc/elements/1.1/" 
http://data.gemeindezukunft.ch:8080/ontonet/org.apache.stanbol.ontologymanager.ontonet.api.io.GraphContentInputSource-time:1348474817978

>> P.S. I've begun to code some dependency management for ontology
>> deletion, will keep you posted here.
> I saw that I can delete stuff now, thanks!

What you saw was not for deleting ontologies, yet. An HTTP DELETE on an 
ontology within a scope or session will simply release the handle from 
that scope/session on the ontology - hopefully making it deletable if 
there are no other handles.

Later on, scopes and sessions will have specific policies for deleting 
released ontologies automatically (e.g. when a session is destroyed, it 
will try to clear whatever ontologies were added to it, if they have no 
other handles).

The actual deletion of ontologies was implemented in the commit I did a 
few minutes ago. You may want to update and rebuild the ontologymanager 
and try it out.

you have to DELETE [stanbol-host]/ontonet/[ontologyId] but it will only 
work (200 OK) if there are no handles on it (i.e. no scopes/sessions 
managing it, and no other ontologies importing it), otherwise you will 
get 409 Conflict and will have to release those handles first.

I will later add a few services to get the list of handles and aliases 
in JSON or something like that.

Best,

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


Re: Understanding OntoNet CRUD

Posted by Adrian Gschwend <ml...@netlabs.org>.
On 18.09.12 17:47, Alessandro Adamou wrote:

Hi Allessandro,

> And by the way, the documentation still does need an update anyway.

It's much better now, thanks!

I can post now but figured out one change to the release before which is
not handy for me: When I uploaded an ontology from file/POST I could
before create the name like this:

curl -i -H "Content-type: text/turtle" -d @dc-elements.ttl
http://data.gemeindezukunft.ch:8080/ontonet/ontology/ACME/http://purl.org/dc/elements/1.1/

So the identifier is the URI of the ontology. This was very handy
because I use it to cache ontologies and simply do a GET on
/ontonet/ontology/ACME/... to see if I already have it there.

Now I have to post it to ../ACME and what I get is a identifier like

/ontonet/ontology/ACME/org.apache.stanbol.ontologymanager.ontonet.api.io.GraphContentInputSource-time:1348474817978

Also the content of the POSTed ontology is totally different:

--
Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>
Prefix: owl: <http://www.w3.org/2002/07/owl#>
Prefix: xml: <http://www.w3.org/XML/1998/namespace>
Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>

Ontology:
Import: <http://data.gemeindezukunft.ch:8080/ontonet/ontology/ACME/core>

AnnotationProperty: rdfs:seeAlso
AnnotationProperty: <http://purl.org/dc/terms/modified>
AnnotationProperty: <http://www.w3.org/2004/02/skos/core#note>
AnnotationProperty: rdfs:isDefinedBy
AnnotationProperty: <http://purl.org/dc/terms/issued>
AnnotationProperty: <http://purl.org/dc/terms/description>
AnnotationProperty: <http://purl.org/dc/terms/hasVersion>
AnnotationProperty: rdfs:label
AnnotationProperty: rdfs:comment
AnnotationProperty: <http://purl.org/dc/terms/publisher>
AnnotationProperty: <http://purl.org/dc/terms/title>
Datatype: xsd:date
Datatype: rdf:PlainLiteral
--

I could successfully post an ontology which had a URI in there which was
defined as an OWL:Ontology. Do you check for that? If so, what happens
if this is not the case like in my example with dc-elements?

> P.S. I've begun to code some dependency management for ontology
> deletion, will keep you posted here.

I saw that I can delete stuff now, thanks!

cu

Adrian

Re: Understanding OntoNet CRUD

Posted by Alessandro Adamou <ad...@cs.unibo.it>.
On 9/17/12 4:48 PM, Adrian Gschwend wrote:
> Hmm this really confused me but Reto pointed me to the problem: I didn't
> delete the bundle cache, so it still loaded the old versions although
> the source was correct.
>
> I now did a "rm -rf stanbol/" to get rid of all I did so far :)

You can get away with it by always compiling Stanbol or the launchers 
with "mvn clean install", but only if you don't need to preserve 
datafiles, graphs, contents or anything.

> Now the documentation reflects what you wrote! Sorry about that & thanks
> for the patience, I'm a total Java noob in that regard :)

No you're not :) this is not even a Java issue, rather Maven/Sling.

And by the way, the documentation still does need an update anyway.

Best,
Alessandro

P.S. I've begun to code some dependency management for ontology 
deletion, will keep you posted here.

-- 
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


Re: Understanding OntoNet CRUD

Posted by Adrian Gschwend <ml...@netlabs.org>.
On 14.09.12 12:16, Alessandro Adamou wrote:

Hi Allessandro,

> You are correct, there are more examples to be added. However you should
> see to it that when you update and build Stanbol, the updated bundles
> are actually installed. Many users posted here believing they were
> updating their installations but they weren't. I'm saying this because
> I'm on 1382655 and I cannot find your line

Hmm this really confused me but Reto pointed me to the problem: I didn't
delete the bundle cache, so it still loaded the old versions although
the source was correct.

I now did a "rm -rf stanbol/" to get rid of all I did so far :)

Now the documentation reflects what you wrote! Sorry about that & thanks
for the patience, I'm a total Java noob in that regard :)

Will do more work now and report if I run into problems.

cu

Adrian

Re: Understanding OntoNet CRUD

Posted by Alessandro Adamou <ad...@cs.unibo.it>.
Hi Adrian

On 9/13/12 1:28 PM, Adrian Gschwend wrote:
> at least in my latest trunk version there is absolutely no example on 
> how to pass the arguments so the CURL examples are not complete IMHO.

You are correct, there are more examples to be added. However you should 
see to it that when you update and build Stanbol, the updated bundles 
are actually installed. Many users posted here believing they were 
updating their installations but they weren't. I'm saying this because 
I'm on 1382655 and I cannot find your line

Parameters 	location: the physical URL of the ontology to be loaded.


even if i try an egrep -r on the whole source dir. Instead I have (for 
the ontonet/ontology/{scopeid} POST)

# |file|: the physical URL of the ontology to be loaded.
# |format|: combined with|file|, the format of the submitted file. If not 
supplied, all known parsers will be tried until one succeeds or all fail.
# |library|: the identifier of the ontology library whose ontologies have 
to be loaded. The available libraries are shown on the /ontonet/registry 
endpoint.
# |stored|: the public key of the ontology to be loaded, if already stored 
in Stanbol.
# |url|: the physical URL of the ontology to be loaded.

(there is a mistake for the "file" parameter, I will correct it)

>> Even better, a good reasoner will infer that :Adrian and :Alessandro are
>> foaf:Person s
> ok great, I start to see the idea and will definitely play more with
> that. But I'm not really far in reasoning yet, didn't do much more than
> some simple rules and SPARQL CONSTRUCTS so far.

Ok so don't worry about that right now. As soon as you decide to dig it, 
just drop a line here.

>> 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.
> you mean make something a subproperty of a FOAF property for example if
> I get you correctly? That is indeed rarely done currently.

Actually I meant something a little more brutal i.e. having an 
owl:imports [foaf-url] statement in the ontology, which usually results 
in computing all axioms from the imported ontology, e.g.

foaf:knows a owl:ObjectProperty ;
         rdfs:domain foaf:Person ;
         rdfs:range foaf:Person .

But your example also makes sense. If you add a subproperty axiom to 
your schema, but then the ontology containing the data does not import 
the schema, you will not be able to infer the superproperty.

> Also the same question to you: If I figure out stuff I prefer to 
> document it somewhere so others don't have to do the same learnings 
> again. Is there a place where I could try doing that @ stanbol? 
> Otherwise I will simply start doing it for myself.

Welcome onboard! The place to do so is our issue tracker 
https://issues.apache.org/jira/browse/STANBOL

Anyone who signs in can open tickets and post code patches as 
attachments to tickets. Patches are also possible for the Stanbol 
documentation website which can be checked out from

http://svn.apache.org/repos/asf/incubator/stanbol/site/trunk/content/stanbol/

> ok is there a way to drop them right now manually? For testing this is a
> bit annoying :-D

I know, it is for me too. Right now you can either build and install the 
ontology store from contrib/store.

Or I think there should be some Clerezza REST bundle that you can 
install too

Otherwise programmatically via Java, stuff like

     tcManager.deleteTripleCollection(graphName);

Note that using these methods, the Stanbol ontology manager will still 
believe that the ontologies are there. You have to wait for it to have 
its own DELETE implementation.

Best,
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


Re: Understanding OntoNet CRUD

Posted by Adrian Gschwend <ml...@netlabs.org>.
On 13.09.12 12:08, Alessandro Adamou wrote:

Hi Alessandro,

> 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

ah damn thanks for the hint, didn't even try that. Assumed that it would :-)

> Then, the parameter for the URL is not "location" but "url".

ok then I would say this is wrong in the documentation, you talk about
location there (in REST API page on Ontonet):

Parameters 	location: the physical URL of the ontology to be loaded.

> 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.

ah ok my bad, didn't understand the difference between that yet. Thanks
for the hint

> 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/

great that works, thanks!

> I thought I had updated the REST live documentation to state this,
> perhaps I forgot some spots though?

at least in my latest trunk version there is absolutely no example on
how to pass the arguments so the CURL examples are not complete IMHO.
Would be great if you could update that so copy/past the example would
result in a working POST.

> 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.

ah ok, I see the idea of grouping but didn't get yet why I would want to
use that.

> Even better, a good reasoner will infer that :Adrian and :Alessandro are
> foaf:Person s

ok great, I start to see the idea and will definitely play more with
that. But I'm not really far in reasoning yet, didn't do much more than
some simple rules and SPARQL CONSTRUCTS so far.

> 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.

you mean make something a subproperty of a FOAF property for example if
I get you correctly? That is indeed rarely done currently.

> Also, having a managed ontology can help for maintaining multiple
> versions simultaneously.

ah yes that makes a lot of sense

> There's more to that, but I hope this helps for a start.

It does, thanks a lot.

Also the same question to you: If I figure out stuff I prefer to
document it somewhere so others don't have to do the same learnings
again. Is there a place where I could try doing that @ stanbol?
Otherwise I will simply start doing it for myself.

> Right. You can POST either in /ontonet or in /ontonet/ontology/{ScopeID}
> or in /ontonet/session/{SessionID}

ok I think I get that. I posted to /ontonet/ontolgy before and it
created an ID which I now see in /ontonet as well directly.

> 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.

right I remember this discussion on the list.

> 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.

ok is there a way to drop them right now manually? For testing this is a
bit annoying :-D

cu

Adrian

Re: Understanding OntoNet CRUD

Posted by Alessandro Adamou <ad...@cs.unibo.it>.
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