Mapping of SPARQL and Gremlin datatypes to OpenSearch - Amazon Neptune
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Mapping of SPARQL and Gremlin datatypes to OpenSearch

New datatype mappings in OpenSearch are created based on the datatype being use in the property or object. Because some fields contain values of different types, the initial mapping may exclude some values of the field.

Neptune datatypes map to OpenSearch datatypes as follows:

SPARQL types Gremlin types OpenSearch types

XSD:int

XSD:unsignedInt

XSD:integer

XSD:byte

XSD:unsignedByte

XSD:short

XSD:unsignedShort

XSD:long

XSD:unsignedLong

byte

short

int

long

long

XSD:float

XSD:double

XSD:decimal

float

double

double

XSD:boolean

bool

boolean

XSD:datetime

XSD:date

date

date

XSD:string

XSD:time

string

text

Custom datatype

N/A

text

Any other datatype

N/A

text

For example, the following Gremlin update query causes a new mapping for "newField" to be added to OpenSearch, namely { "type" : "double" }:

g.V("1").property("newField" 10.5)

Similarly, the following SPARQL update query causes a new mapping for "ex:byte" to be added to OpenSearch, namely { "type" : "long" }:

PREFIX ex: <http://my/example#> PREFIX xsd:<http://www.w3.org/2001/XMLSchema#> INSERT DATA { ex:test ex:byte "123"^^xsd:byte }.
Note

As you can see, an item mapped from Neptune to OpenSearch may end up with a different datatype in OpenSearch than it has in Neptune. However, there is an explicit text field in OpenSearch, "datatype", that records the datatype that the item has in Neptune.