Open topic with navigation
You can use a SQL database to store facts and qualifiers for your Fact Store.
HPE Answer Server can connect to any RDBMS that supports SQL. You specify how to connect to the database by setting the appropriate connection string in the
ConnectionString configuration parameter in the FactBank configuration. The most fully tested options are:
The SQL Fact Store contains two tables, one for facts, and one for qualifiers. The facts table stores the values of entity properties. The qualifiers table stores the names and values of particular sets of qualifiers associated with the properties. Each table includes qualifier combination values, which link the properties to the associated qualifiers.
The following sections describe the tables in more detail, and provide some best practices for how to organize your fact stores.
HPE recommends that you organize your tables by creating a separate database for each set of facts and qualifiers. In this case, each database is the backend for its own Fact Bank system, which optimizes the database queries required for an
For example, if you have a collection of facts about company sales histories, and a collection of facts about the products that a company offers, you might create a
sales database and a
products database. Each database is a separate Fact Bank instance in your HPE Answer Server setup, and you can easily query one or both, as required.
The facts table stores the values of entity properties.
This table must have the name
facts. The facts table has four columns, described in the following table.
||text||The code for the entity that this row is about, from your
||text||The code for the property that this row is about, from your
||text||The value of this property for the specified entity, in the associated qualifier combination.|
||integer||The reference value for the rows in the
HPE Answer Server uses this column to find the appropriate property, entity, or property value when a question contains a particular qualifier.
You can optimize the performance of the facts table by creating indexes on each column. For example, in a PostgreSQL instance, HPE recommends that you create a btree index on each column.
The qualifiers table stores the codes and values for qualifiers, and the qualifier combination reference that links a qualifier to a row in the
The table must have the name
qualifiers. The qualifiers table has three columns, described in the following table.
The qualifier combination reference that identifies qualifiers that are associated with a particular property value for an entity.
||text||The code for the property that this qualifier is about, from your
||text||The value of the qualifier in this qualifier combination|
Most data sets will have multiple rows with the same qualifier combination. For example, if your facts table contains the ares of different types of land in a country over time, you might have something like the following table for qualifiers.
In this case, the qualifier combination 0 relates to farmland in 2015, qualifier combination 1 relates to forest in 2015, and so on.
You can optimize the performance of the qualifiers table by creating indexes on each column. For example, in a PostgreSQL instance, HPE recommends that you create a btree index on each column.