NAME
RDF::NLP::SPARQLQuery::Question - Perl extension for representing the natural language question.
SYNOPSIS
use RDF::NLP::SPARQLQuery::Question;
$question = RDF::NLP::SPARQLQuery::Question->new("docId" => $docId, 'verbose' => 0, "language" => uc($language), "sentences" => \@sentences, "postags" => \@postags, "semanticUnits" => \@semanticUnits, "config" => $nlquestion->config, );
DESCRIPTION
This object represents the natural language question and provides methods for converting question in a SPARQL query. The representation of the question includes several fields:
docId
: identifier of the natural language questionverbose
: specification of the verboselanguage
: language of the natural language questionsentences
: sentences of the natural language questionpostags
: word information of the natural language questionsemanticUnits
: semantic entities of the natural language questionsortedSemanticUnits
: sorted array of the semantic entities of the natural language questionsemanticCorrespondance
: structure containing the semantic correspondance and the rewriting rulesaggregation
: structure recording the presence of aggregation operatorsnegation
: structure recording the negated semantic entitiesunion
: structure recording the semantic entities on which the union operator is appliedquery
: reference to the SPARQL query (objectRDF::NLP::SPARQLQuery::Query
)questionTopic
: semantic type referring to the question topicsemFeaturesIndex
: index of the semantic typesconfig
: structure containing the configuration of the converter
METHODS
new()
new(%arguments);
The method creates and returns an object RDF::NLP::SPARQLQuery::Question
and sets the fields specified in %arguments
(usually verbose
, docId
, language
, sentences
, postags
, semanticUnits
, config
).
Question2Query()
Question2Query($semanticCorrespondance);
The method converts the current natural language question in SPARQL query by using semantic correspondance and rewriting rules specified in $semanticCorrespondance
. The SPARQL query string is defined in the object referring to the SPARQL query (field query
).
questionAbstraction()
questionAbstraction();
The method performs the question abstraction. This first step of the conversion aims at identifying the relevant elements within the questions and at building the representation of these elements. It relies on the linguistic and semantic annotations associated to the question, and specified in the field semanticUnits
. Rewriting rules may be applied. The aggregation operator, negation, question topic and predicate/arguments are identifed at this step.
SEE ALSO
Documentation of the module RDF::NLP::SPARQLQuery
AUTHORS
Thierry Hamon, <hamon@limsi.fr>
LICENSE
Copyright (C) 2014 by Thierry Hamon
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.1 or, at your option, any later version of Perl 5 you may have available.