From e4fa0cb86d97c23c24cd7bdd62c23f03eed312da Mon Sep 17 00:00:00 2001
From: Kelly Rauchenberger <fefferburbia@gmail.com>
Date: Sun, 5 Feb 2017 08:56:39 -0500
Subject: Flattened selrestrs

Now, selrestrs are, instead of logically being a tree of
positive/negative restrictions that are ANDed/ORed together, they are a
flat set of positive restrictions that are ORed together. They are
stored as strings in a table called selrestrs, just like synrestrs,
which makes them a lot more queryable now as well. This change required
some changes to the VerbNet data, because we needed to consolidate any
ANDed clauses into single selrestrs, as well as convert any negative
selrestrs into positive ones. The changes made are detailed on the wiki.

Preposition choices are now encoded as comma-separated lists instead of
using JSON. This change, along with the selrestrs one, allows us to
remove verbly's dependency on nlohmann::json.
---
 generator/schema.sql | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'generator/schema.sql')

diff --git a/generator/schema.sql b/generator/schema.sql
index 33ebc28..2ac658c 100644
--- a/generator/schema.sql
+++ b/generator/schema.sql
@@ -200,7 +200,6 @@ CREATE TABLE `parts` (
   `part_index` INTEGER NOT NULL,
   `type` INTEGER NOT NULL,
   `role` VARCHAR(16),
-  `selrestrs` BLOB,
   `prepositions` BLOB,
   `preposition_literality` SMALLINT,
   `literal_value` VARCHAR(64)
@@ -215,3 +214,10 @@ CREATE TABLE `synrestrs` (
 );
 
 CREATE INDEX `synrestrs_for` ON `synrestrs`(`part_id`);
+
+CREATE TABLE `selrestrs` (
+  `part_id` INTEGER NOT NULL,
+  `selrestr` VARCHAR(32) NOT NULL
+);
+
+CREATE INDEX `selrestrs_for` ON `selrestrs`(`part_id`);
-- 
cgit 1.4.1

