How can I setup language support for strings like in Dgraph

Hi, I recently found OrientDB and finished the beginner course on Udemy. I like it’s setup but I am missing a language feature which is awesome in Dgraph:

I would like to store my strings in different languages and randomly query it.

For example:

SELECT name@en from Country where code = ‘DE’ => returns ‘Germany
SELECT name@de from Country where code = ‘DE’ => returns ‘Deutschland

Does anyone know how I can build something like this in OrientDB ?

Thanks, Johnson

Hi @Johnson

there is no such functionality in OrientDB, so you will have to use custom attributes for this, eg. you can define a standard “name” property and then some additional “name@something” using back-ticks:

INSERT INTO Country SET name = "Germany", `name@en` = "Germany", `name@de` = "Deutschland";

SELECT FROM Country WHERE `name@de` = "Deutschland";

I hope it helps



back-ticks are needed because @ is a special character, but if you choose to use something different (eg. underscore) you don’t need them

1 Like

Awsome thx! will try it out