ValueConverter<V>public class TimeValueConverter extends BufferedValueConverter<org.wikidata.wdtk.datamodel.interfaces.TimeValue>
| Constructor | Description |
|---|---|
TimeValueConverter(RdfWriter rdfWriter,
PropertyRegister PropertyRegister,
OwlDeclarationBuffer rdfConversionBuffer) |
| Modifier and Type | Method | Description |
|---|---|---|
org.openrdf.model.Value |
getRdfValue(org.wikidata.wdtk.datamodel.interfaces.TimeValue value,
org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue propertyIdValue,
boolean simple) |
Returns an RDF value that should be used to represent the given Wikibase
data value in RDF.
|
static org.openrdf.model.Literal |
getTimeLiteral(org.wikidata.wdtk.datamodel.interfaces.TimeValue value,
RdfWriter rdfWriter) |
Returns the RDF literal to encode the time component of a given time
value.
|
void |
writeValue(org.wikidata.wdtk.datamodel.interfaces.TimeValue value,
org.openrdf.model.Resource resource) |
Write the auxiliary RDF data for encoding the given value.
|
logIncompatibleValueErrorwriteAuxiliaryTriplespublic TimeValueConverter(RdfWriter rdfWriter, PropertyRegister PropertyRegister, OwlDeclarationBuffer rdfConversionBuffer)
public org.openrdf.model.Value getRdfValue(org.wikidata.wdtk.datamodel.interfaces.TimeValue value,
org.wikidata.wdtk.datamodel.interfaces.PropertyIdValue propertyIdValue,
boolean simple)
ValueConvertervalue - the value to convertpropertyIdValue - the property for which this value was used; this provides
important context information for the conversionsimple - if true, use a simplified conversion to RDF and do not convert
values that are inherently complexpublic void writeValue(org.wikidata.wdtk.datamodel.interfaces.TimeValue value,
org.openrdf.model.Resource resource)
throws org.openrdf.rio.RDFHandlerException
writeValue in class BufferedValueConverter<org.wikidata.wdtk.datamodel.interfaces.TimeValue>value - the value to writeresource - the (subject) URI to use to represent this value in RDForg.openrdf.rio.RDFHandlerExceptionpublic static org.openrdf.model.Literal getTimeLiteral(org.wikidata.wdtk.datamodel.interfaces.TimeValue value,
RdfWriter rdfWriter)
Times with limited precision are encoded using limited-precision XML Schema datatypes, such as gYear, if available. Wikidata encodes the year 1BCE as 0000, while XML Schema, even in version 2, does not allow 0000 and interprets -0001 as 1BCE. Thus all negative years must be shifted by 1, but we only do this if the year is precise.
value - the value to convertrdfWriter - the object to use for creating the literalCopyright © 2014–2017 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage