public class AnyValueConverter extends Object implements ValueConverter<Value>, ValueVisitor<org.eclipse.rdf4j.model.Value>
Constructor and Description |
---|
AnyValueConverter(RdfWriter rdfWriter,
OwlDeclarationBuffer rdfConversionBuffer,
PropertyRegister propertyRegister) |
Modifier and Type | Method and Description |
---|---|
org.eclipse.rdf4j.model.Value |
getRdfValue(Value value,
PropertyIdValue propertyIdValue,
boolean simple)
Returns an RDF value that should be used to represent the given Wikibase
data value in RDF.
|
org.eclipse.rdf4j.model.Value |
visit(EntityIdValue value)
Visits a EntityIdValue and returns a result.
|
org.eclipse.rdf4j.model.Value |
visit(GlobeCoordinatesValue value)
Visits a GlobeCoordinatesValue and returns a result.
|
org.eclipse.rdf4j.model.Value |
visit(MonolingualTextValue value)
Visits a MonolingualTextValue and returns a result.
|
org.eclipse.rdf4j.model.Value |
visit(QuantityValue value)
Visits a QuantityValue and returns a result.
|
org.eclipse.rdf4j.model.Value |
visit(StringValue value)
Visits a StringValue and returns a result.
|
org.eclipse.rdf4j.model.Value |
visit(TimeValue value)
Visits a TimeValue and returns a result.
|
org.eclipse.rdf4j.model.Value |
visit(UnsupportedValue value)
Visits an UnsupportedValue and returns a result
|
void |
writeAuxiliaryTriples()
Writes auxiliary triples that might be needed to encode a Wikibase value
in RDF.
|
public AnyValueConverter(RdfWriter rdfWriter, OwlDeclarationBuffer rdfConversionBuffer, PropertyRegister propertyRegister)
public org.eclipse.rdf4j.model.Value getRdfValue(Value value, PropertyIdValue propertyIdValue, boolean simple)
ValueConverter
getRdfValue
in interface ValueConverter<Value>
value
- 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 org.eclipse.rdf4j.model.Value visit(EntityIdValue value)
ValueVisitor
ItemIdValue
and
PropertyIdValue
. Since the set of possible subtypes can be
extended by extensions of Wikibase, the visitor only visits the general
(abstract) supertype. Implementations will have to decide if the given
specific type is supported and what to do with it.visit
in interface ValueVisitor<org.eclipse.rdf4j.model.Value>
value
- the value to visitpublic org.eclipse.rdf4j.model.Value visit(GlobeCoordinatesValue value)
ValueVisitor
visit
in interface ValueVisitor<org.eclipse.rdf4j.model.Value>
value
- the value to visitpublic org.eclipse.rdf4j.model.Value visit(MonolingualTextValue value)
ValueVisitor
visit
in interface ValueVisitor<org.eclipse.rdf4j.model.Value>
value
- the value to visitpublic org.eclipse.rdf4j.model.Value visit(QuantityValue value)
ValueVisitor
visit
in interface ValueVisitor<org.eclipse.rdf4j.model.Value>
value
- the value to visitpublic org.eclipse.rdf4j.model.Value visit(StringValue value)
ValueVisitor
visit
in interface ValueVisitor<org.eclipse.rdf4j.model.Value>
value
- the value to visitpublic org.eclipse.rdf4j.model.Value visit(TimeValue value)
ValueVisitor
visit
in interface ValueVisitor<org.eclipse.rdf4j.model.Value>
value
- the value to visitpublic void writeAuxiliaryTriples() throws org.eclipse.rdf4j.rio.RDFHandlerException
ValueConverter
writeAuxiliaryTriples
in interface ValueConverter<Value>
org.eclipse.rdf4j.rio.RDFHandlerException
- if there is a problem writing the triplespublic org.eclipse.rdf4j.model.Value visit(UnsupportedValue value)
ValueVisitor
visit
in interface ValueVisitor<org.eclipse.rdf4j.model.Value>
value
- the value to visitCopyright © 2014–2024 Wikidata Toolkit Developers. Generated from source code published under the Apache License 2.0. For more information, see the Wikidata Toolkit homepage