PropertyRegister { public String getPropertyType(PropertyIdValue propertyIdValue) { if (!datatypes.containsKey(propertyIdValue.getId())) { fetchPropertyInformation(propertyIdValue); } return datatypes.get(propertyIdValue.getId()); } PropertyRegister(String uriPatternPropertyId,
			ApiConnection apiConnection, String siteUri); static PropertyRegister getWikidataPropertyRegister(); String getUriPrefix(); String getPropertyType(PropertyIdValue propertyIdValue); void setPropertyType(PropertyIdValue propertyIdValue,
			String datatypeIri); String getPropertyUriPattern(PropertyIdValue propertyIdValue); String setPropertyTypeFromEntityIdValue(
			PropertyIdValue propertyIdValue, EntityIdValue value); String setPropertyTypeFromGlobeCoordinatesValue(
			PropertyIdValue propertyIdValue, GlobeCoordinatesValue value); String setPropertyTypeFromQuantityValue(
			PropertyIdValue propertyIdValue, QuantityValue value); String setPropertyTypeFromStringValue(
			PropertyIdValue propertyIdValue, StringValue value); String setPropertyTypeFromTimeValue(PropertyIdValue propertyIdValue,
			TimeValue value); String setPropertyTypeFromMonolingualTextValue(
			PropertyIdValue propertyIdValue, MonolingualTextValue value); void fetchUsingSPARQL(URI endpoint);  }
@Test public void testGetPropertyType() { assertEquals(DatatypeIdValue.DT_STRING, this.propertyRegister.getPropertyType(dataObjectFactory .getPropertyIdValue("P434", this.siteIri))); assertEquals(DatatypeIdValue.DT_STRING, this.propertyRegister.getPropertyType(dataObjectFactory .getPropertyIdValue("P434", this.siteIri))); assertEquals(50, this.propertyRegister.smallestUnfetchedPropertyIdNumber); assertTrue(this.propertyRegister.datatypes.containsKey("P434")); }
@Test public void testGetMissingPropertyType() { assertNull(this.propertyRegister.getPropertyType(dataObjectFactory .getPropertyIdValue("P10000", this.siteIri))); final int smallestBefore = this.propertyRegister.smallestUnfetchedPropertyIdNumber; assertNull(this.propertyRegister.getPropertyType(dataObjectFactory .getPropertyIdValue("P10000", this.siteIri))); assertEquals("no requests should be made if the property is known to be missing", smallestBefore, this.propertyRegister.smallestUnfetchedPropertyIdNumber); }