/** * Returns the property id string. Only for use by Jackson during * serialization. * * @return the property id string */ @JsonProperty("property") public String getProperty() { return this.property.getId(); }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(PropertyIdValue o) { return o.getIri() + " (property)"; }
@Override public SomeValueSnak getSomeValueSnak(PropertyIdValue propertyId) { return new SomeValueSnakImpl( propertyId.getId(), propertyId.getSiteIri()); }
@Override public void setPropertyType(PropertyIdValue propertyIdValue, String datatypeIri) { propertyTypes.put(propertyIdValue.getId(), datatypeIri); }
@Override public NoValueSnak getNoValueSnak(PropertyIdValue propertyId) { return new NoValueSnakImpl( propertyId.getId(), propertyId.getSiteIri()); }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(PropertyIdValue o) { return o.getIri() + " (property)"; }
/** * Sets datatypeIri an IRI of the primitive type of an Property for * {@link PropertyIdValue}. * * @param propertyIdValue * @param datatypeIri */ public void setPropertyType(PropertyIdValue propertyIdValue, String datatypeIri) { datatypes.put(propertyIdValue.getId(), datatypeIri); }
/** * Copies a {@link PropertyIdValue}. * * @param object * object to copy * @return copied object */ public PropertyIdValue copy(PropertyIdValue object) { return dataObjectFactory.getPropertyIdValue(object.getId(), object.getSiteIri()); }
/** * Get the URI for the given property in the given context. * * @param propertyIdValue * the property id for which to create a URI * @param propertyContext * the context for which the URI will be needed * @return the URI */ public static String getPropertyUri(PropertyIdValue propertyIdValue, PropertyContext propertyContext) { switch (propertyContext) { case STATEMENT: return propertyIdValue.getIri() + "s"; case VALUE: return propertyIdValue.getIri() + "v"; case QUALIFIER: return propertyIdValue.getIri() + "q"; case REFERENCE: return propertyIdValue.getIri() + "r"; case SIMPLE_CLAIM: return propertyIdValue.getIri() + "c"; default: return null; } }
/** * Returns the property id string. Only for use by Jackson during * serialization. * * @return the property id string */ @JsonProperty("property") public String getProperty() { return this.property.getId(); }
/** * Copies a {@link PropertyIdValue}. * * @param object * object to copy * @return copied object */ public PropertyIdValue copy(PropertyIdValue object) { return dataObjectFactory.getPropertyIdValue(object.getId(), object.getSiteIri()); }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(NoValueSnak o) { return o.getPropertyId().getIri() + " has no value"; }
switch (propertyContext) { case DIRECT: return PREFIX_PROPERTY_DIRECT + propertyIdValue.getId(); case STATEMENT: return PREFIX_PROPERTY + propertyIdValue.getId(); case VALUE_SIMPLE: return PREFIX_PROPERTY_STATEMENT + propertyIdValue.getId(); case VALUE: return PREFIX_PROPERTY_STATEMENT_VALUE + propertyIdValue.getId(); case QUALIFIER: return PREFIX_PROPERTY_QUALIFIER_VALUE + propertyIdValue.getId(); case QUALIFIER_SIMPLE: return PREFIX_PROPERTY_QUALIFIER + propertyIdValue.getId(); case REFERENCE: return PREFIX_PROPERTY_REFERENCE_VALUE + propertyIdValue.getId(); case REFERENCE_SIMPLE: return PREFIX_PROPERTY_REFERENCE + propertyIdValue.getId(); case NO_VALUE: return PREFIX_WIKIDATA_NO_VALUE + propertyIdValue.getId(); case NO_QUALIFIER_VALUE: return PREFIX_WIKIDATA_NO_QUALIFIER_VALUE + propertyIdValue.getId(); default: return null;
@Override public SomeValueSnak getSomeValueSnak(PropertyIdValue propertyId) { return new SomeValueSnakImpl( propertyId.getId(), propertyId.getSiteIri()); }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(SomeValueSnak o) { return o.getPropertyId().getIri() + " has some value"; }
/** * Logs a message for a case where the value of a property does not fit to * its declared datatype. * * @param propertyIdValue * the property that was used * @param datatype * the declared type of the property * @param valueType * a string to denote the type of value */ protected void logIncompatibleValueError(PropertyIdValue propertyIdValue, String datatype, String valueType) { logger.warn("Property " + propertyIdValue.getId() + " has type \"" + datatype + "\" but a value of type " + valueType + ". Data ignored."); } }
@Override public NoValueSnak getNoValueSnak(PropertyIdValue propertyId) { return new NoValueSnakImpl( propertyId.getId(), propertyId.getSiteIri()); }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(SomeValueSnak o) { return o.getPropertyId().getIri() + " has some value"; }
/** * Logs a message for a case where the value of a property does not fit to * its declared datatype. * * @param propertyIdValue * the property that was used * @param datatype * the declared type of the property * @param valueType * a string to denote the type of value */ protected void logIncompatibleValueError(PropertyIdValue propertyIdValue, String datatype, String valueType) { logger.warn("Property " + propertyIdValue.getId() + " has type \"" + datatype + "\" but a value of type " + valueType + ". Data ignored."); } }
/** * Returns a human-readable string representation of the given object. * * @see java.lang.Object#toString() * @param o * the object to represent as string * @return a string representation of the object */ public static String toString(NoValueSnak o) { return o.getPropertyId().getIri() + " has no value"; }