4.2.4. Location Specific Components

Location specific components in the QALL-ME Framework are components that operate differently on question and answer data for different local information. In principle all implementations of location specific components could be the same – barring location specific resources which are used in the component implementations. Note, however, that if a certain implementation of a location specific component type supports several different locations automatically, then this implementation has to be introduced multiple times to the QAPlanner using the setComponent web method once per supported location (cf. 4.2.2.2).

Location specific component implementations do not belong to the core QALL-ME Framework. However, some demo component implementations for different locations are provided as examples in Java – see section 4.4: “Demo Components Description” for details.

The getAnswers web method returns an RDF answer graph for a given SPARQL “CONSTRUCT” query. If the SPARQL query is not well-formed, for example if the query is not a SPARQL “CONSTRUCT” query, then a MalformedQueryFault is issued. If the AnswerPool does not contain any answer matching the given query, then an empty RDF graph is returned.

Sample request (SOAP body):

<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
	<string xmlns="http://qallme.sf.net/wsdl/qallmeshared.wsdl">
    PREFIX qmo: &lt;http://qallme.itc.it/ontology/qallme-tourism.owl#&gt;
    PREFIX xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt;
    PREFIX qma: &lt;http://qallme.fbk.eu/ontology/qallme-answers.owl#&gt;
    CONSTRUCT {
    ?cinema qmo:name ?cinemaName .
    ?event qmo:isInSite ?cinema ;
           qmo:hasEventContent ?movie .
    ?movie qmo:name ?movieName ;
           qmo:duration ?duration ;
           a qmo:Movie .
    qma:AnswerInstance a qma:AnswersObject ;
                       qma:hasAnswerValue ?movie .
    }
    WHERE {
    ?cinema qmo:name ?cinemaName .
    ?event qmo:isInSite ?cinema ;
           qmo:hasEventContent ?movie .
    ?movie qmo:name ?movieName ;
           qmo:duration ?duration .
    FILTER(?cinemaName = &quot;Xanadu&quot;^^xsd:string) .
    }
	</string>
</soapenv:Body>
This is a sample request for questions like “Which movies can I see in the Xanadu cinema?”. The given SPARQL query demands to also put the duration of every answer movie into the answer graph as additional, answer supporting information.

Sample response (SOAP body):

<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
	<RDFGraph xmlns="http://qallme.sf.net/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>
					<qmo:Movie rdf:about="http://qallme.itc.it/ontology/qallme-tourism.owl#Movie_DFKI_12052">
						<qmo:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Die Wilden Kerle 4</qmo:name>
						<qmo:duration rdf:datatype="http://www.w3.org/2001/XMLSchema#duration">PT111M</qmo:duration>
					</qmo:Movie>
				</qma:hasAnswerValue>
				<qma:hasAnswerValue>
					<qmo:Movie rdf:about="http://qallme.itc.it/ontology/qallme-tourism.owl#Movie_DFKI_2835">
					<qmo:duration rdf:datatype="http://www.w3.org/2001/XMLSchema#duration">PT102M</qmo:duration>
					<qmo:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Rocky Balboa</qmo:name>
				</qmo:Movie>
				</qma:hasAnswerValue>
			</qma:AnswersObject>
			<rdf:Description rdf:about="http://qallme.itc.it/ontology/qallme-tourism.owl#Event_DFKI_375">
				<qmo:isInSite>
					<rdf:Description rdf:about="http://qallme.itc.it/ontology/qallme-tourism.owl#Cinema_DFKI_Xanadu">
						<qmo:name rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Xanadu</qmo:name>
					</rdf:Description>
				</qmo:isInSite>
				<qmo:hasEventContent rdf:resource="http://qallme.itc.it/ontology/qallme-tourism.owl#Movie_DFKI_12052"/>
			</rdf:Description>
			<rdf:Description rdf:about="http://qallme.itc.it/ontology/qallme-tourism.owl#Event_DFKI_371">
				<qmo:hasEventContent rdf:resource="http://qallme.itc.it/ontology/qallme-tourism.owl#Movie_DFKI_2835"/>
				<qmo:isInSite rdf:resource="http://qallme.itc.it/ontology/qallme-tourism.owl#Cinema_DFKI_Xanadu"/>
			</rdf:Description>
			<rdf:Description rdf:about="http://qallme.itc.it/ontology/qallme-tourism.owl#Event_DFKI_368">
				<qmo:hasEventContent rdf:resource="http://qallme.itc.it/ontology/qallme-tourism.owl#Movie_DFKI_2835"/>
				<qmo:isInSite rdf:resource="http://qallme.itc.it/ontology/qallme-tourism.owl#Cinema_DFKI_Xanadu"/>
			</rdf:Description>
			<rdf:Description rdf:about="http://qallme.itc.it/ontology/qallme-tourism.owl#Event_DFKI_374">
				<qmo:hasEventContent rdf:resource="http://qallme.itc.it/ontology/qallme-tourism.owl#Movie_DFKI_12052"/>
				<qmo:isInSite rdf:resource="http://qallme.itc.it/ontology/qallme-tourism.owl#Cinema_DFKI_Xanadu"/>
			</rdf:Description>
		</rdf:RDF>
	</RDFGraph>
</soapenv:Body>
The response contains the answer RDF graph as constructed according to the SPARQL query in the request. Depending on the SPARQL query, the concrete graph can look very different for different QA systems. The above sample graph is just one possibility which is used in the demo components that come with the QALL-ME Framework; its structure is explained in section
4.4.1.2: “Answer Representation”.