Link Search Menu Expand Document
Start for Free

Virtual Graph Configuration

This page describes Virtual Graph configuration in detail.

Page Contents
  1. Overview
  2. Virtual Graph Options
    1. Common Options
    2. JDBC Options
    3. CSV Options

Overview

As discussed in the How Virtual Graphs Work section, a Virtual Graph properties file is one of the four components that make up a Virtual Graph (the others being a unique name, Data Source and mapping file). A virtual graph properties file must be in the Java properties file format.

We showed a minimal example (dept.properties) of a virtual graph properties file to connect to a MySQL database:

jdbc.url=jdbc:mysql://localhost/dept
jdbc.username=MySqlUserName
jdbc.password=MyPassword
jdbc.driver=com.mysql.jdbc.Driver

Recall, the name of the properties file without the extension (dept in the example used), will become the unique name of the virtual graph.

Below you’ll see all available virtual graph options that can be modified.

In cases where you create a Virtual Graph with a private Data Source (without specifying the Data Source to use when creating the Virtual Graph), include the Data Source configuration options in the Virtual Graph properties file as well.

Virtual Graph Options

The following tables list the available options for use in virtual graph properties files.

Common Options

The following options apply to all virtual graphs.

base

Default  
Description Base IRI used to resolve relative IRIs from virtual graphs.

percent.encode

Default true
Description Should IRI template strings be percent-encoded to be valid IRIs? (true/false)

default.mapping.include.tables

Default  
Description A comma-separated list of tables to include when generating default mappings. If blank, mappings will be generated for all tables in the default schema for the connected user, plus any schemas listed in sql.schemas. Cannot be combined with default.mapping.exclude.tables.

default.mapping.exclude.tables

Default  
Description A comma-separated list of tables to exclude when generating default mappings. Mappings will be generated for all tables in the default schema for the connected user, plus any schemas listed in sql.schemas, except those tables listed in this option. Cannot be combined with default.mapping.include.tables.

schema.in.generated.mappings

Default false (true for Elasticsearch)
Description Whether to include the name of the schema (along with the table name) in the templates for IRIs when automatically generating mappings based on source database metadata. For Elasticsearch, setting this to true will cause the index name to be included in the template.

JDBC Options

The following options apply to JDBC Virtual Graphs only.

jdbc.statement.fetch.size

Default  
Required No
Description Gives the JDBC driver a hint as to the number of rows that should be fetched from the database at a time

parser.sql.quoting

Default NATIVE
Description If set to NATIVE, SQL queries (FROM SQL clauses in SMS2 or rr:sqlQuery views in R2RML) will be parsed using the DB-native identifier quoting convention. For example, MySQL queries will be parsed treating backtick as the identifier quote character. If set to ANSI, the ANSI SQL convention of treating a double quote as the identifier quote character will be used instead.

sql.functions

Default  
Description A comma-separated list of SQL function names and optional return types to register with the SQL parser. If a SQL query (in a FROM SQL clause in SMS2 or an rr:sqlQuery view in R2RML) fails to parse, this option can be set to allow the use of non-standard functions. If a return type is to be included, it follows the function name after a colon. Examples: Oracle functions - REGEXP_INSTR,REGEXP_REPLACE:VARCHAR,REGEXP_SUBSTR:VARCHAR(80),REGEXP_LIKE:BOOLEAN, Athena functions - from_iso8601_timestamp:timestamp,date_format:varchar(20)

CSV Options

These options are used when importing CSV files.

csv.separator

Default ,
Description A single-character separator used when importing tabular data files.

csv.quote

Default  
Description A single character used to encapsulate values containing special characters.

csv.escape

Default  
Description A single character used to escape values containing special characters.

csv.header

Default true
Description Should the import process read the header row? When headers are enabled the first row of the input file is used to retrieve the column names and mappings can refer to those column names. (true/false)

csv.skip.empty

Default true
Description Should empty values be skipped in the CSV file? If true no triples will be generated for templates that refer to a column with empty value. (true/false)

csv.hash.function

Default SHA1
Description Which hash function should be used when the # notation is used to import CSV files? Any hash function supported by Stardog is allowed here, SHA1, SHA256, SHA384, SHA512, MURMUR3, XX, MD5.

csv.class

Default  
Description Which class should imported rows be members of? Only used when automatically generating mappings.

unique.key.sets

Default If left blank, every column will be used as part of the unique key.
Description Used to identify the columns that uniquely identify each row in the file. Only used when automatically generating mappings. The property value is a comma-separated list of columns enclosed in parentheses. For example, if a pair of columns FNAME and LNAME together are a unique key, the value to express that is: (FNAME,LNAME). Note that rows that contain a null (or empty value if csv.skip.empty is true) for any of the unique-key columns will not be loaded.