Known limitations when working with IBM Db2 Graph
When working with Db2 Graph, there are some limitations to be aware of.
Supported Graph functionality
- Db2
Graph provides
a read-only implementation of Apache Tinkerpop Gremlin. It provides no
facility to add/edit or delete vertices or edges. Users can update the underlying relational tables
through SQL transactions. Any changes to the database are immediately available when graph queries
are executed. As Db2
Graph is a
read-only implementation of graph, it does not accept Gremlin queries that modify the graph. For example:
addE(), addV(), drop() - Db2 Graph maps relational columns to vertex/edge properties. As a result, Db2 Graph does not support multi-properties (a vertex property key can have multiple values) and meta-properties (a vertex property can have properties).
- Db2 Graph supports the data types available in Db2. As a result, a property type cannot be an array or an arbitrary JVM object.
- Db2 Graph trims character (CHAR and NCHAR) data when returning results and when running gremlin queries that filter based on those columns.
- Db2 Graph does not support the Graph Computer API in Gremlin.
- The query editor in the Db2
Graph user
interface does not need Gremlin terminal steps, as those steps are automatically applied. If used,
most terminal steps, other than
profile()andexplain(), generate an error that the step is not needed. For example, the following terminal steps result in an error:next(), tryNext(), toList()
Relational table to Graph model mapping
When adding a graph by using the addGraph command, Db2 Graph inspects the tables and relationships to auto-generate a model.
- Any table with a primary key is assumed to be a vertex table.
- A foreign key relationship between two tables defines an edge.
The auto-generator handles only database structures where relationships, which are defined by foreign keys, exist between the tables. Therefore, having primary and foreign keys properly defined aids automatic model creation. Use the Db2 Graph user interface to manually create the relationships when referential rules are not defined.
- Whether created through auto-generation or manually using the Db2
Graph user
interface, objects in the graph must derive from data that can be uniquely referenced through a
primary key, unique index, or unique values. Unexpected graph query results can occur if a vertex or
edge is not associated with a unique value in a table. Use the
validateDataIntregitycommand to identify problems with the ID settings on vertices and edges. - When a graph model is first opened by using the openGraph command, Db2 Graph verifies the tables and columns that are defined in the model against Db2 catalog tables to ensure the integrity of the model. The query editor calls openGraph if needed when it is opened for a graph. The model is not reevaluated on each query, hence any real-time structural change to the database can result in an error during query execution.
- When tables are added to a schema, those tables must be added to the model by using the Db2 Graph user interface to include them in queries. Tables are not automatically added or deleted from the graph model.
- When a model is created, by default all columns are included. For example, when columns are added to the table, those columns are available when the graph is reopened even if the model was defined without specifically including columns. The Db2 Graph user interface includes all columns or selected columns.
- An edge can only exist when it connects two vertices. When using a table as a pass through table
in the definition of an edge, it is possible to select a table where foreign keys are not enforced
or do not exist. The user must ensure that no records in the pass through table are missing an
outbound or inbound relational, as the Db2
Graph query
optimization will return an error or unexpected results. Use the
validateDataIntegritycommand to identify problems with pass through edge definitions.
Gremlin console availability
- The Gremlin console is only included on x86 platforms and is not available for other architectures.
Private browsing in Firefox
- Due to a Firefox defect, the Db2 Graph user interface does not support private browsing mode for Firefox.
Unable to write to the mounted configuration directory
- Error messages might be seen when starting the Db2
Graph container:
Error: Unable to write to the mounted configuration directory.Re-run the docker run command and provide a writable mount for /db2graph. - If you are presented with this error, or a similar error, it might be caused by how SELINUX is
configured in your system. Open the config file located in your /etc/selinux/
directory to view the SELINUX entry. If the value is set to
SELINUX=enforcing, then you may be able to resolve the issue by adding:Zto the end of the volume directive in your Docker run command. For example:docker run -it --net=host -v <location>:/db2graph:Z --name=db2graph -e LICENSE=view icr.io/obs/hdm/db2graph:latest-<platform>
Using Podman
If you are running the open source Linux tool, Podman, error messages might be seen when first attempting to run Db2 Graph. For example:
Error: statfs /mnt/graph: no such file or directory
You need to first create the directory that you want to specify in the volume mount command. For example, the directory /mnt/graph must exist before this command is executed:
docker run -it --net=host -v /mnt/graph:/db2graph:--name=db2graph -e LICENSE=view icr.io/obs/hdm/db2graph:latest-<platform>
You may also see the following error:
Error: exec failed: container_linux.go:367: starting container process caused: open /dev/pts/4294967296: no such file or directory: OCI not found
If you are presented with this error, or a similar error, it might be related to the OCI runtime
you are using with Podman (using runc instead of crun). You
can make the switch temporarily by adding the line --runtime /usr/bin/crun
directive to your podman/docker run command. Ensure that you have the crun OCI
runtime installed. For example:
docker run -it --runtime /usr/bin/crun --net=host -v <location>:/db2graph:--name=db2graph -e LICENSE=view icr.io/obs/hdm/db2graph:latest-<platform>
To permanently make the change from runc to crun, change the runtime value in your containers.conf file, located in your /usr/share/containers directory. For example:
runtime = "crun"