[Attempto] [Illegal argument: arglist_namevaluelist/2 error]

Mohammed Nasri mohammed.nasri at gmail.com
Fri Feb 5 13:44:16 CET 2016


Hi, 

Ok, thank you.

Envoyé de mon iPad

> Le 3 févr. 2016 à 00:21, Kaarel Kaljurand <kaljurand at gmail.com> a écrit :
> 
> Hi,
> 
> regarding starting/stopping the APE server, the idea would be to use
> the same session for multiple inputs/outputs and even for multiple
> users. I'm not sure what's the best way to start/stop the server
> programmatically. We have used launchd on MacOS and cron jobs on
> Linux, and simply left the server running continuously, automatically
> starting it on reboot.
> 
> On Linux you can stop the server by killing its process.
> 
> $ nohup swipl -x ape.exe -- -httpserver -port 8001 > stdout.txt 2> stderr.txt &
> [1] 6408
> 
> $ ps ax | fgrep "ape.exe"
> 6408 pts/1    Sl     0:00 swipl -x ape.exe -- -httpserver -port 8001
> 6412 pts/1    S+     0:00 fgrep --color=auto ape.exe
> 
> $ kill 6408
> 
> $ ps ax | fgrep "ape.exe"
> 6414 pts/1    S+     0:00 fgrep --color=auto ape.exe
> [1]+  Terminated              nohup swipl -x ape.exe -- -httpserver
> -port 8001 > stdout.txt 2> stderr.txt
> 
> You should search for a solution that best matches your OS and
> programming language to perform these operations in the simplest and
> most reliable manner.
> 
> Best,
> Kaarel
> 
> On Mon, Feb 1, 2016 at 12:07 PM, Mohammed Nasri
> <mohammed.nasri at gmail.com> wrote:
>> Hi Kaarel,
>> 
>> ---------------
>> Sincères salutations
>> Mohammed NASRI
>> 
>> 2016-01-31 23:38 GMT+00:00 Kaarel Kaljurand <kaljurand at gmail.com>:
>>> 
>>> Hi,
>>> 
>>> you don't need to have an internet connection to use the HTTP-based
>>> service (i.e. APEWebservice). Just start the server:
>>> 
>>>    ./ape.exe -httpserver
>>> 
>>> and then call from your application, e.g.
>>> 
>>> http://localhost:8000/?text=Every+man+is+a+human.&solo=drsxml
>> 
>> 
>> Ok, I think it's a good solution. the only concern is the fact that in our
>> platform (Amine), things must not be complicated for users, which are often
>> not computer scientists, so they would not have to run any external program.
>> If the APE HTTP server start/stop operations can be performed
>> programmatically, it would be perfect, the platform runs the server before
>> the analysis of the ACE text, and stop it once the DRS is generated.
>> 
>> What do you think ? and if the command line ape.exe -httpserver runs the
>> server, how to stop it ?
>> 
>>> 
>>> 
>>> and parse the result. Actually the Java Interface for APE does the
>>> parsing for you, see the Javadoc
>>> http://attempto.ifi.uzh.ch/site/docs/java/apidocs/index.html and a
>>> concrete example how to use the webservice:
>>> 
>>> 
>>> https://github.com/Attempto/APE/blob/master/java/src/test/java/ch/uzh/ifi/attempto/ape/APEWebserviceTest.java
>>> 
>>> i.e. you just need to start the server and have attempto-ape.jar on
>>> your classpath to be able to use it via simple Java methods.
>> 
>> 
>> It's perfect.
>> 
>>> 
>>> 
>>> I agree, getting the JPL-based access (i.e. APELocal) to work is
>>> complicated. That's one of the reasons I prefer the HTTP-interface.
>>> Your error (NoClassDefFoundError) indicates that JPL is not found on
>>> the Java class path. Have you tried the instructions on
>>> https://github.com/Attempto/APE/tree/master/java? I just tried, and
>>> all the tests worked (mvn test). I had to make the following
>>> modification:
>>> 
>>> 
>>> https://github.com/Attempto/APE/commit/b1eab4e0640ab09fecdeb69ccccb8473dd4af947
>>> 
>> 
>> I made the modifications, but I have probably a jar versionning problem, the
>> version of my jpl is 7 (because I have SWI-Prolog 7.3.16), which is, I
>> suppose, not compatible with the attempto-ape.jar.
>> 
>>> You probably need to do something similar. (We don't currently have a
>>> more general solution, that would work out of the box.)
>>> 
>>> I'd prefer to continue this discussion on the mailing list, in this
>>> way other users can profit from it as well.
>>> 
>>> 
>>> Best,
>>> Kaarel
>>> 
>>> 
>>> On Sun, Jan 31, 2016 at 11:33 PM, Mohammed Nasri
>>> <mohammed.nasri at gmail.com> wrote:
>>>> Hi Kaarel,
>>>> 
>>>> Thank you for you answers and your suggestions.
>>>> 
>>>> For information, here is the exact command line I generate :
>>>> /Users/mohammednasri/Travail/TLN/tln/tools/APE/ape.exe -text "John eats
>>>> an
>>>> apple." -solo drsxml
>>>> 
>>>> When I copy/paste this line and run it in the terminal, it seems to be
>>>> correct, but with the java application, I get the following error :
>>>> ERROR: Illegal argument: arglist_namevaluelist/2: eats
>>>> 
>>>> Otherwise, I cannot use the APE HTTP interface if it requires an
>>>> internet
>>>> connection.
>>>> 
>>>> I suppose, on the other hand, that the Java bridge is the best solution,
>>>> if
>>>> it calls the locat APE instance. The problem with this bridge is, in my
>>>> opinion, so complicated to implement. I tried many times but in vain.
>>>> Today,
>>>> I began from the begining, I installed the SWI prolog 7.3.16
>>>> (recommended
>>>> for mac os El Captain), it contains the jpl.jar library and I created a
>>>> new
>>>> java application. In this application I added the attempto-ape.jar and
>>>> the
>>>> jpl.jar libraries, I created a sample class with the following code :
>>>> 
>>>> String s = APELocal.getInstance().getSoloOutput("John eats an apple.",
>>>> OutputType.DRSXML);
>>>> System.out.println(s);
>>>> 
>>>> But I get this error : Exception in thread "main"
>>>> java.lang.NoClassDefFoundError: jpl/Term
>>>> 
>>>> I tried an other solution, by following the steps you recommend in the
>>>> https://github.com/Attempto/APE/tree/master/java.
>>>> I created a new maven project, with the pom you gave in the URL. But I
>>>> always get the error that the artifact jpl:jpl:jar:6.4.1 is missing, I
>>>> tried
>>>> others versions of the jar: 2.0.2 and 1.0.1 but in vain.
>>>> 
>>>> Now if you already have a java project with all the dependencies or a
>>>> java
>>>> project that successefully run the APE local project, I would be very
>>>> thankfull if you can shared it with me.
>>>> 
>>>> Best regards.
>>>> 
>>>> ---------------
>>>> Sincères salutations
>>>> Mohammed NASRI
>>>> 
>>>> Hi,
>>>> 
>>>> it's hard to tell for sure without seeing the actual command line that
>>>> is generated by the application, but I suspect that the quotation
>>>> marks are not represented correctly and APE thinks that "eats" is not
>>>> meant to be part of the input text but some (unsupported) command.
>>>> 
>>>> May I suggest to call APE via its HTTP interface
>>>> (https://github.com/Attempto/APE#http-interface-to-ape) or the Java
>>>> bridge (https://github.com/Attempto/APE/tree/master/java). It would be
>>>> _much_ faster and would also avoid errors in commandline generation.
>>>> 
>>>> Best,
>>>> Kaarel
>>>> 
>>>> On Fri, Jan 29, 2016 at 4:59 PM, Mohammed Nasri
>>>> <mohammed.nasri at gmail.com> wrote:
>>>>> Hello,
>>>>> 
>>>>> I developed a Java application that uses APE (Attempto Parser Engine).
>>>>> In
>>>>> this application, I get the ACE text from a input text field and then I
>>>>> generate the command line to be passed to APE.
>>>>> 
>>>>> For example, the command line I generate for the following example :
>>>>> "John
>>>>> eats an apple." is :
>>>>> 
>>>>> APE_PATH/ape.exe -text "John eats an apple." -solo drsxml
>>>>> or
>>>>> APE_PATH/ape.exe -noclex -ulexfile CUSTOM_CLEX_PATH/clex_lexicon.pl
>>>>> -text
>>>>> "John eats an apple." -solo drsxml
>>>>> 
>>>>> Depending on whether we use or not a custom clex file.
>>>>> 
>>>>> When I run these two command lines in the terminal directly, APE works
>>>>> fine
>>>>> and prints the following same result:
>>>>> 
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> 
>>>>> <DRS domain="A B">
>>>>>  <object
>>>>>      ref="A"
>>>>>      noun="apple"
>>>>>      struct="countable"
>>>>>      unit="na"
>>>>>      numrel="eq"
>>>>>      num="1"
>>>>>      sentid="1"
>>>>>      tokid="4"/>
>>>>>  <predicate
>>>>>      ref="B"
>>>>>      verb="eat"
>>>>>      subj="named('John')"
>>>>>      obj="A"
>>>>>      sentid="1"
>>>>>      tokid="2"/>
>>>>> </DRS>
>>>>> 
>>>>> But when I run this sentence within my application, I get this error :
>>>>> 
>>>>> Illegal argument: arglist_namevaluelist/2: eats
>>>>> 
>>>>> Do you have any idea of what can be the source of the issue ?
>>>>> 
>>>>> Thank you.
>>>>> 
>>>>> 
>>>>> ---------------
>>>>> Sincères salutations
>>>>> Mohammed NASRI
>> 
>> 


More information about the attempto mailing list