diff --git a/extensions/wikidata/src/org/openrefine/wikidata/schema/WbLanguageExpr.java b/extensions/wikidata/src/org/openrefine/wikidata/schema/WbLanguageExpr.java index f0e49ddb8..7269c2ccc 100644 --- a/extensions/wikidata/src/org/openrefine/wikidata/schema/WbLanguageExpr.java +++ b/extensions/wikidata/src/org/openrefine/wikidata/schema/WbLanguageExpr.java @@ -2,6 +2,17 @@ package org.openrefine.wikidata.schema; import org.openrefine.wikidata.utils.JacksonJsonizable; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonSubTypes.Type; + +@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, + include=JsonTypeInfo.As.PROPERTY, + property="type") +@JsonSubTypes({ + @Type(value = WbLanguageConstant.class, name = "wblanguageconstant"), + @Type(value = WbLanguageVariable.class, name = "wblanguagevariable") +}) public abstract class WbLanguageExpr extends JacksonJsonizable { /** * Evaluates the language expression to a Wikimedia language code diff --git a/extensions/wikidata/src/org/openrefine/wikidata/schema/WbNameDescExpr.java b/extensions/wikidata/src/org/openrefine/wikidata/schema/WbNameDescExpr.java index c7b087f5e..af17d7555 100644 --- a/extensions/wikidata/src/org/openrefine/wikidata/schema/WbNameDescExpr.java +++ b/extensions/wikidata/src/org/openrefine/wikidata/schema/WbNameDescExpr.java @@ -20,7 +20,7 @@ public class WbNameDescExpr extends JacksonJsonizable { @JsonCreator public WbNameDescExpr( - @JsonProperty("type") NameDescrType type, + @JsonProperty("name_type") NameDescrType type, @JsonProperty("value") WbMonolingualExpr value) { this.type = type; this.value = value; @@ -45,6 +45,7 @@ public class WbNameDescExpr extends JacksonJsonizable { } } + @JsonProperty("name_type") public NameDescrType getType() { return type; } diff --git a/extensions/wikidata/src/org/openrefine/wikidata/schema/WbValueExpr.java b/extensions/wikidata/src/org/openrefine/wikidata/schema/WbValueExpr.java index dd999d959..699a6b9f7 100644 --- a/extensions/wikidata/src/org/openrefine/wikidata/schema/WbValueExpr.java +++ b/extensions/wikidata/src/org/openrefine/wikidata/schema/WbValueExpr.java @@ -23,7 +23,8 @@ import com.fasterxml.jackson.annotation.JsonSubTypes.Type; @Type(value = WbLanguageConstant.class, name = "wblanguageconstant"), @Type(value = WbLanguageVariable.class, name = "wblanguagevariable"), @Type(value = WbDateConstant.class, name = "wbdateconstant"), - @Type(value = WbDateVariable.class, name = "wbdatevariable") , + @Type(value = WbDateVariable.class, name = "wbdatevariable"), + @Type(value = WbMonolingualExpr.class, name = "wbmonolingualexpr"), }) public abstract class WbValueExpr extends JacksonJsonizable { /* An expression that represents a Wikibase value,