@Override public void processItemDocument(ItemDocument itemDocument) { this.itemCount++; // Find the first quantity value for this property, if any: QuantityValue quantityValue = itemDocument .findStatementQuantityValue(numberPropertyId); // If a value was found, compare it to the current maximum: if (quantityValue != null) { this.itemsWithPropertyCount++; BigDecimal numericValue = quantityValue.getNumericValue(); if (this.largestNumberValue == null || numericValue.compareTo(this.largestNumberValue) > 0) { this.largestNumberValue = numericValue; this.largestNumberItem = itemDocument.getEntityId(); MonolingualTextValue label = itemDocument.getLabels().get("en"); if (label != null) { this.largestNumberItemLabel = label.getText(); } else { this.largestNumberItemLabel = this.largestNumberItem .getId(); } } } // Print progress every 100,000 items: if (this.itemCount % 100000 == 0) { printStatus(); } }
@Override public void processItemDocument(ItemDocument itemDocument) { this.itemCount++; // Find the first quantity value for this property, if any: QuantityValue quantityValue = itemDocument .findStatementQuantityValue(numberPropertyId); // If a value was found, compare it to the current maximum: if (quantityValue != null) { this.itemsWithPropertyCount++; BigDecimal numericValue = quantityValue.getNumericValue(); if (this.largestNumberValue == null || numericValue.compareTo(this.largestNumberValue) > 0) { this.largestNumberValue = numericValue; this.largestNumberItem = itemDocument.getEntityId(); MonolingualTextValue label = itemDocument.getLabels().get("en"); if (label != null) { this.largestNumberItemLabel = label.getText(); } else { this.largestNumberItemLabel = this.largestNumberItem .getId(); } } } // Print progress every 100,000 items: if (this.itemCount % 100000 == 0) { printStatus(); } }
.findStatementQuantityValue("P1181"); if (number == null) { System.out.println("*** No unique numeric value for " + qid);
.findStatementQuantityValue("P1181"); if (number == null) { System.out.println("*** No unique numeric value for " + qid);