Ignore unknown fields in schema JSON deserialization
This commit is contained in:
parent
8b1869414d
commit
fffd31382e
@ -4,9 +4,10 @@ import org.openrefine.wikidata.schema.exceptions.SkipSchemaExpressionException;
|
||||
import org.wikidata.wdtk.datamodel.interfaces.MonolingualTextValue;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class WbNameDescExpr {
|
||||
|
||||
enum NameDescrType {
|
||||
|
@ -10,10 +10,11 @@ import org.wikidata.wdtk.datamodel.interfaces.Snak;
|
||||
import org.wikidata.wdtk.datamodel.interfaces.SnakGroup;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
||||
public class WbReferenceExpr implements WbExpression<Reference> {
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class WbReferenceExpr {
|
||||
private List<WbSnakExpr> snakExprs;
|
||||
|
||||
@JsonCreator
|
||||
@ -22,7 +23,6 @@ public class WbReferenceExpr implements WbExpression<Reference> {
|
||||
this.snakExprs = snakExprs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Reference evaluate(ExpressionContext ctxt) throws SkipSchemaExpressionException {
|
||||
List<SnakGroup> snakGroups = new ArrayList<SnakGroup>();
|
||||
for (WbSnakExpr expr : getSnaks()) {
|
||||
|
@ -7,10 +7,11 @@ import org.wikidata.wdtk.datamodel.interfaces.Snak;
|
||||
import org.wikidata.wdtk.datamodel.interfaces.Value;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
||||
public class WbSnakExpr implements WbExpression<Snak> {
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class WbSnakExpr {
|
||||
|
||||
private WbExpression<? extends PropertyIdValue> prop;
|
||||
private WbExpression<? extends Value> value;
|
||||
@ -23,7 +24,6 @@ public class WbSnakExpr implements WbExpression<Snak> {
|
||||
this.value = valueExpr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Snak evaluate(ExpressionContext ctxt) throws SkipSchemaExpressionException {
|
||||
PropertyIdValue propertyId = getProp().evaluate(ctxt);
|
||||
Value evaluatedValue = value.evaluate(ctxt);
|
||||
|
@ -17,9 +17,10 @@ import org.wikidata.wdtk.datamodel.interfaces.StatementRank;
|
||||
import org.wikidata.wdtk.datamodel.interfaces.Value;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class WbStatementExpr {
|
||||
|
||||
private WbExpression<? extends Value> mainSnakValueExpr;
|
||||
|
@ -11,9 +11,10 @@ import org.wikidata.wdtk.datamodel.interfaces.Statement;
|
||||
import org.wikidata.wdtk.datamodel.interfaces.StatementGroup;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class WbStatementGroupExpr {
|
||||
|
||||
private WbExpression<? extends PropertyIdValue> propertyExpr;
|
||||
|
Loading…
Reference in New Issue
Block a user