petermr / ami3

Integration of cephis and normami code into a single base. Tests will be slimmed down
Apache License 2.0
17 stars 5 forks source link

Null Pointer in DefaultAMIDictionary.getMaximumTermSize #68

Open petermr opened 3 years ago

petermr commented 3 years ago
@Peter Murray-Rust I was trying to create a sample dictionary (terms 10) using the syntax amidict -vv --dictionary disease --directory dictionary --input sparql_dis10 create --informat wikisparqlxml --sparqlmap name=wikidataLabel,term=wikidataLabel,wikipediaPage=wikipedia,wikidataURL=wikidata,description=wikidataDescription,wikidataAltLabel=wikidataAltLabel,_p494_icd10code=ICD_10,Hindi=hindiLabel,Hindi_AltLabel=hindialtlabel,Hindi_description=hindi,Hindi_wikipediaPage=hindiwikipedia,Tamil=tamilLabel,Tamil_AltLabel=tamilaltlabel,Tamil_description=tamil,Tamil_wikipediaPage=tamilwikipedia,Spanish=spanishLabel,Spanish_AltLabel=spanishaltlabel,Spanish_description=spanish,Urdu=urduLabel,Urdu_AltLabel=urdualtlabel,Urdu_description=urdu,Portuguese=ptLabel,Portuguese_AltLabel=ptaltlabel,Portuguese_desription=pt --transformName wikidataID=EXTRACT(wikidataURL,.*/(.*)) --synonyms=wikidataAltLabel for this SPARQL file but got the output as
.
.
java.lang.NullPointerException
        at org.contentmine.ami.dictionary.DefaultAMIDictionary.getMaximumTermSize(DefaultAMIDictionary.java:346)
        at org.contentmine.ami.dictionary.DefaultAMIDictionary.getTermsSortedBySize(DefaultAMIDictionary.java:324)
        at org.contentmine.ami.dictionary.DefaultAMIDictionary.toString(DefaultAMIDictionary.java:387)
        at java.lang.String.valueOf(Unknown Source)
.
petermr commented 3 years ago

I think this bug has been fixed in the latest commit.