RDF::NLP::SPARQLQuery::Question - Perl extension for representing the natural language question.
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, );
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
docId
verbose: specification of the verbose
verbose
language: language of the natural language question
language
sentences: sentences of the natural language question
sentences
postags: word information of the natural language question
postags
semanticUnits: semantic entities of the natural language question
semanticUnits
sortedSemanticUnits: sorted array of the semantic entities of the natural language question
sortedSemanticUnits
semanticCorrespondance: structure containing the semantic correspondance and the rewriting rules
semanticCorrespondance
aggregation: structure recording the presence of aggregation operators
aggregation
negation: structure recording the negated semantic entities
negation
union: structure recording the semantic entities on which the union operator is applied
union
query: reference to the SPARQL query (object RDF::NLP::SPARQLQuery::Query)
query
RDF::NLP::SPARQLQuery::Query
questionTopic: semantic type referring to the question topic
questionTopic
semFeaturesIndex: index of the semantic types
semFeaturesIndex
config: structure containing the configuration of the converter
config
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).
RDF::NLP::SPARQLQuery::Question
%arguments
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).
$semanticCorrespondance
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.
Documentation of the module RDF::NLP::SPARQLQuery
RDF::NLP::SPARQLQuery
Thierry Hamon, <hamon@limsi.fr>
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.
To install RDF::NLP::SPARQLQuery, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RDF::NLP::SPARQLQuery
CPAN shell
perl -MCPAN -e shell install RDF::NLP::SPARQLQuery
For more information on module installation, please visit the detailed CPAN module installation guide.