Hi
I've been going literally MAD over the last few days on a bizarre
phenomenon:
if I POST an ontology
1) in Turtle/N3/N-Triple format on an OntoNet Scope/Session/whatever,
2) I use the service that accepts the payload as
application/x-www-form-urlencoded
3) and that ontology has inline comments (starting in '#'),
then whatever follows that comment is truncated.
Say I have the following code
==================
@prefix : <http://stanbol.apache.org/ontologies/test/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@base <http://stanbol.apache.org/ontologies/test/turtle/sample/comments> .
<http://stanbol.apache.org/ontologies/test/turtle/triples/sample/comments>
rdf:type owl:Ontology .
# Comment
:SomeClazz rdf:type owl:Class .
:SomeThing1 rdf:type :SomeClazz .
==================
stored in the file turtle-comments.rdf
then I do
% curl -i -X PUT http://localhost:8080/ontonet/session/s1
% curl -i -X POST -H "Content-type: text/turtle" -d @turtle-comments.rdf
http://localhost:8080//ontonet/session/s1
Then when I GET the new resource
curl -i -H "Accept: application/rdf+xml"
http://localhost:8080/ontonet/session/s1/http://stanbol.apache.org/ontologies/test/turtle/triples/sample/comments
the last two triples are missing!
Instead, if I force post binary data, as in
% curl -i -X POST -H "Content-type: text/turtle" --data-binary
@turtle-comments.rdf http://localhost:8080//ontonet/session/s1
it seems to work.
It also works if I POST using the multipart/form-data variant
% curl -i -X POST -F "format=text/turtle" -F [email protected]
http://localhost:8080/ontonet/session/s1
and both variants do exactly the same thing: they create a
GraphContentInputSource object out of a BufferedInputStream that wraps
the InputStream they get:
- for application/x-www-form-urlencoded it is a
org.mortbay.jetty.HttpParser.Input
- for multipart/form-data it is a FileInputStream
Something seems to be going very wrong when the hash character is
URLencoded, but apparently when it is used in namespaces it doesn't seem
to be a problem.
Not a big deal if I can just get away with it by using --data-binary,
but it's taken me two days to find out.
Does anybody know if this is normal?
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