public interface Translator
A Translator defines a 1:1 mapping between database and RDF values. Mappings that are not 1:1 in both directions are not supported.
The type of the RDF node (URI, blank node, literal) is not specified by the translator, but by the d2rq:ClassMap or d2rq:PropertyBridge that uses the d2rq:TranslationTable.
Translator implementations can have two kinds of constructors:
Modifier and Type | Field and Description |
---|---|
static Translator |
IDENTITY |
Modifier and Type | Method and Description |
---|---|
String |
toDBValue(String rdfValue)
Translates a value that comes from an RDF source (for example a query)
to a database value.
|
String |
toRDFValue(String dbValue)
Translates a value that comes from the database to an RDF value
(URI, literal label, or blank node ID).
|
static final Translator IDENTITY
String toRDFValue(String dbValue)
dbValue
- a value coming from the databaseString toDBValue(String rdfValue)
rdfValue
- a value coming from an RDF source