Fix terms serialization
This commit is contained in:
parent
497505eef1
commit
9a3093b045
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user