| Constant summary | |
|---|---|
| +ape-webservice-url+ | "http://attempto.ifi.uzh.ch/ws/ape/apews.perl" |
| Class summary | |
|---|---|
| ape-result | |
| duration | |
| Condition summary | |
|---|---|
| ape-condition | inherits from condition |
| ape-error | inherits from error and ape-condition |
| message | inherits from ape-condition |
| Method summary | |
|---|---|
| ape-error-type | ape-error |
| ape-result-drs | ape-result |
| ape-result-drshtml | ape-result |
| ape-result-drspp | ape-result |
| ape-result-drsxml | ape-result |
| ape-result-duration | ape-result |
| ape-result-fol | ape-result |
| ape-result-input | ape-result |
| ape-result-messages | ape-result |
| ape-result-owlfss | ape-result |
| ape-result-owlfsspp | ape-result |
| ape-result-owlrdf | ape-result |
| ape-result-owlxml | ape-result |
| ape-result-paraphrase | ape-result |
| ape-result-paraphrase1 | ape-result |
| ape-result-paraphrase2 | ape-result |
| ape-result-pnf | ape-result |
| ape-result-ruleml | ape-result |
| ape-result-sentences | ape-result |
| ape-result-syntax | ape-result |
| ape-result-syntaxd | ape-result |
| ape-result-syntaxdpp | ape-result |
| ape-result-syntaxpp | ape-result |
| ape-result-timestamp | ape-result |
| ape-result-tokens | ape-result |
| duration-parser | duration |
| duration-refres | duration |
| duration-tokenizer | duration |
| message-importance | message |
| message-repair | message |
| message-sentence | message |
| message-token | message |
| message-type | message |
| message-value | message |
| Function summary | |
|---|---|
| ape | &rest args &key (solo nil solop) (signal-warning-messages t) (signal-error-messages nil) &allow-other-keys |
| invoke-ape-webservice | &key (text nil text-p) (file nil file-p) (ulextext nil ulextext-p) (ulexfile nil ulexfile-p) (ulexreload nil ulexreload-p) (cdrs nil cdrs-p) (cdrsxml nil cdrsxml-p) (cdrspp nil cdrspp-p) (cdrshtml nil cdrshtml-p) (cparaphrase nil cparaphrase-p) (cparaphrase1 nil cparaphrase1-p) (cparaphrase2 nil cparaphrase2-p) (ctokens nil ctokens-p) (csentences nil csentences-p) (csyntax nil csyntax-p) (csyntaxpp nil csyntaxpp-p) (csyntaxd nil csyntaxd-p) (csyntaxdpp nil csyntaxdpp-p) (cowlfss nil cowlfss-p) (cowlfsspp nil cowlfsspp-p) (cowlrdf nil cowlrdf-p) (cowlxml nil cowlxml-p) (cfol nil cfol-p) (cpnf nil cpnf-p) (solo nil solo-p) (uri nil uri-p) (noclex nil noclex-p) (guess nil guess-p) (cruleml nil cruleml-p) (ctptp nil ctptp-p) (url +ape-webservice-url+) (drakma-arguments (quote (:method :post))) |
| :duration | [Initarg] |
| :input | [Initarg] |
| :tokens | [Initarg] |
| :sentences | [Initarg] |
| :drs | [Initarg] |
| :syntax | [Initarg] |
| :syntaxpp | [Initarg] |
| :syntaxd | [Initarg] |
| :syntaxdpp | [Initarg] |
| :drspp | [Initarg] |
| :drsxml | [Initarg] |
| :drshtml | [Initarg] |
| :paraphrase | [Initarg] |
| :paraphrase1 | [Initarg] |
| :paraphrase2 | [Initarg] |
| :owlrdf | [Initarg] |
| :owlfss | [Initarg] |
| :owlfsspp | [Initarg] |
| :owlxml | [Initarg] |
| :ruleml | [Initarg] |
| :fol | [Initarg] |
| :pnf | [Initarg] |
| :tptp | [Initarg] |
| :messages | [Initarg] |
| :timestamp | [Initarg] |
| messages | [Slot] |
The value of this slot is a list of message objects.
| timestamp | [Slot] |
The value of this slot is an xsd:date
Returns the timestamp of the specified ape-result
Returns the paraphrase2 of the specified ape-result
Returns the paraphrase1 of the specified ape-result
Returns the paraphrase of the specified ape-result
Returns the syntaxdpp of the specified ape-result
Returns the sentences of the specified ape-result
| :tokenizer | [Initarg] |
| :parser | [Initarg] |
| :refres | [Initarg] |
The type of conditions created, and possibly signalled, by the functions relating to the ape-webservice. The direct subtypes of ape-condition are ape-error (representing failures in the APE webservice), and message (representing the messages of ape-result objects).
| ape-error | inherits from error and ape-condition | [Condition] |
The parent type of ape-errors---those that occur when the APE webservice returns a single error element as output. The type of the error can be extracted using ape-error-type. The actual condition types that are used are child type of ape-error. They are
{define-condition ape-webservice:fetch-acetext-error}
{define-condition ape-webservice:fetch-lexicon-error}
{define-condition ape-webservice:socket-init-error}
{define-condition ape-webservice:socket-connect-error}
{define-condition ape-webservice:socket-close-error}
{define-condition ape-webservice:logfile-open-error}
{define-condition ape-webservice:logfile-close-error}
{define-condition ape-webservice:ulex-open-error}
{define-condition ape-webservice:ulex-close-error}
| type | [Slot] |
An object of type ape-error-type, that is one of the keywords :fetch-acetext, :fetch-lexicon, :socket-init, :socket-connect, :socket-close, :logfile-open, :logfile-close, :ulex-open, and :ulex-close.
| message | inherits from ape-condition | [Condition] |
The message condition type is a parent-type of both the {define-condition ape-webservice:ape-warning-message}and {define-condition ape-webservice:ape-error-message}conditions types. The readers defined for the message condition should be used for accessing the slots of any instances (and the APE Output Specification defines only the message element). The specialized child condition types are used to effect the default behavior for errors and warnings when the objects are signalled.
| :sentence | [Initarg] |
| :token | [Initarg] |
| :value | [Initarg] |
| :repair | [Initarg] |
| ape-error-type | (quote (member :fetch-acetext :fetch-lexicon :socket-init :socket-connect :socket-close :logfile-open :logfile-close :ulex-open :ulex-close)) | [Type] |
Objects which are ace-error types are the nine keyword symbols, :fetch-acetext, :fetch-lexicon, :socket-init, :socket-connect, :socket-close, :logfile-open, :logfile-close, :ulex-open, and :ulex-close. Each keyword xxx-yyy represents corresponds to the string "ace xxx yyy" that is a possible value for the type attribute of an ape-error-object.
Objects that are message-importances are the keywords :error and :warning, corresponding to the strings "error" and "warning" which may be the values of the importance attribute of message elements.
| message-type | (quote (member :character :word :sentence :syntax :anaphor :timelimit :lexicon :owl :ape)) | [Type] |
Objects that are message-types are the keywords :character, :word, :sentence, :syntax, :anaphor, :timelimit, :lexicon, :owl, and :ape, which corresponding to the strings may be the values of the type attribute of message elements.
The URL of the APE webservice. This has the value http://attempto.ifi.uzh.ch/ws/ape/apews.perl .
| invoke-ape-webservice | &key (text nil text-p) (file nil file-p) (ulextext nil ulextext-p) (ulexfile nil ulexfile-p) (ulexreload nil ulexreload-p) (cdrs nil cdrs-p) (cdrsxml nil cdrsxml-p) (cdrspp nil cdrspp-p) (cdrshtml nil cdrshtml-p) (cparaphrase nil cparaphrase-p) (cparaphrase1 nil cparaphrase1-p) (cparaphrase2 nil cparaphrase2-p) (ctokens nil ctokens-p) (csentences nil csentences-p) (csyntax nil csyntax-p) (csyntaxpp nil csyntaxpp-p) (csyntaxd nil csyntaxd-p) (csyntaxdpp nil csyntaxdpp-p) (cowlfss nil cowlfss-p) (cowlfsspp nil cowlfsspp-p) (cowlrdf nil cowlrdf-p) (cowlxml nil cowlxml-p) (cfol nil cfol-p) (cpnf nil cpnf-p) (solo nil solo-p) (uri nil uri-p) (noclex nil noclex-p) (guess nil guess-p) (cruleml nil cruleml-p) (ctptp nil ctptp-p) (url +ape-webservice-url+) (drakma-arguments (quote (:method :post))) | [Function] |
invoke-ace-webservice &rest args => result*
args --- a plist of arguments
url --- a string or PURI:URI object, default is {defconstant +ape-webservice-url+}
drakma-arguments --- a plist, defaults to '(:method :post)
results --- results from drakma:http-request
Most of the keyword arguments are derived from (and share names) with the APE Webservice [1]. Arguments with on|off values are boolean flags, each generalized booleans. Arguments which accept text or URL/URIs accepts strings. The solo argument should be a string designator, and its value is string-downcased before being passed to the webservice. url is the URL to which the request will be sent. The value of drakma-arguments should be a plist, and will be passed to drakma:http-request. drakma-arguments may contain any arguments that drakma:http-request accepts, but invoke-ape-webservice builds and passes a :parameters argument given before drakma-arguments, so the :parameters argument will be ignored.
The results are returned directly from drakma:http-request [2]. The url for the request is the value of +ape-webservice-url+, the method is :post, and the parameters are constructed based on args. All other arguments assume their default values.
The cruleml option is supported by the websevice, and the XML Schema specification for APE output [3] includes a ruleml field. However, the APE Webservice Specification [1] does not actually mention the cruleml option. See the the message Attempto mailing list message "RuleML question" [4] for more information.
The value of drakma-arguments has a default value '(:method :post), since the queries, depending on the options used, can grow to be rather large. Thus, when specifying a drakma-arguments argument, it may be wise to include :method :post.
[1] http://attempto.ifi.uzh.ch/site/docs/ape_webservice.html
[3] http://attempto.ifi.uzh.ch/site/docs/XMLSchema/apews_output.xsd
[4] {https://lists.ifi.uzh.ch/pipermail/attempto/2009-February/000137.html}
| ape | &rest args &key (solo nil solop) (signal-warning-messages t) (signal-error-messages nil) &allow-other-keys | [Function] |
ape &rest args &key signal-ape-warnings signal-ape-errors => result
args --- arguments to invoke-ape-webservice
signal-warnings-messages, signal-error-messages --- generalized booleans, defaulting to t and nil, respectively
result --- an ape-result or ape-error
Ape invokes the APE-webservice using invoke-ape-webservice (to which args are passed directly), but differs from invoke-ape-webservice in that the resulting ape-result or {defclass ape-webservice:ape-error}is parsed into lisp objects, and appropriate conversions to lisp data structures are performed where possible and supported. When the solo parameter is provided, (even when nil) no parsing or conversion is done, and ape behaves as is the same calling invoke-ape-webservice .
When signal-warning-messages is non-nil (the default), each message whose importance is :warning is signalled using WARN. When signal-error-messages is non-nil, each message whose importance is :error is signalled with ERROR. These flags affect only the messages of an ape-result . Every ape-error produced by the webservice is signalled with ERROR.
The conversions currently supported are as follows:
All ape-result and error XML outputs are cast into corresponding CLOS classes (and all with the same name as their ACE counterpart, with the single exception of error, which becomes ape-error ).
The messages slot of the ape-result object is a list of messages.
Floating point values in duration objects are parsed from XML attribute strings.
Enumerated string values are recast as keyword symbols, usually with the same name (with appropriate case conversions). The various failure strings, however, have a bit more processing. E.g., "fail fetch acetext" become :fetch-acetext.
The most significant processing to lisp objects is the parsing of the DRSXML output to the drs objects (whose API is exported from the ACE-DRS package).
Note that not all messages with type error indicate that call to the webservice was completely unsuccessful. For instance, the sentence "John believes that Mary likes Bill." is valid ACE, but will cause an error message to be generated if cowlfss is also non-nil, since sentence subordination is not supported in OWL. This is the rationale for signalling warnings, but not errors, by default.