System-wide components in the QALL-ME Framework are WS components which are neither language nor location dependent and which can thus be implemented only once and then be used system-widely. The core framework brings implementations for all system-wide components. These implementations can either be used directly or they can be modified to suit specific needs; the Java source code of all component implementations is freely available (cf. 4.1).
The LanguageIdentifier
is a WS
which provides a single web method for the identification of the language of a
given natural language text string. Its WSDL description can
be found under src/main/net/sf/qallme/res/wsdl/languageidentification.wsdl
. The
system-wide framework implementation in Java is the class net.sf.qallme.LanguageIdentifierWSProvider
.
The LanguageIdentifier
has the following web
methods:
The getLanguage
web method tries to determine the
language of a given natural language text string. The identified language is
represented as a two-letter, lower-case ISO 639-1 alpha-2 language code.
Implementations may return “UND” (cf. RFC 3066) as the language code if
they absolutely cannot identify the language of the given text, e.g., for an
empty input text string. However, this should only be done if really in doubt,
not if just unsure. In reverse, the caller of this web method should know this
policy and must be aware that 100 % correct results are not always possible
in language identification.
Sample request (SOAP body):
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:qal="http://qallme.sf.net/wsdl/qallmeshared.wsdl"> <qal:string>¿Qué películas puedo ver en el cine Schmelzer Lichtspiele?</qal:string> </soapenv:Body>
Sample response (SOAP body):
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <languageCode xmlns="http://qallme.sf.net/wsdl/qallmeshared.wsdl">es</languageCode> </soapenv:Body>
The QAPlanner
is a WS which
encapsulates a complete QA system based on the
QALL-ME Framework. Its main operation is the
answerQuestion
web method which returns an
RDF answer graph for a
given natural language question string with spatiotemporal context. The
WSs which are used in the underlying QA
subsystems can be exchanged at runtime. The QAPlanner
’s
WSDL description can be found under src/main/net/sf/qallme/res/wsdl/qaplanner.wsdl
. The system-wide
framework implementation in Java is the class net.sf.qallme.QAPlannerWSProvider
.
The QAPlanner
has the following web methods:
The answerQuestion
web method is the main
operation of the QAPlanner
. It returns an
RDF answer graph for a given inquiry consisting of a natural
language question string and the spatiotemporal context of the question. If the
question cannot be answered for some reason, then an empty RDF
graph is returned.
Sample request (SOAP body):
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <qap:inquiry xmlns:qap="http://qallme.sf.net/xsd/qaplanner.xsd" xmlns:qal="http://qallme.sf.net/xsd/qallmeshared.xsd"> <qap:question>Was für eine Art von Film ist Dreamgirls?</qap:question> <qal:spatiotemporalContext> <qal:location lat="49.256409" lon="7.042437">DE</qal:location> <qal:time>2007-03-18T12:58:21</qal:time> </qal:spatiotemporalContext> </qap:inquiry> </soapenv:Body>
Sample response (SOAP body):
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <RDFGraph xmlns="http://qallme.dfki.de/xsd/qallmeshared.xsd"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:qma="http://qallme.fbk.eu/ontology/qallme-answers.owl#" xmlns:qmo="http://qallme.itc.it/ontology/qallme-tourism.owl#"> <qma:AnswersObject rdf:about="http://qallme.fbk.eu/ontology/qallme-answers.owl#AnswerInstance"> <qma:hasAnswerValue> <rdf:Description rdf:about="http://qallme.itc.it/ontology/qallme-tourism.owl#Genre_musical"> <qmo:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">musical</qmo:name> </rdf:Description> </qma:hasAnswerValue> <qma:hasAnswerValue> <rdf:Description rdf:about="http://qallme.itc.it/ontology/qallme-tourism.owl#Genre_drama"> <qmo:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">drama</qmo:name> </rdf:Description> </qma:hasAnswerValue> </qma:AnswersObject> <qmo:Movie rdf:about="http://qallme.itc.it/ontology/qallme-tourism.owl#Movie_DFKI_5934"> <qmo:hasGenre rdf:resource="http://qallme.itc.it/ontology/qallme-tourism.owl#Genre_musical"/> <qmo:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Dreamgirls</qmo:name> <qmo:hasGenre rdf:resource="http://qallme.itc.it/ontology/qallme-tourism.owl#Genre_drama"/> </qmo:Movie> </rdf:RDF> </RDFGraph> </soapenv:Body>
The setComponent
web method tells the
QAPlanner
to use a given component implementation for
QA. The method must be used for initializing the
QAPlanner
with all component implementations it shall
manage. The method may be used again later to replace a certain component
implementation with another one. If any part of the request is not valid or if
the given WS implementation cannot be invoked, then an
IllegalArgumentFault is thrown.
Each component implementation is specified by the URL of
its WSDL description (cf. <wsdlURL>
in the request). Additionally the caller has to specify
which type of component shall be set with the given implementation (cf. <componentID>
). This component type is determined by
the namespace of the respective component’s WSDL definition.
There are three possible ways for writing a request to the
setComponent
web method; the caller has to choose one
of these three based on whether a system-wide component shall be set or a
language or location specific component shall be set.
Sample request (SOAP body) for setting a language specific component implementation:
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <qap:ComponentSetupRequest xmlns:qap="http://qallme.sf.net/wsdl/qaplanner.wsdl"> <componentID>http://qallme.sf.net/wsdl/querygeneration.wsdl</componentID> <componentLang>de</componentLang> <wsdlURL>http://localhost:8080/qmfdemo/de-querygeneration/QueryGeneratorWS?wsdl</wsdlURL> </qap:ComponentSetupRequest> </soapenv:Body>
<componentLang>
element has to be used for
setting a language specific component implementation. Its value has to be the
ISO 639-1
alpha-2 code of the language for which the implementation shall be used.
Sample request (SOAP body) for setting a location specific component implementation:
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <qap:ComponentSetupRequest xmlns:qap="http://qallme.sf.net/wsdl/qaplanner.wsdl"> <componentID>http://qallme.sf.net/wsdl/answerpool.wsdl</componentID> <componentLoc>ES</componentLoc> <wsdlURL>http://localhost:8080/qmfdemo/ES-answerpool/AnswerPoolWS?wsdl</wsdlURL> </qap:ComponentSetupRequest> </soapenv:Body>
<componentLoc>
element has to be used for
setting a location specific component implementation. Its value has to be the
ISO 3166-1
alpha-2 code of the country for which the implementation shall be used.
Sample request (SOAP body) for setting a system-wide component implementation:
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <qap:ComponentSetupRequest xmlns:qap="http://qallme.sf.net/wsdl/qaplanner.wsdl"> <componentID>http://qallme.sf.net/wsdl/languageidentification.wsdl</componentID> <systemWideComponent/> <wsdlURL>http://localhost:8080/qmfdemo/languageidentification/LanguageIdentifierWS?wsdl</wsdlURL> </qap:ComponentSetupRequest> </soapenv:Body>
<systemWideComponent>
element has to flag this.
Sample response (SOAP body):
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <ns4:dummy xsi:type="xs:string" xmlns:ns4="http://qallme.sf.net/xsd/qallmeshared.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"/> </soapenv:Body>
The getComponent
web method returns the
URL of the WSDL document of a certain
component implementation which is currently used in the
QAPlanner
. The desired component is identified by its
WSDL namespace and a marker for the language/location
subsystem or a flag for system-wide components. This identifier has the same
form as the parameter of the setComponent
web method.
Sample request (SOAP body) for getting a certain language specific component implementation:
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <qap:ComponentSetupRequest xmlns:qap="http://qallme.sf.net/wsdl/qaplanner.wsdl"> <componentID>http://qallme.sf.net/wsdl/querygeneration.wsdl</componentID> <componentLang>de</componentLang> </qap:ComponentSetupRequest> </soapenv:Body>
setComponent
web method.
Sample response (SOAP body):
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <ns5:uri xmlns:ns5="http://qallme.sf.net/wsdl/qallmeshared.wsdl">http://localhost:8080/qmfdemo/de-querygeneration/QueryGeneratorWS?wsdl</ns5:uri> </soapenv:Body>
The Timex2SparqlConverter
is a
WS which has a single web method that converts the temporal
information from a piece of text which is annotated in the extended TIMEX2
format (cf. 4.2.1: “General Remarks”) to parts of a SPARQL
query. Standard TIMEX2 annotations will result in a time point disjunction
SPARQL query and two annotations with extended TIMEX2
annotations are considered to be start and end points of an interval. The
Timex2SparqlConverter
’s WSDL
description can be found under src/main/net/sf/qallme/res/wsdl/timex2sparqlconversion.wsdl
. The
system-wide framework implementation in Java is the class net.sf.qallme.Timex2SparqlConverterWSProvider
.
The Timex2SparqlConverter
has the following web
methods: