Class WbQuantityExpr

java.lang.Object
org.openrefine.wikidata.schema.WbQuantityExpr
All Implemented Interfaces:
WbExpression<org.wikidata.wdtk.datamodel.interfaces.QuantityValue>

public class WbQuantityExpr extends Object implements WbExpression<org.wikidata.wdtk.datamodel.interfaces.QuantityValue>
  • Constructor Summary

    Constructors
    Constructor
    Description
    WbQuantityExpr(WbExpression<? extends org.wikidata.wdtk.datamodel.interfaces.StringValue> amountExpr, WbExpression<? extends org.wikidata.wdtk.datamodel.interfaces.ItemIdValue> unitExpr)
    Creates an expression for a quantity, which contains two sub-expressions: one for the amount (a string with a particular format) and one for the unit, which is optional.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.wikidata.wdtk.datamodel.interfaces.QuantityValue
    Evaluates the value expression in a given context, returns a Wikibase value suitable to be the target of a claim.
    WbExpression<? extends org.wikidata.wdtk.datamodel.interfaces.StringValue>
     
    WbExpression<? extends org.wikidata.wdtk.datamodel.interfaces.ItemIdValue>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WbQuantityExpr

      public WbQuantityExpr(WbExpression<? extends org.wikidata.wdtk.datamodel.interfaces.StringValue> amountExpr, WbExpression<? extends org.wikidata.wdtk.datamodel.interfaces.ItemIdValue> unitExpr)
      Creates an expression for a quantity, which contains two sub-expressions: one for the amount (a string with a particular format) and one for the unit, which is optional. Setting unitExpr to null will give quantities without units. Setting it to a non-null value will make the unit mandatory: if the unit expression fails to evaluate, the whole quantity expression will fail too.
  • Method Details