rdfSqlStorage

Home > Tools > rdfSqlStorage
Versions: English
View Printer Friendly Version

rdfSqlStorage

rdfSqlStorage is a command line tool for managing our new SQL backend introduced in the 0.5.0 Beta release of the Core Library and supported in the Toolkit from the 0.3.0 Alpha release onwards.

Download

You can download this tool which is part of our Tools package by going to Download dotNetRDF Toolkit for Windows

Usage

For details of our SQL backend please see the SQL Backend documentation.

The tool provides a variety of modes that can be used to perform different management tasks. General usage is as follows:

>rdfSqlStorage mode [modeoptions|-help]

If you don't specify any mode then the available modes will be listed for you, to see the options for a particular mode you'd do the following:

>rdfSqlStorage create -help

Available Modes

create

The create mode is used to create a new store, if the database you specify already contains a store then the version and and schema of the store is reported.

Usage is as follows:

>rdfSqlStorage create server db [options]

So for example you might do the following to create a store on Microsoft SQL Server:

>rdfSqlStorage create localhost testdb -dbtype sql -user example -password yourpassword

Important: To create a store you will typically require the following SQL Server permissions: db_ddladmin and db_securityadmin, please see SQL Backend for more detailed documentation on user permissions

drop

The drop mode is used to drop an existing store.

Usage is as follows:

>rdfSqlStorage drop server db [options]

So for example you might do the following to drop a store on SQL Azure:

>rdfSqlStorage create abc123def4 testdb -dbtype azure -user example -password yourpassword

Note: As our store using custom database roles the parts of the drop scripts may error because database servers do not like non-empty database roles being dropped and you will have had to add users to some of these roles in order to use the store.

getscript

The getscript mode is used to extract the database creation or drop scripts so that you can manually create or drop stores.

Usage is as follows:

>rdfSqlStorage getscript dbtype schema script

You can get a list of available schemas using the listschemas mode. As an example the following extracts the create script for the default Hash schema:

>rdfSqlStorage getscript sql Hash Create

Note: This mode outputs the script to standard output so you will typically want to redirect the output to a file so you can use the script as desired.

listgraphs

The listgraphs mode simply lists the graphs present in a store.

Usage is as follows:

>rdfSqlStorage listgraphs server db [options]

So for example to list the graphs in a SQL Azure store you'd do the following:

>rdfSqlStorage listgraphs abc123def4 testdb -dbtype azure -username someuser -password yourpassword

listschemas

The listschemas mode lists the available built-in database schemas, note that the Hash schema is always used by default by this tool unless a mode requires an explicit schema to be specified. If you need to create a store with one of the alternative schemas you should use the getscript mode to extract the appropriate script and create the store manually.

Usage is as follows:

>rdfSqlStorage listschemas

listscripts

The listscripts mode lists the available scripts associated with a built-in database schema.

Usage is as follows:

>rdfSqlStorage listscripts schema

You can get a list of available schemas using the listschemas mode, as an example here's how to list the scripts for the Simple schema:

>rdfSqlStorage listscripts Simple

migrate

The migrate mode is used to migrate a store in our legacy format to the new format or an arbitrary triple store.

This mode uses a configuration file to specify the source and target of the migration, a sample file SampleMigrationConfig.ttl is included in the Toolkit and should be fairly self explanatory particularly if you are familiar with the Configuration API. If not please take a look at Configuration API - SQL Managers and Configuration API - Generic Managers which will show you how to point the tool to connect to different stores.

Usage is as follows:

>rdfSqlStorage migrate migrateConfig.ttl [options]

So for example to run a migration you might do the following:

>rdfSqlStorage migrate migrateConfig.ttl -verify -halt

The optional -verify option causes the tool to verify that migrated data matches the original data and the -halt option causes the tool to stop if verifcation fails. If you specify -verify without -halt then only warnings will be shown for verification failures but migration will continue regardless.

Tags

Command Line, Database, rdfSqlStorage, SQL, Tools, Utilities

Related Content
 
 

Powered By Visual Log from Visual Design Studios

Visual Log is Licensed Free for Any Use on this Website (User is Unregistered)