You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Alessandro Adamou <ad...@cs.unibo.it> on 2012/12/13 20:41:09 UTC

Re: "Static" resources

Uhm... something seems to be lost in the move.

I loaded an ontology on the dev-iks sandbox and cannot visualize it 
anymore. Requesting text/html on

http://dev.iks-project.eu:8081/ontonet/http://www.cs.unibo.it/~adamou/ontologies/patterns/distribution/A-split/op_declusage1.owl

gets me a 500 :

     java.io.FileNotFoundException: Template 
html/org/apache/stanbol/ontologymanager/web/util/OntologyStatsResource/ontology 
not found.

I still get the expected resource if I request some other mimetype, say 
text/turtle.

But this can spoil apps such as Protege, which gives up if it receives a 
500 on an import request with no Accept header.

I found this out when re-running some test for my thesis

Any clue?

Thanks

Alessandro



On 11/30/12 10:43 AM, Reto Bachmann-Gmür wrote:
> Hello
>
> At Apacheconeu I've been talking with Rupert and others on how static
> resources should be handles. We agreed that they should no longer need to
> be referenced in the webfragment. I was in favour of just having a fixed
> location in the jar but Rupert convinced me that this default location
> should be overwritable with a value in the MANIFEST.MF file. In the long
> term it should be possible to have file-backed resources at any location in
> the URI space but as a first step only the architecture for the resources
> below "/static/" shall be changed.
>
> E.g:
>
> MANIFEST.MF
> Stanbol-Static: /META-INF/stanbol-static
>
> The jar contains
>
> /META-INF/stanbol-static/static/hello.txt
>
> Stanbol will serve that file at
>
> http://<host>/static/hello.txt
>
> if the jar contains
>
> /META-INF/stanbol-static/hello.txt
>
> this will for now generate a warning that currently the files must be in a
> subfolder called "static" to be served (in future it should be served at
> http://<host>/hello.txt).
>
> Any thoughts? Any volunteers?
>
> Cheers,
> Reto
>


-- 
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: "Static" resources

Posted by Reto Bachmann-Gmür <re...@wymiwyg.com>.
On Fri, Dec 14, 2012 at 11:57 AM, Alessandro Adamou <ad...@cs.unibo.it>wrote:

> Hi Reto,
>
>
> On 12/13/12 10:29 PM, Reto Bachmann-Gmür wrote:
>
>> I see 3 templates by that name:
>>
>> ./ontologymanager/web/src/**main/resources/templates/html/**
>> org/apache/stanbol/**ontologymanager/web/resources/**
>> ScopeResource/ontology.ftl
>> ./ontologymanager/web/src/**main/resources/templates/html/**
>> org/apache/stanbol/**ontologymanager/web/resources/**
>> OntoNetRootResource/ontology.**ftl
>> ./ontologymanager/web/src/**main/resources/templates/html/**
>> org/apache/stanbol/**ontologymanager/web/resources/**
>> SessionResource/ontology.ftl
>>
>>
>> is any of these to be used for the resource served by the the resource
>> class OntologyStatsResource ?
>>
>
> the second one certainly does. a GET returns a
>
>     Response.ok(new Viewable("ontology", new OntologyStatsResource(...)));
>

Ok, there is a slight discrepancy between the behaviour of the old jersey
viewable and the new stanbol one. The stanbol creates the path to locate
the template based on the class of the pojo with data. If another class
should be used this can be passed as a third argument to the constructor,
e.g.

Response.ok(new Viewable("ontology", new OntologyStatsResource(...),
OntoNetRootResource.class));

Reto

>
> The other two require an OntologyPrettyPrintResource instead, but I plan
> to replace it with the OntologyStatsResource anyway.
>
> Anyway because I was really in a hurry getting it to work, I reverted my
> working copy back to r1410428 (my latest commit), I can tell it works there
> if it helps. I can get back to it in a few days.
>
> Alessandro
>
>
>  On Thu, Dec 13, 2012 at 8:41 PM, Alessandro Adamou <adamou@cs.unibo.it
>> >wrote:
>>
>>  Uhm... something seems to be lost in the move.
>>>
>>> I loaded an ontology on the dev-iks sandbox and cannot visualize it
>>> anymore. Requesting text/html on
>>>
>>> http://dev.iks-project.eu:****8081/ontonet/http://www.cs.**
>>> unibo.it/~adamou/ontologies/****patterns/distribution/A-split/****<http://unibo.it/~adamou/ontologies/**patterns/distribution/A-split/**>
>>> op_declusage1.owl<http://dev.**iks-project.eu:8081/ontonet/**
>>> http://www.cs.unibo.it/~**adamou/ontologies/patterns/**
>>> distribution/A-split/op_**declusage1.owl<http://dev.iks-project.eu:8081/ontonet/http://www.cs.unibo.it/~adamou/ontologies/patterns/distribution/A-split/op_declusage1.owl>
>>> >
>>>
>>> gets me a 500 :
>>>
>>>      java.io.FileNotFoundException: Template html/org/apache/stanbol/**
>>> ontologymanager/web/util/****OntologyStatsResource/ontology not found.
>>>
>>>
>>> I still get the expected resource if I request some other mimetype, say
>>> text/turtle.
>>>
>>> But this can spoil apps such as Protege, which gives up if it receives a
>>> 500 on an import request with no Accept header.
>>>
>>> I found this out when re-running some test for my thesis
>>>
>>> Any clue?
>>>
>>> Thanks
>>>
>>> Alessandro
>>>
>>>
>>>
>>>
>>> On 11/30/12 10:43 AM, Reto Bachmann-Gmür wrote:
>>>
>>>  Hello
>>>>
>>>> At Apacheconeu I've been talking with Rupert and others on how static
>>>> resources should be handles. We agreed that they should no longer need
>>>> to
>>>> be referenced in the webfragment. I was in favour of just having a fixed
>>>> location in the jar but Rupert convinced me that this default location
>>>> should be overwritable with a value in the MANIFEST.MF file. In the long
>>>> term it should be possible to have file-backed resources at any location
>>>> in
>>>> the URI space but as a first step only the architecture for the
>>>> resources
>>>> below "/static/" shall be changed.
>>>>
>>>> E.g:
>>>>
>>>> MANIFEST.MF
>>>> Stanbol-Static: /META-INF/stanbol-static
>>>>
>>>> The jar contains
>>>>
>>>> /META-INF/stanbol-static/****static/hello.txt
>>>>
>>>>
>>>> Stanbol will serve that file at
>>>>
>>>> http://<host>/static/hello.txt
>>>>
>>>> if the jar contains
>>>>
>>>> /META-INF/stanbol-static/****hello.txt
>>>>
>>>>
>>>> this will for now generate a warning that currently the files must be
>>>> in a
>>>> subfolder called "static" to be served (in future it should be served at
>>>> http://<host>/hello.txt).
>>>>
>>>> Any thoughts? Any volunteers?
>>>>
>>>> Cheers,
>>>> Reto
>>>>
>>>>
>>>>  --
>>> 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
>>>
>>>
>>>
>
> --
> 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: "Static" resources

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

On 12/13/12 10:29 PM, Reto Bachmann-Gmür wrote:
> I see 3 templates by that name:
>
> ./ontologymanager/web/src/main/resources/templates/html/org/apache/stanbol/ontologymanager/web/resources/ScopeResource/ontology.ftl
> ./ontologymanager/web/src/main/resources/templates/html/org/apache/stanbol/ontologymanager/web/resources/OntoNetRootResource/ontology.ftl
> ./ontologymanager/web/src/main/resources/templates/html/org/apache/stanbol/ontologymanager/web/resources/SessionResource/ontology.ftl
>
>
> is any of these to be used for the resource served by the the resource
> class OntologyStatsResource ?

the second one certainly does. a GET returns a

     Response.ok(new Viewable("ontology", new OntologyStatsResource(...)));

The other two require an OntologyPrettyPrintResource instead, but I plan 
to replace it with the OntologyStatsResource anyway.

Anyway because I was really in a hurry getting it to work, I reverted my 
working copy back to r1410428 (my latest commit), I can tell it works 
there if it helps. I can get back to it in a few days.

Alessandro


> On Thu, Dec 13, 2012 at 8:41 PM, Alessandro Adamou <ad...@cs.unibo.it>wrote:
>
>> Uhm... something seems to be lost in the move.
>>
>> I loaded an ontology on the dev-iks sandbox and cannot visualize it
>> anymore. Requesting text/html on
>>
>> http://dev.iks-project.eu:**8081/ontonet/http://www.cs.**
>> unibo.it/~adamou/ontologies/**patterns/distribution/A-split/**
>> op_declusage1.owl<http://dev.iks-project.eu:8081/ontonet/http://www.cs.unibo.it/~adamou/ontologies/patterns/distribution/A-split/op_declusage1.owl>
>>
>> gets me a 500 :
>>
>>      java.io.FileNotFoundException: Template html/org/apache/stanbol/**
>> ontologymanager/web/util/**OntologyStatsResource/ontology not found.
>>
>> I still get the expected resource if I request some other mimetype, say
>> text/turtle.
>>
>> But this can spoil apps such as Protege, which gives up if it receives a
>> 500 on an import request with no Accept header.
>>
>> I found this out when re-running some test for my thesis
>>
>> Any clue?
>>
>> Thanks
>>
>> Alessandro
>>
>>
>>
>>
>> On 11/30/12 10:43 AM, Reto Bachmann-Gmür wrote:
>>
>>> Hello
>>>
>>> At Apacheconeu I've been talking with Rupert and others on how static
>>> resources should be handles. We agreed that they should no longer need to
>>> be referenced in the webfragment. I was in favour of just having a fixed
>>> location in the jar but Rupert convinced me that this default location
>>> should be overwritable with a value in the MANIFEST.MF file. In the long
>>> term it should be possible to have file-backed resources at any location
>>> in
>>> the URI space but as a first step only the architecture for the resources
>>> below "/static/" shall be changed.
>>>
>>> E.g:
>>>
>>> MANIFEST.MF
>>> Stanbol-Static: /META-INF/stanbol-static
>>>
>>> The jar contains
>>>
>>> /META-INF/stanbol-static/**static/hello.txt
>>>
>>> Stanbol will serve that file at
>>>
>>> http://<host>/static/hello.txt
>>>
>>> if the jar contains
>>>
>>> /META-INF/stanbol-static/**hello.txt
>>>
>>> this will for now generate a warning that currently the files must be in a
>>> subfolder called "static" to be served (in future it should be served at
>>> http://<host>/hello.txt).
>>>
>>> Any thoughts? Any volunteers?
>>>
>>> Cheers,
>>> Reto
>>>
>>>
>> --
>> 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
>>
>>


-- 
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: "Static" resources

Posted by Reto Bachmann-Gmür <re...@apache.org>.
Hi Alessandro

So this is unrelated to the static resources. The templates got moved
around independently and before the static resources. Apparently
ontology.ftl didn't make it to the right place. I see 3 templates by that
name:

./ontologymanager/web/src/main/resources/templates/html/org/apache/stanbol/ontologymanager/web/resources/ScopeResource/ontology.ftl
./ontologymanager/web/src/main/resources/templates/html/org/apache/stanbol/ontologymanager/web/resources/OntoNetRootResource/ontology.ftl
./ontologymanager/web/src/main/resources/templates/html/org/apache/stanbol/ontologymanager/web/resources/SessionResource/ontology.ftl


is any of these to be used for the resource served by the the resource
class OntologyStatsResource ?

Cheers,
Reto

On Thu, Dec 13, 2012 at 8:41 PM, Alessandro Adamou <ad...@cs.unibo.it>wrote:

> Uhm... something seems to be lost in the move.
>
> I loaded an ontology on the dev-iks sandbox and cannot visualize it
> anymore. Requesting text/html on
>
> http://dev.iks-project.eu:**8081/ontonet/http://www.cs.**
> unibo.it/~adamou/ontologies/**patterns/distribution/A-split/**
> op_declusage1.owl<http://dev.iks-project.eu:8081/ontonet/http://www.cs.unibo.it/~adamou/ontologies/patterns/distribution/A-split/op_declusage1.owl>
>
> gets me a 500 :
>
>     java.io.FileNotFoundException: Template html/org/apache/stanbol/**
> ontologymanager/web/util/**OntologyStatsResource/ontology not found.
>
> I still get the expected resource if I request some other mimetype, say
> text/turtle.
>
> But this can spoil apps such as Protege, which gives up if it receives a
> 500 on an import request with no Accept header.
>
> I found this out when re-running some test for my thesis
>
> Any clue?
>
> Thanks
>
> Alessandro
>
>
>
>
> On 11/30/12 10:43 AM, Reto Bachmann-Gmür wrote:
>
>> Hello
>>
>> At Apacheconeu I've been talking with Rupert and others on how static
>> resources should be handles. We agreed that they should no longer need to
>> be referenced in the webfragment. I was in favour of just having a fixed
>> location in the jar but Rupert convinced me that this default location
>> should be overwritable with a value in the MANIFEST.MF file. In the long
>> term it should be possible to have file-backed resources at any location
>> in
>> the URI space but as a first step only the architecture for the resources
>> below "/static/" shall be changed.
>>
>> E.g:
>>
>> MANIFEST.MF
>> Stanbol-Static: /META-INF/stanbol-static
>>
>> The jar contains
>>
>> /META-INF/stanbol-static/**static/hello.txt
>>
>> Stanbol will serve that file at
>>
>> http://<host>/static/hello.txt
>>
>> if the jar contains
>>
>> /META-INF/stanbol-static/**hello.txt
>>
>> this will for now generate a warning that currently the files must be in a
>> subfolder called "static" to be served (in future it should be served at
>> http://<host>/hello.txt).
>>
>> Any thoughts? Any volunteers?
>>
>> Cheers,
>> Reto
>>
>>
>
> --
> 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
>
>