Implemented parsing free resource info from json.
Change-Id: I034a71e0c30f72e864df7288d938e6d74d762801
diff --git a/full/src/main/resources/db/insert/V2.3__insert_resources.sql b/full/src/main/resources/db/insert/V2.3__insert_resources.sql
deleted file mode 100644
index 55cf005..0000000
--- a/full/src/main/resources/db/insert/V2.3__insert_resources.sql
+++ /dev/null
@@ -1 +0,0 @@
-INSERT INTO resource (id, de_title, en_title) VALUES("WPD15","Deutsche Wikipedia Artikel 2015","German Wikipedia Articles 2015");
diff --git a/full/src/main/resources/db/temp/V2.0__insert_annotations.sql b/full/src/main/resources/db/temp/V2.0__insert_annotations.sql
deleted file mode 100644
index 911f5de..0000000
--- a/full/src/main/resources/db/temp/V2.0__insert_annotations.sql
+++ /dev/null
@@ -1,33 +0,0 @@
---foundries
-INSERT INTO annotation (code, type, description) VALUES("base","foundry","Base");
-INSERT INTO annotation (code, type, description) VALUES("dereko","foundry","DeReKo");
-INSERT INTO annotation (code, type, description) VALUES("corenlp","foundry","CoreNLP");
-INSERT INTO annotation (code, type, description) VALUES("cnx","foundry","Connexor");
-INSERT INTO annotation (code, type, description) VALUES("drukola","foundry","DruKoLa");
-INSERT INTO annotation (code, type, description) VALUES("glemm","foundry","Glemm");
-INSERT INTO annotation (code, type, description) VALUES("malt","foundry","Malt");
-INSERT INTO annotation (code, type, description) VALUES("marmot","foundry","MarMot");
-INSERT INTO annotation (code, type, description) VALUES("mate","foundry","Mate");
-INSERT INTO annotation (code, type, description) VALUES("mdp","foundry","MD parser");
-INSERT INTO annotation (code, type, description) VALUES("opennlp","foundry","OpenNLP");
-INSERT INTO annotation (code, type, description) VALUES("sgbr","foundry","Schreibgebrauch");
-INSERT INTO annotation (code, type, description) VALUES("tt","foundry","Tree Tagger");
-INSERT INTO annotation (code, type, description) VALUES("xip","foundry","Xerox Incremental Parser");
-
---layers
-INSERT INTO annotation (code, type, description) VALUES("c","layer","Constituency");
-INSERT INTO annotation (code, type, description) VALUES("d","layer","Dependency");
-INSERT INTO annotation (code, type, description) VALUES("p","layer","Part of speech");
-INSERT INTO annotation (code, type, description) VALUES("l","layer","Lemma");
-INSERT INTO annotation (code, type, description) VALUES("lv","layer","Lemma variant");
-INSERT INTO annotation (code, type, description) VALUES("m","layer","Morphology");
-INSERT INTO annotation (code, type, description) VALUES("ne","layer","Named entity");
-INSERT INTO annotation (code, type, description) VALUES("s","layer","Structure");
-INSERT INTO annotation (code, type, description) VALUES("syn","layer","Syntax");
-
---values
-INSERT INTO annotation (code, type, description) VALUES("s","value","Sentence");
-INSERT INTO annotation (code, type, description) VALUES("p","value","Paragraph");
-INSERT INTO annotation (code, type, description) VALUES("t","value","Text");
-INSERT INTO annotation (code, type, description) VALUES("ADJA","value","Attributive Adjective");
-
diff --git a/full/src/main/resources/db/temp/V2.1__insert_annotation_pairs.sql b/full/src/main/resources/db/temp/V2.1__insert_annotation_pairs.sql
deleted file mode 100644
index 3bf0f32..0000000
--- a/full/src/main/resources/db/temp/V2.1__insert_annotation_pairs.sql
+++ /dev/null
@@ -1,180 +0,0 @@
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="base"),
- (SELECT a.id FROM annotation as a WHERE a.description="Structure"),
- "Base structure layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="dereko"),
- (SELECT a.id FROM annotation as a WHERE a.description="Structure"),
- "DeReKo structure layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="cnx"),
- (SELECT a.id FROM annotation as a WHERE a.description="Constituency"),
- "Connexor constituency layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="cnx"),
- (SELECT a.id FROM annotation as a WHERE a.description="Syntax"),
- "Connexor syntax layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="cnx"),
- (SELECT a.id FROM annotation as a WHERE a.description="Part of speech"),
- "Connexor part of speech layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="cnx"),
- (SELECT a.id FROM annotation as a WHERE a.description="Lemma"),
- "Connexor lemma layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="cnx"),
- (SELECT a.id FROM annotation as a WHERE a.description="Morphology"),
- "Connexor morphology layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="corenlp"),
- (SELECT a.id FROM annotation as a WHERE a.description="Constituency"),
- "CoreNLP constituency layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="corenlp"),
- (SELECT a.id FROM annotation as a WHERE a.description="Part of speech"),
- "CoreNLP part of speech layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="corenlp"),
- (SELECT a.id FROM annotation as a WHERE a.description="Structure"),
- "CoreNLP structure layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="corenlp"),
- (SELECT a.id FROM annotation as a WHERE a.description="Named entity"),
- "CoreNLP named entity layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="drukola"),
- (SELECT a.id FROM annotation as a WHERE a.description="Lemma"),
- "DruKoLa lemma layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="drukola"),
- (SELECT a.id FROM annotation as a WHERE a.description="Part of speech"),
- "DruKoLa part of speech layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="drukola"),
- (SELECT a.id FROM annotation as a WHERE a.description="Morphology"),
- "DruKoLa morphology layer";
-
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="glemm"),
- (SELECT a.id FROM annotation as a WHERE a.description="Lemma"),
- "Glemm lemma layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="malt"),
- (SELECT a.id FROM annotation as a WHERE a.description="Dependency"),
- "Malt dependency layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="marmot"),
- (SELECT a.id FROM annotation as a WHERE a.description="Part of speech"),
- "MarMot part of speech layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="marmot"),
- (SELECT a.id FROM annotation as a WHERE a.description="Morphology"),
- "MarMot morphology layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="mate"),
- (SELECT a.id FROM annotation as a WHERE a.description="Dependency"),
- "Mate dependency layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="mate"),
- (SELECT a.id FROM annotation as a WHERE a.description="Lemma"),
- "Mate lemma layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="mate"),
- (SELECT a.id FROM annotation as a WHERE a.description="Part of speech"),
- "Mate part of speech layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="mate"),
- (SELECT a.id FROM annotation as a WHERE a.description="Morphology"),
- "Mate morphology layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="mdp"),
- (SELECT a.id FROM annotation as a WHERE a.description="Dependency"),
- "MD parser dependency layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="opennlp"),
- (SELECT a.id FROM annotation as a WHERE a.description="Part of speech"),
- "OpenNLP part of speech layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="opennlp"),
- (SELECT a.id FROM annotation as a WHERE a.description="Structure"),
- "OpenNLP structure layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="sgbr"),
- (SELECT a.id FROM annotation as a WHERE a.description="Part of speech"),
- "Schreibgebrauch part of speech layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="sgbr"),
- (SELECT a.id FROM annotation as a WHERE a.description="Lemma"),
- "Schreibgebrauch lemma layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="sgbr"),
- (SELECT a.id FROM annotation as a WHERE a.description="Lemma variant"),
- "Schreibgebrauch lemma variant layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="tt"),
- (SELECT a.id FROM annotation as a WHERE a.description="Part of speech"),
- "Tree Tagger part of speech layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="tt"),
- (SELECT a.id FROM annotation as a WHERE a.description="Lemma"),
- "Tree Tagger lemma layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="tt"),
- (SELECT a.id FROM annotation as a WHERE a.description="Structure"),
- "Tree Tagger structure layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="xip"),
- (SELECT a.id FROM annotation as a WHERE a.description="Lemma"),
- "Xerox Incremental Parser lemma layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="xip"),
- (SELECT a.id FROM annotation as a WHERE a.description="Structure"),
- "Xerox Incremental Parser structure layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="xip"),
- (SELECT a.id FROM annotation as a WHERE a.description="Part of speech"),
- "Xerox Incremental Parser part of speech layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="xip"),
- (SELECT a.id FROM annotation as a WHERE a.description="Constituency"),
- "Xerox Incremental Parser constituency layer";
-
-INSERT INTO annotation_pair (annotation1, annotation2, description)
- SELECT (SELECT a.id FROM annotation as a WHERE a.code="xip"),
- (SELECT a.id FROM annotation as a WHERE a.description="Dependency"),
- "Xerox Incremental Parser dependency layer";
diff --git a/full/src/main/resources/db/temp/V2.2__insert_annotation_pair_values.sql b/full/src/main/resources/db/temp/V2.2__insert_annotation_pair_values.sql
deleted file mode 100644
index 6f628d2..0000000
--- a/full/src/main/resources/db/temp/V2.2__insert_annotation_pair_values.sql
+++ /dev/null
@@ -1,27 +0,0 @@
-INSERT INTO annotation_pair_value (pair_id, value_id)
- SELECT
- (SELECT ap.id FROM annotation_pair as ap WHERE
- ap.annotation1 = (SELECT a.id FROM annotation as a WHERE a.code="opennlp") AND
- ap.annotation2 = (SELECT a.id FROM annotation as a WHERE a.description="Structure")),
- (SELECT a.id FROM annotation as a WHERE a.description="Sentence");
-
-INSERT INTO annotation_pair_value (pair_id, value_id)
- SELECT
- (SELECT ap.id FROM annotation_pair as ap WHERE
- ap.annotation1 = (SELECT a.id FROM annotation as a WHERE a.code="opennlp") AND
- ap.annotation2 = (SELECT a.id FROM annotation as a WHERE a.description="Structure")),
- (SELECT a.id FROM annotation as a WHERE a.description="Paragraph");
-
-INSERT INTO annotation_pair_value (pair_id, value_id)
- SELECT
- (SELECT ap.id FROM annotation_pair as ap WHERE
- ap.annotation1 = (SELECT a.id FROM annotation as a WHERE a.code="opennlp") AND
- ap.annotation2 = (SELECT a.id FROM annotation as a WHERE a.description="Part of speech")),
- (SELECT a.id FROM annotation as a WHERE a.description="Attributive Adjective");
-
-INSERT INTO annotation_pair_value (pair_id, value_id)
- SELECT
- (SELECT ap.id FROM annotation_pair as ap WHERE
- ap.annotation1 = (SELECT a.id FROM annotation as a WHERE a.code="dereko") AND
- ap.annotation2 = (SELECT a.id FROM annotation as a WHERE a.description="Structure")),
- (SELECT a.id FROM annotation as a WHERE a.description="Sentence");
diff --git a/full/src/main/resources/db/temp/V2.4__insert_resource_layers.sql b/full/src/main/resources/db/temp/V2.4__insert_resource_layers.sql
deleted file mode 100644
index 98871f7..0000000
--- a/full/src/main/resources/db/temp/V2.4__insert_resource_layers.sql
+++ /dev/null
@@ -1,6 +0,0 @@
-INSERT INTO resource_layer (resource_id, layer_id)
- SELECT
- (SELECT id FROM resource WHERE id = "WPD15"),
- (SELECT ap.id FROM annotation_pair as ap WHERE
- ap.annotation1 = (SELECT a.id FROM annotation as a WHERE a.code="opennlp") AND
- ap.annotation2 = (SELECT a.id FROM annotation as a WHERE a.description="Part of speech"));
\ No newline at end of file
diff --git a/full/src/main/resources/default-config.xml b/full/src/main/resources/default-config.xml
index d67d911..e5f2c1e 100644
--- a/full/src/main/resources/default-config.xml
+++ b/full/src/main/resources/default-config.xml
@@ -181,7 +181,7 @@
</bean>
<bean id="initializator" class="de.ids_mannheim.korap.config.Initializator"
- init-method="init">
+ init-method="initAnnotation">
</bean>
<!-- Krill -->
diff --git a/full/src/main/resources/free-resources.json b/full/src/main/resources/free-resources.json
new file mode 100644
index 0000000..ea71020
--- /dev/null
+++ b/full/src/main/resources/free-resources.json
@@ -0,0 +1,10 @@
+[{
+ "id": "WPD15",
+ "de_title" : "Deutsche Wikipedia Artikel 2015",
+ "en_title" : "German Wikipedia Articles 2015",
+ "en_description" : "A collection of German Wikipedia articles from May 2015.",
+ "layers": [
+ "opennlp/p",
+ "corenlp/p"
+ ]
+}]
\ No newline at end of file