Skip to content

Commit

Permalink
fixed getInteger bug in EPMCResult.json
Browse files Browse the repository at this point in the history
  • Loading branch information
petermr committed Sep 27, 2021
1 parent 9b17196 commit d61d556
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 2 deletions.
Binary file removed src/ipynb/jupyter/.DS_Store
Binary file not shown.
Binary file removed src/ipynb/work/.DS_Store
Binary file not shown.
Binary file removed src/ipynb/work/search/.DS_Store
Binary file not shown.
Binary file removed src/ipynb/work/thermo/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,17 @@ private Boolean getBoolean(String field) {

private Integer getInteger(String field) {
JsonElement jsonElement = getField(field);
Integer value = jsonElement.getAsInt();
Integer value = jsonElement == null ? null : jsonElement.getAsInt();
return value;
}

private JsonElement getField(String field) {
JsonElement entry = getJsonEntry();
JsonObject jsonObject = entry.getAsJsonObject();
JsonElement jsonElement = jsonObject.get(field);
jsonElement = strip1ElementArray(jsonElement);
if (jsonElement != null) {
jsonElement = strip1ElementArray(jsonElement);
}
return jsonElement;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[ID]
# defines a global namespace
# NOT yet developed
id = petermr
location = URL
namespace_base = https://contentmine.org/
namespace = ${namespace_base}/home
prefix = petermr

[DICTIONARIES]

animaltest = animaltest.xml
Expand Down Expand Up @@ -44,3 +53,4 @@ terpenesynthase = terpenesynthase.xml
tropicalVirus = tropicalVirus.xml
wetlands = wetlands.xml
wildlife = wildlife.xml

Binary file not shown.
Binary file not shown.

0 comments on commit d61d556

Please sign in to comment.