26.2.2.3 日時データにアクセスするためのAPI

グラフ・サーバー(PGX)は、新しいJava 8のTemporalデータ型を使用して、Java APIを介して日時データにアクセスします。
  • PGXのdateはJavaのLocalDateにマップされます
  • PGXのtimeはJavaのLocalTimeにマップされます
  • PGXのtimestampはJavaのLocalDateTimeにマップされます
  • PGXのtime with time zoneはJavaのOffsetTimeにマップされます
  • PGXのtimestamp with time zoneはJavaのOffsetDateTimeにマップされます

次のコードに示すように日付を取得できます。

opg4j> var dateOfBirthProperty = graph.getVertexProperty("date_of_birth")
opg4j> var birthdayOfJudy = dateOfBirthProperty.get(1)
import java.time.LocalDate;
import oracle.pgx.api.*;
...
VertexProperty<LocalDate> dateOfBirthProperty = graph.getVertexProperty("date_of_birth");
LocalDate birthdayOfJudy = dateOfBirthProperty.get(1);
date_of_birth_property = graph.get_vertex_property("date_of_birth")
birthday_of_judy = date_of_birth_property.get(1)