ag-sc / lemon.dbpedia

lemon lexicon for DBpedia
27 stars 5 forks source link

Feature request: LDP parser or CSV export #6

Closed pablomendes closed 9 years ago

pablomendes commented 9 years ago

Hey @cunger, I was looking at your *.ldp files and wondering if there is an open source parser for that syntax lying around?

Also: have you considered providing some simpler TSV export that would represent your LDP (with loss of information) as TSV?

LDP:

ClassNoun(["flowering"/adjective "plant"/noun],dbpedia:FloweringPlant),
ClassNoun("gnetophyte",dbpedia:Gnetophytes) with plural "gnetophytes", `  

TSV:

flowering plant  dbpedia:FloweringPlant
gnetophyte        dbpedia:Gnetophytes
gnetophytes      dbpedia:Gnetophytes

TSV (with more info):

flowering plant  dbpedia:FloweringPlant    JJ NN
gnetophyte        dbpedia:Gnetophytes       NN
gnetophytes      dbpedia:Gnetophytes       NNS
cunger commented 9 years ago

Hi Pablo,

The .ldp files are converted using lemon.patterns, which uses the BNF Converter for parsing.

In fact, I also converted them into TSV files once, for use in HAWK. In the end it turned out that simple Turtle is more convenient, however. The files are still there:

But you're right, a simple TSV export as you proposed would be nice to have.

Just keep in mind that the repository has been created for DBpedia 3.8 and unfortunately hasn't seen a major update since then...

jmccrae commented 9 years ago

The LDP language is defined by means of a BNFC file here:

https://github.com/jmccrae/lemon.patterns/blob/master/src/main/bnfc/parser.cf

So a CSV export would not take too long, or alternatively you could just use the existing code, generate RDF and then use SPARQL construct or similar

cunger commented 9 years ago

I wrote a simple script that converts a lemon lexicon (in RDF format) into TSV:

https://github.com/cunger/lemon2tsv

It currently doesn't include POS information, but I could add that as an option. The resulting TSV files are in the target folder:

https://github.com/ag-sc/lemon.dbpedia/blob/master/target/dbpedia_en.tsv https://github.com/ag-sc/lemon.dbpedia/blob/master/target/dbpedia_es.tsv https://github.com/ag-sc/lemon.dbpedia/blob/master/target/dbpedia_de.tsv