DB2 Version 10.1 for Linux, UNIX, and Windows

createrdfstoreandloader command

The createrdfstoreandloader command analyzes RDF data and creates an empty RDF store whose schema is optimized for the existing RDF data. This command also generates the load files and the commands to load the store from these loader files.

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-createrdfstoreandloader -storeName--------------------------->

>--+-------------------------+--+------------------+------------>
   '- -objectnames--objNames-'  '- -host--hostName-'   

>--+--------------------+-- -db--dbName-- -user--userName------->
   '- -port--portNumber-'                                   

>-- -password--password--+----------------------+--------------->
                         '- -schema--schemaName-'   

>-- -rdfdata--rdfDataFile--------------------------------------->

>--+----------------------------------+------------------------->
   '- -storeloadfile--loadCommandFile-'   

>--+----------------------------+------------------------------->
   '- -storeschemafile--ddlFile-'   

>--+----------------------------------------------+------------><
   '- -systempredicates--systemPredicatesFileName-'   

Command parameters

-storename storeName
Specifies a name for the RDF store. Ensure that the name satisfies the rules for DB2® database server table names and is unique within the database schema.
-objectnames objNames
Specifies a Java™ properties file that lists the names of the RDF store tables. This file can be any valid file name, but it needs to have the extension ".properties".

If you do not specify the objectNames parameter, then system generated table names are used instead.

-host hostNames
Specifies the host where the database is located.
-port portNumber
Specifies the port number of the database.
-db dbName
Specifies the database to which a connection is established. The minimum database page size is 32 KB.
-user userName
Specifies the authorization name that is used to establish the connection.
-password password
Specifies the password that is used to establish the connection.
-schema schemaName
Specifies the database schema in which to create the RDF store.
-rdfdata rdfDataFile
Specifies the path and name of the file which contains existing RDF data, based on which the optimized RDF Store schema would be created. The RDF data file needs to be stored in the nquads format.
-storeloadfile loadCommandFile
Specifies the path and name of the file to create, which contains the load commands to be run to load the data into the created RDF store. You can run this file by using the DB2 command line processor (CLP).

If you do not specify the -storeloadfile parameter, a file with the name loadCommands.sql is created in the current folder.

The load files are created in the folder where the file with the commands is created.

-storeschemafile ddlFile
Specifies the path and name of the file to output the DDL scripts for the store.

If you do not specify the -storeschemafile parameter, the DDL scripts file is not created.

-systempredicates systemPredicatesFileName
In DB2 Version 10.1 Fix Pack 2 and later fix packs, specifies the properties file which contains the system predicates to be applied to the query. These system predicates are stored in a DB2 RDF store to help enable graph level access control.

Example

The following command creates a store named rdfStore1 in database DB1 with port 60000 and schema db2admin on host localhost. The input RDF data file is myRdfData.nq, and the name of the generated store loader file is load.sql in the ./rdfLoader/ directory.
createrdfstoreandloader rdfStore1 -host localhost -port 60000 -db DB1 
-user db2admin -password XXX -schema db2admin 
-rdfdatafile ./myRdfData.nq -storeloadfile ./rdfLoader/load.sql

Usage notes

You must issue the command and parameter names in lowercase.

The directory from which the command is issued must not have a space in its path. The storeloadfile and storeschemafile parameters must not have a space in their path either. On Windows platforms, if any paths that are specified contain a space in the folder or file name, the whole string must be enclosed within double quotation marks.

The Gawk utility required for this command is Versions 4.0 or later.

The Core utility required for this command is Version 8.14 or later.

On Windows platforms, the createrdfStoreAndLoader command requires the CygWin application. After installing CygWin, add <CgyWin_install_directory>/bin to the PATH environment variable. If you do not have CygWin on the path, the following error message is displayed when you run the command:
'Cannot run program "sh": CreateProcess error=2, The system cannot find 
the specified file.'

On Windows platforms, you can start the createrdfStoreAndLoader command either from a CygWin command prompt or default command prompt. When using a CygWin command prompt, all file paths (-rdfdata, -storeloadfile, -storeschemafile, -objectnames) must not include the 'cygdrive' prefix. Instead use a Windows path such as C:\.....