本文整理汇总了Java中org.wikidata.wdtk.datamodel.interfaces.DatatypeIdValue.DT_GLOBE_COORDINATES属性的典型用法代码示例。如果您正苦于以下问题:Java DatatypeIdValue.DT_GLOBE_COORDINATES属性的具体用法?Java DatatypeIdValue.DT_GLOBE_COORDINATES怎么用?Java DatatypeIdValue.DT_GLOBE_COORDINATES使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.wikidata.wdtk.datamodel.interfaces.DatatypeIdValue
的用法示例。
在下文中一共展示了DatatypeIdValue.DT_GLOBE_COORDINATES属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRdfValue
@Override
public Value getRdfValue(GlobeCoordinatesValue value,
PropertyIdValue propertyIdValue, boolean simple) {
String datatype = this.propertyRegister
.setPropertyTypeFromGlobeCoordinatesValue(propertyIdValue,
value);
switch (datatype) {
case DatatypeIdValue.DT_GLOBE_COORDINATES:
if (simple) {
return getSimpleGeoValue(value);
} else {
URI valueUri = this.rdfWriter.getUri(Vocabulary
.getGlobeCoordinatesValueUri(value,
this.propertyRegister.getUriPrefix()));
this.rdfConversionBuffer.addObjectProperty(propertyIdValue);
addValue(value, valueUri);
return valueUri;
}
default:
logIncompatibleValueError(propertyIdValue, datatype,
"globe coordinates");
return null;
}
}
示例2: getDatatypeLabel
/**
* Returns an English label for a given datatype.
*
* @param datatype
* the datatype to label
* @return the label
*/
private String getDatatypeLabel(DatatypeIdValue datatype) {
if (datatype.getIri() == null) { // TODO should be redundant once the
// JSON parsing works
return "Unknown";
}
switch (datatype.getIri()) {
case DatatypeIdValue.DT_COMMONS_MEDIA:
return "Commons media";
case DatatypeIdValue.DT_GLOBE_COORDINATES:
return "Globe coordinates";
case DatatypeIdValue.DT_ITEM:
return "Item";
case DatatypeIdValue.DT_QUANTITY:
return "Quantity";
case DatatypeIdValue.DT_STRING:
return "String";
case DatatypeIdValue.DT_TIME:
return "Time";
case DatatypeIdValue.DT_URL:
return "URL";
case DatatypeIdValue.DT_PROPERTY:
return "Property";
case DatatypeIdValue.DT_EXTERNAL_ID:
return "External identifier";
case DatatypeIdValue.DT_MATH:
return "Math";
case DatatypeIdValue.DT_MONOLINGUAL_TEXT:
return "Monolingual Text";
default:
throw new RuntimeException("Unknown datatype " + datatype.getIri());
}
}
示例3: getRangeUri
/**
* Returns the class of datatype URI that best characterizes the range of
* the given property based on its datatype.
*
* @param propertyIdValue
* the property for which to get a range
* @return the range URI or null if the datatype could not be identified.
*/
String getRangeUri(PropertyIdValue propertyIdValue) {
String datatype = this.propertyRegister
.getPropertyType(propertyIdValue);
if (datatype == null)
return null;
switch (datatype) {
case DatatypeIdValue.DT_STRING:
case DatatypeIdValue.DT_EXTERNAL_ID:
case DatatypeIdValue.DT_MATH:
this.rdfConversionBuffer.addDatatypeProperty(propertyIdValue);
return Vocabulary.XSD_STRING;
case DatatypeIdValue.DT_COMMONS_MEDIA:
case DatatypeIdValue.DT_GLOBE_COORDINATES:
case DatatypeIdValue.DT_ITEM:
case DatatypeIdValue.DT_PROPERTY:
case DatatypeIdValue.DT_QUANTITY:
case DatatypeIdValue.DT_TIME:
case DatatypeIdValue.DT_URL:
this.rdfConversionBuffer.addObjectProperty(propertyIdValue);
return Vocabulary.OWL_THING;
default:
return null;
}
}
示例4: setPropertyTypeFromGlobeCoordinatesValue
/**
* Returns the IRI of the primitive Type of an Property for
* {@link GlobeCoordinatesValue} objects.
*
* @param propertyIdValue
* @param value
*/
public String setPropertyTypeFromGlobeCoordinatesValue(
PropertyIdValue propertyIdValue, GlobeCoordinatesValue value) {
return DatatypeIdValue.DT_GLOBE_COORDINATES;
}