dice-group / LD2NL

Linked Data to Natural Language
GNU Affero General Public License v3.0
11 stars 6 forks source link

Triple2NL - Problem converting triples #13

Closed aalexandrasilva closed 10 months ago

aalexandrasilva commented 1 year ago

There is an issue when converting triples with the predicate http://dbpedia.org/ontology/restingPlace as it parses the label "resting place" as a verb instead of as a noun. It attempts to conjugate the verb and yields results like: Ismail Merchant rests place India.. Below is the code snippet used.

QueryExecutionFactory qef = new QueryExecutionFactoryHttp("https://dbpedia.org/sparql");
Lexicon lexicon = Lexicon.getDefaultLexicon();
String cache = System.getProperty("java.io.tmpdir");
TripleConverter converter = new TripleConverter(qef, cache + "/triple2nl-cache", lexicon);

Triple triple = new Triple(
        NodeFactory.createURI("http://dbpedia.org/resource/Ismail_Merchant"), 
        NodeFactory.createURI("http://dbpedia.org/ontology/restingPlace"), 
        NodeFactory.createURI("http://dbpedia.org/resource/India"));

System.out.println(converter.convert(triple));