A lazy poll - revisited -> a final - verbose - try on cUrl -> ah, it's a &-SPACES curse

From: Patrik Holmer <NNTP.psbh_at_telia.com>
Date: Wed, 15 Feb 2006 16:52:15 +0100

Hi David,

first of all thank's, for the rapid response and secondly, your're right!

It's either a WinXP DOS-box oddity, inserting SPACES in-front-of-and-behind
the '&' character in the command string, or a curse on cURL causing the same
oddity.

Now, trying an old BAT-in-BAT-Pipe-trick of mine. I found the oddity in the
resulting log-file. Pipe-calling a WinXP BAT-file harbouring the following
command, I noted that the command string...

curl -v -d _at_foaf-0.1.rdf
http://localhost:8888/bank/bank?command=upload&format=rdfxml

...is actually read by WinXP or cURL as - and do note the spaces...

C:\TEMP\curl>curl -v -d _at_foaf-0.1.rdf
http://localhost:8888/bank/bank?command=upload & format=rdfxml Ogiltig
enhetsbeteckning.

...where the words 'Ogiltig enhetsbeteckning.' in english could translate
into 'Incorrect Unit Description.' - i.e. Incorrect Drive Letter.

This test was done on WinXP (SE/sv). I'll also try quotes ("/') and give the
test a try on a Linux Ubuntu (US/En)-unit, reporting back ASAP.

// Patrik

-----Ursprungligt meddelande-----
Från: David Huynh [mailto:dfhuynh_at_csail.mit.edu]
Skickat: onsdag den 15 februari 2006 14:41
Till: general_at_simile.mit.edu
Ämne: Re: SV: A lazy poll - revisited -> a final - verbose - try on cUrl

Hi Patrik,

It seems like the parameter format=rdfxml didn't make it according to this
log from the bank:

org.mortbay.http.HttpConnection - POST /bank/bank?command=upload HTTP/1.1

So, the format is N3 by default. Did the URL get truncated somehow?

David

Patrik Holmer wrote:

>Hi,
>
>any ideas anyone, about the following UPLOAD-problem:
>
>Testing semantic-bank-2.1.1 with cUrl and *successfully* loading
>Triple-files (.n3), using the command:
>
>curl -v -d _at_file.n3 http://localhost:8888/bank/bank?command=upload
>
>
>...I've moved on to trying to load RDF/XML-files, with *no success*,
>using the command:
>
>curl -v -d _at_foaf-0.1.rdf
>http://localhost:8888/bank/bank?command=upload&format=rdfxml
>
>
>...homing in on the following fragment from the Semantic-Bank DEBUG output:
>
>2006-02-15 13:30:54,141 [SocketListener0-4] ERROR
>edu.mit.simile.SimileUtilities - Fatal error: Expected '.', found '<'
>at http://localhost:8888/bank/bank# [1,-1]
>
>
>...in the DEBUG-section:
>
>2006-02-15 13:30:54,040 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - > doPost
>2006-02-15 13:30:54,040 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - > makeMessage
>2006-02-15 13:30:54,060 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - < makeMessage
>2006-02-15 13:30:54,060 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - Execute Command: upload
>2006-02-15 13:30:54,141 [SocketListener0-4] ERROR
>edu.mit.simile.SimileUtilities - Fatal error: Expected '.', found '<'
>at http://localhost:8888/bank/bank# [1,-1]
>2006-02-15 13:30:54,141 [SocketListener0-4] ERROR
>edu.mit.simile.semanticBank.servlet.UploadCommand -
>edu.mit.simile.SimileUtilities$ModelReadFromFileException: Failed to
>read data from 'http://localhost:8888/bank/bank#'
>2006-02-15 13:30:54,141 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - < doPost
>2006-02-15 13:30:54,141 [SocketListener0-4] WARN
>org.mortbay.http.HttpConnection - POST /bank/bank?command=upload
>HTTP/1.1 HttpException(400,Bad Request,Missing Content)
>
>...of the full semantic-bank output:
>
><BOF>
>-------------------- Loading -------------------- Processing
>repository: build\eclipse Processing repository: build\classes
>Processing repository: lib Adding folder: lib Adding jar:
>lib\batik-awt-util-1.5.1.jar Adding jar:
>lib\commons-collections-3.1.jar Adding jar:
>lib\commons-logging-1.0.4.jar Adding jar: lib\javax.servlet-5.1.4.jar
>Adding jar: lib\jetty-5.1.4.jar Adding jar: lib\log4j-1.2.11.jar Adding
>jar: lib\longwell.jar Adding jar: lib\lucene-1.4.3.jar Adding jar:
>lib\openrdf-model.jar Adding jar: lib\openrdf-util.jar Adding jar:
>lib\picto-1.0.0.jar Adding jar: lib\rio-1.0.5.jar Adding jar:
>lib\semantic-bank-2.1.1.jar Adding jar: lib\sesame-1.2.2.jar Adding
>jar: lib\velocity-1.4.jar
>-------------------- Executing ----------------- Main Class:
>edu.mit.simile.semanticBank.SemanticBank
>2006-02-15 13:30:43,235 [main] INFO
>edu.mit.simile.semanticBank.SemanticBank - Reading properties file
>C:\TEMP\simile\semantic-bank\semantic-bank.properties
>2006-02-15 13:30:43,235 [main] INFO
>edu.mit.simile.semanticBank.SemanticBank - Starting Semantic Bank:
> common system dir: C:\TEMP\simile\semantic-bank\vault\common
> bank database dir: C:\TEMP\simile\semantic-bank\vault\bank\database
> bank system dir: C:\TEMP\simile\semantic-bank\vault\bank\system
> account dir: C:\TEMP\simile\semantic-bank\vault\accounts
>2006-02-15 13:30:43,255 [main] INFO
>edu.mit.simile.longwell.LongwellServer
>- Creating Longwell server:
> default corpus system dir:
>C:\TEMP\simile\semantic-bank\vault\bank\system
> common system dir: C:\TEMP\simile\semantic-bank\vault\common
>2006-02-15 13:30:43,345 [main] INFO Longwell - Setting up HTTP Server
> host 127.0.0.1
> port 8888
> context /bank
> from C:\TEMP\simile\semantic-bank\src\ui\html
>2006-02-15 13:30:53,770 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - > init
>2006-02-15 13:30:54,020 [SocketListener0-4] ERROR Velocity - VM
>#addNarrowingButton: error : too few arguments to macro. Wanted 3 got 0
>2006-02-15 13:30:54,020 [SocketListener0-4] ERROR Velocity - VM
>#addBroadeningButton: error : too few arguments to macro. Wanted 3 got
>0
>2006-02-15 13:30:54,020 [SocketListener0-4] ERROR Velocity - VM
>#addTextSearchButton: error : too few arguments to macro. Wanted 1 got
>0
>2006-02-15 13:30:54,040 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - < init
>2006-02-15 13:30:54,040 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - > doPost
>2006-02-15 13:30:54,040 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - > makeMessage
>2006-02-15 13:30:54,060 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - < makeMessage
>2006-02-15 13:30:54,060 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - Execute Command: upload
>2006-02-15 13:30:54,141 [SocketListener0-4] ERROR
>edu.mit.simile.SimileUtilities - Fatal error: Expected '.', found '<'
>at http://localhost:8888/bank/bank# [1,-1]
>2006-02-15 13:30:54,141 [SocketListener0-4] ERROR
>edu.mit.simile.semanticBank.servlet.UploadCommand -
>edu.mit.simile.SimileUtilities$ModelReadFromFileException: Failed to
>read data from 'http://localhost:8888/bank/bank#'
>2006-02-15 13:30:54,141 [SocketListener0-4] DEBUG
>edu.mit.simile.longwell.ui.FlairServlet - < doPost
>2006-02-15 13:30:54,141 [SocketListener0-4] WARN
>org.mortbay.http.HttpConnection - POST /bank/bank?command=upload
>HTTP/1.1 HttpException(400,Bad Request,Missing Content)
>
><EOF>
>
>...I've come to the conclusion that I'm missing the obvious, as usual.
>
>So, as mentioned before, any ideas on this, anyone?
>
>// Patrik
>
>
>-----Ursprungligt meddelande-----
>Från: Patrik Holmer [mailto:NNTP.psbh_at_telia.com]
>Skickat: måndag den 13 februari 2006 23:53
>Till: general_at_simile.mit.edu
>Ämne: A lazy poll - revisited
>
>Hi!
>
>I read somewhere in the weekly reports in this forum that Piggy Bank
>has(?) migrated from triple (n3) to rdfxml. So, I figured, I'd leave
>the "curl -v http://foo:8888/bank/bank?command=upload -d _at_file.n3"
>behind and start using "curl -v
>http://foo:8888/bank/bank?command=upload&format=rdfxml -d _at_file.rdf" -
>or rather ""curl -v -d _at_file.rdf...". But, as a user of the TAG:ged
>Semantic-Bank 2.1.1, I always end up HTTPExceptioned 400 - Bad request.
>Same thing happens POST:ing with Libwww and comline. Even when using
>the rdf-files provided by Semantic-Bank 2.1.1 and something as stable as
Ubuntu Linux.
>
>Any ideas, anyone? Steve?
>
>// Patrik
>
>
>-----Ursprungligt meddelande-----
>Från: Steve Dunham [mailto:dunhamsteve_at_gmail.com]
>Skickat: torsdag den 26 januari 2006 20:32
>Till: general_at_simile.mit.edu
>Ämne: Re: A lazy poll - of sorts
>
>On 1/26/06, Patrik Holmer <NNTP.psbh_at_telia.com> wrote:
>
>
>>Before I start-off reinventing the wheel in Semantic Bank...
>>
>>A brief poll on avoiding the stop-restart-routine and the manual
>>"wafer-thin-mint" Monty-routine through Piggy Bank or - say - Sesame
>>for each RDF-file: Has anyone automated a feeding of the monster?
>>
>>
>
>When I've feeling lazy, I tend to use:
>
> curl -v http://foo:8888/bank/bank?command=upload -d _at_file.n3 or
> curl -v http://foo:8888/bank/bank?command=upload&format=rdfxml -d
>_at_file.rdf
>
>One downside is that relative urls (e.g. _at_prefix : <#>) end up munged.
>
>
>
Received on Wed Feb 15 2006 - 15:51:07 EST

This archive was generated by hypermail 2.3.0 : Thu Aug 09 2012 - 16:39:18 EDT