dbpedia / extraction-framework

The software used to extract structured data from Wikipedia
861 stars 270 forks source link

Trying to use the Core, having a DBPedia MemoryStore ClassCastException #484

Open clanstyles opened 8 years ago

clanstyles commented 8 years ago

I'm mocking my test after the rest API. I want to load the memory model into my app.

        File modelFolder = null;

        try {
            MemoryStore store = MemoryStore.load();

            modelFolder = new File("/home/user/data/data/en");
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }

        SpotlightModel db = SpotlightModel.fromFolder(modelFolder);
        _spotter = db.spotters().get(SpotterConfiguration.SpotterPolicy.Default);

The SpotlightModel.fromFolder is throwing

Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to org.dbpedia.spotlight.db.memory.MemoryStore

Any ideas?

Thank you

tgalery commented 8 years ago

hI @clanstyles this is an issue that belongs to the https://github.com/dbpedia-spotlight/dbpedia-spotlight repo. Without having the code on the top of my head, I think you might need to pass an extra /model to your path. Moreover, you can also take a look at this repo https://github.com/idio/spotlight-model-editor which loads and tweaks a variety of mem stores for spotlight (see the explore cli argument. If you are ok with exploring this, can you please close this issue here.?

m1ci commented 4 years ago

@clanstyles please open a ticket at the dbpedia-spotlight repo and close this one.