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 question

  • verbose: specification of the verbose

  • language: language of the natural language question

  • sentences: sentences of the natural language question

  • postags: word information of the natural language question

  • semanticUnits: semantic entities of the natural language question

  • sortedSemanticUnits: sorted array of the semantic entities of the natural language question

  • semanticCorrespondance: structure containing the semantic correspondance and the rewriting rules

  • aggregation: structure recording the presence of aggregation operators

  • negation: structure recording the negated semantic entities

  • union: structure recording the semantic entities on which the union operator is applied

  • query: reference to the SPARQL query (object RDF::NLP::SPARQLQuery::Query)

  • questionTopic: semantic type referring to the question topic

  • semFeaturesIndex: index of the semantic types

  • config: 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.