You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by "Fabian Christ (JIRA)" <ji...@apache.org> on 2011/02/22 11:14:38 UTC
[jira] Created: (STANBOL-101) Better control of returned format
Better control of returned format
---------------------------------
Key: STANBOL-101
URL: https://issues.apache.org/jira/browse/STANBOL-101
Project: Stanbol
Issue Type: Improvement
Components: Enhancer
Reporter: Fabian Christ
Currently, you can define the returned format for the Enhancer by setting the 'accept' header. The value of the 'format' field provided in the payload seems not to be used internally.
If you set the accepted content to 'application/json' the Enhancer returns JSON format as expected:
curl -X POST -H "Accept: application/json" -H "Content-type: text/plain" \
--data "Fise can detect famous cities such as Paris." \
http://localhost:8080/engines/
If you leave the accept header blank, JSON-LD format is returned. But there is no way to explicitly force the system to return JSON-LD.
curl -X POST -H "Accept: " -H "Content-type: text/plain" \
--data "Fise can detect famous cities such as Paris." \
http://localhost:8080/engines/
Stanbol should define which is the default format officially and provide a consistent way to control the returned format. Perhaps it would be useful to return the supported formats through the REST API.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (STANBOL-101) Better control of returned format
Posted by "Fabian Christ (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STANBOL-101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabian Christ resolved STANBOL-101.
-----------------------------------
Resolution: Fixed
> Better control of returned format
> ---------------------------------
>
> Key: STANBOL-101
> URL: https://issues.apache.org/jira/browse/STANBOL-101
> Project: Stanbol
> Issue Type: Improvement
> Components: Enhancer
> Reporter: Fabian Christ
> Assignee: Fabian Christ
> Labels: Accept-Header, Enhancer,, Format,
>
> Currently, you can define the returned format for the Enhancer by setting the 'accept' header. The value of the 'format' field provided in the payload seems not to be used internally.
> If you set the accepted content to 'application/json' the Enhancer returns JSON format as expected:
> curl -X POST -H "Accept: application/json" -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> If you leave the accept header blank, JSON-LD format is returned. But there is no way to explicitly force the system to return JSON-LD.
> curl -X POST -H "Accept: " -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> Stanbol should define which is the default format officially and provide a consistent way to control the returned format. Perhaps it would be useful to return the supported formats through the REST API.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (STANBOL-101) Better control of returned format
Posted by "Tommaso Teofili (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STANBOL-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997827#comment-12997827 ]
Tommaso Teofili commented on STANBOL-101:
-----------------------------------------
bq. I suggest, thatr equests with unsupported "Accept:" headers return "406 Not Acceptable".
+1
> Better control of returned format
> ---------------------------------
>
> Key: STANBOL-101
> URL: https://issues.apache.org/jira/browse/STANBOL-101
> Project: Stanbol
> Issue Type: Improvement
> Components: Enhancer
> Reporter: Fabian Christ
> Labels: Accept-Header, Enhancer,, Format,
>
> Currently, you can define the returned format for the Enhancer by setting the 'accept' header. The value of the 'format' field provided in the payload seems not to be used internally.
> If you set the accepted content to 'application/json' the Enhancer returns JSON format as expected:
> curl -X POST -H "Accept: application/json" -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> If you leave the accept header blank, JSON-LD format is returned. But there is no way to explicitly force the system to return JSON-LD.
> curl -X POST -H "Accept: " -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> Stanbol should define which is the default format officially and provide a consistent way to control the returned format. Perhaps it would be useful to return the supported formats through the REST API.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (STANBOL-101) Better control of returned format
Posted by "Rupert Westenthaler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STANBOL-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997826#comment-12997826 ]
Rupert Westenthaler commented on STANBOL-101:
---------------------------------------------
I suggest, thatr equests with unsupported "Accept:" headers return "406 Not Acceptable".
Such responses provide a list of all supported formats.
best Rupert
> Better control of returned format
> ---------------------------------
>
> Key: STANBOL-101
> URL: https://issues.apache.org/jira/browse/STANBOL-101
> Project: Stanbol
> Issue Type: Improvement
> Components: Enhancer
> Reporter: Fabian Christ
> Labels: Accept-Header, Enhancer,, Format,
>
> Currently, you can define the returned format for the Enhancer by setting the 'accept' header. The value of the 'format' field provided in the payload seems not to be used internally.
> If you set the accepted content to 'application/json' the Enhancer returns JSON format as expected:
> curl -X POST -H "Accept: application/json" -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> If you leave the accept header blank, JSON-LD format is returned. But there is no way to explicitly force the system to return JSON-LD.
> curl -X POST -H "Accept: " -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> Stanbol should define which is the default format officially and provide a consistent way to control the returned format. Perhaps it would be useful to return the supported formats through the REST API.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (STANBOL-101) Better control of returned format
Posted by "Fabian Christ (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STANBOL-101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fabian Christ reassigned STANBOL-101:
-------------------------------------
Assignee: Fabian Christ
> Better control of returned format
> ---------------------------------
>
> Key: STANBOL-101
> URL: https://issues.apache.org/jira/browse/STANBOL-101
> Project: Stanbol
> Issue Type: Improvement
> Components: Enhancer
> Reporter: Fabian Christ
> Assignee: Fabian Christ
> Labels: Accept-Header, Enhancer,, Format,
>
> Currently, you can define the returned format for the Enhancer by setting the 'accept' header. The value of the 'format' field provided in the payload seems not to be used internally.
> If you set the accepted content to 'application/json' the Enhancer returns JSON format as expected:
> curl -X POST -H "Accept: application/json" -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> If you leave the accept header blank, JSON-LD format is returned. But there is no way to explicitly force the system to return JSON-LD.
> curl -X POST -H "Accept: " -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> Stanbol should define which is the default format officially and provide a consistent way to control the returned format. Perhaps it would be useful to return the supported formats through the REST API.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (STANBOL-101) Better control of returned format
Posted by "Fabian Christ (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STANBOL-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997748#comment-12997748 ]
Fabian Christ commented on STANBOL-101:
---------------------------------------
curl -X POST -H "Accept: application/rdf+nt" -H "Content-type: text/plain" --data "Fise can detect famous cities such as Paris." http://localhost:8080/engines/
throws an exception
22.02.2011 12:10:35 com.sun.jersey.spi.container.ContainerResponse write
SCHWERWIEGEND: A message body writer for Java class org.apache.clerezza.rdf.core.impl.SimpleMGraph, and Java type class org.apache.clerezza.rdf.core.impl.SimpleMGraph, and MIME media type application/octet-stream was not found
22.02.2011 12:10:35 com.sun.jersey.spi.container.ContainerResponse traceException
SCHWERWIEGEND: Mapped exception to response: 500 (Internal Server Error)
javax.ws.rs.WebApplicationException
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:267)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1035)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:947)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:938)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:399)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:478)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:663)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:91)
at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:77)
at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)
at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> Better control of returned format
> ---------------------------------
>
> Key: STANBOL-101
> URL: https://issues.apache.org/jira/browse/STANBOL-101
> Project: Stanbol
> Issue Type: Improvement
> Components: Enhancer
> Reporter: Fabian Christ
> Labels: Accept-Header, Enhancer,, Format,
>
> Currently, you can define the returned format for the Enhancer by setting the 'accept' header. The value of the 'format' field provided in the payload seems not to be used internally.
> If you set the accepted content to 'application/json' the Enhancer returns JSON format as expected:
> curl -X POST -H "Accept: application/json" -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> If you leave the accept header blank, JSON-LD format is returned. But there is no way to explicitly force the system to return JSON-LD.
> curl -X POST -H "Accept: " -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> Stanbol should define which is the default format officially and provide a consistent way to control the returned format. Perhaps it would be useful to return the supported formats through the REST API.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (STANBOL-101) Better control of returned format
Posted by "Olivier Grisel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STANBOL-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997835#comment-12997835 ]
Olivier Grisel commented on STANBOL-101:
----------------------------------------
+1 for 406 with the list too.
> Better control of returned format
> ---------------------------------
>
> Key: STANBOL-101
> URL: https://issues.apache.org/jira/browse/STANBOL-101
> Project: Stanbol
> Issue Type: Improvement
> Components: Enhancer
> Reporter: Fabian Christ
> Labels: Accept-Header, Enhancer,, Format,
>
> Currently, you can define the returned format for the Enhancer by setting the 'accept' header. The value of the 'format' field provided in the payload seems not to be used internally.
> If you set the accepted content to 'application/json' the Enhancer returns JSON format as expected:
> curl -X POST -H "Accept: application/json" -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> If you leave the accept header blank, JSON-LD format is returned. But there is no way to explicitly force the system to return JSON-LD.
> curl -X POST -H "Accept: " -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> Stanbol should define which is the default format officially and provide a consistent way to control the returned format. Perhaps it would be useful to return the supported formats through the REST API.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (STANBOL-101) Better control of returned format
Posted by "Fabian Christ (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STANBOL-101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997747#comment-12997747 ]
Fabian Christ commented on STANBOL-101:
---------------------------------------
It turns out that 'application/json' and 'application/rdf+json' returns the results in the same format.
> Better control of returned format
> ---------------------------------
>
> Key: STANBOL-101
> URL: https://issues.apache.org/jira/browse/STANBOL-101
> Project: Stanbol
> Issue Type: Improvement
> Components: Enhancer
> Reporter: Fabian Christ
> Labels: Accept-Header, Enhancer,, Format,
>
> Currently, you can define the returned format for the Enhancer by setting the 'accept' header. The value of the 'format' field provided in the payload seems not to be used internally.
> If you set the accepted content to 'application/json' the Enhancer returns JSON format as expected:
> curl -X POST -H "Accept: application/json" -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> If you leave the accept header blank, JSON-LD format is returned. But there is no way to explicitly force the system to return JSON-LD.
> curl -X POST -H "Accept: " -H "Content-type: text/plain" \
> --data "Fise can detect famous cities such as Paris." \
> http://localhost:8080/engines/
> Stanbol should define which is the default format officially and provide a consistent way to control the returned format. Perhaps it would be useful to return the supported formats through the REST API.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira