--
--


SELECT pg_catalog.set_config('search_path', '', false);

--
-- Name: pg_curl; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS pg_curl WITH SCHEMA public;


--
-- Name: EXTENSION pg_curl; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION pg_curl IS 'PostgreSQL cURL allows most curl actions, including data transfer with URL syntax via HTTP, HTTPS, FTP, FTPS, GOPHER, TFTP, SCP, SFTP, SMB, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP and RTMP';


--
-- Name: vector; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS vector WITH SCHEMA public;


--
-- Name: EXTENSION vector; Type: COMMENT; Schema: -; Owner: -
--

COMMENT ON EXTENSION vector IS 'vector data type and ivfflat and hnsw access methods';


--
-- Name: dblp_knn_abstract(public.vector, numeric); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.dblp_knn_abstract(v_query public.vector, nb numeric) RETURNS TABLE(id bigint, ip double precision, doc json)
    LANGUAGE plpgsql
    AS $$
       BEGIN
        SET LOCAL ivfflat.probes = 65;
        SET LOCAL enable_seqscan = off;
        SET LOCAL min_parallel_table_scan_size = 1;
        SET LOCAL parallel_setup_cost = 1;
        RETURN QUERY
        SELECT J.id, (J.abstract_v <#> v_query) AS ip, D.doc AS doc
        FROM dblp_v AS J, dblp AS D
        WHERE D.id = J.id
        ORDER BY ip LIMIT nb;
       END;
       $$;


--
-- Name: dblp_knn_title(public.vector, numeric); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.dblp_knn_title(v_query public.vector, nb numeric) RETURNS TABLE(id bigint, ip double precision, doc json)
    LANGUAGE plpgsql
    AS $$
       BEGIN
        SET LOCAL ivfflat.probes = 65;
        SET LOCAL enable_seqscan = off;
        SET LOCAL min_parallel_table_scan_size = 1;
        SET LOCAL parallel_setup_cost = 1;
        RETURN QUERY
        SELECT J.id, (J.title_v <#> v_query) AS ip, D.doc AS doc
        FROM dblp_v AS J, dblp AS D
        WHERE D.id = J.id
        ORDER BY ip LIMIT nb;
       END;
       $$;


--
-- Name: dblp_knn_title(public.vector, numeric, double precision); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.dblp_knn_title(v_query public.vector, nb numeric, sc double precision) RETURNS TABLE(id bigint)
    LANGUAGE plpgsql
    AS $$
       BEGIN
        SET LOCAL ivfflat.probes = 65;
        SET LOCAL enable_seqscan = off;
        SET LOCAL min_parallel_table_scan_size = 1;
        SET LOCAL parallel_setup_cost = 1;
        RETURN QUERY
	SELECT P.id FROM (
               SELECT J.id , (J.title_v <#> v_query) AS ip
               FROM dblp_v AS J
               ORDER BY ip LIMIT nb
	       ) AS P
	WHERE P.ip <= sc;
       END;
       $$;


--
-- Name: dblp_knn_title_test(public.vector, numeric, double precision); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.dblp_knn_title_test(v_query public.vector, nb numeric, sc double precision) RETURNS TABLE(id bigint, ip double precision)
    LANGUAGE plpgsql
    AS $$
       BEGIN
        SET LOCAL ivfflat.probes = 65;
        SET LOCAL enable_seqscan = off;
        SET LOCAL min_parallel_table_scan_size = 1;
        SET LOCAL parallel_setup_cost = 1;
        RETURN QUERY
	SELECT P.id , P.ip FROM (
               SELECT J.id, (J.title_v <#> v_query) AS ip
               FROM dblp_v AS J
               ORDER BY ip LIMIT nb
	       ) AS P
	WHERE P.ip <= sc;
       END;
       $$;


--
-- Name: getemb_en(text); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.getemb_en(kws text) RETURNS public.vector
    LANGUAGE sql
    AS $$
        WITH s AS (SELECT
        curl_easy_reset(),
        curl_easy_setopt_url('http://127.0.0.1:56010/minilmen?data='||REPLACE(kws,' ','%20')),
        curl_easy_perform(),
        curl_easy_getinfo_data_in()
    )
    SELECT CAST(convert_from(curl_easy_getinfo_data_in, 'utf-8') AS vector(384)) FROM s;
$$;


--
-- Name: qdblp_abstract_bool(text, numeric); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.qdblp_abstract_bool(kws text, nb numeric) RETURNS TABLE(id text, ip double precision, data json)
    LANGUAGE sql
    AS $$
    select J.doc->'_id' as id, ts_rank(to_tsvector('english',T.abstract),to_tsquery('english',kws)) as ip, J.doc as doc
    from dblp as J, dblp_text as T
    where to_tsvector('english',T.abstract) @@ to_tsquery('english',kws) and J.id=T.id
    order by ip desc
    limit nb;
    $$;


--
-- Name: qdblp_abstract_ids(tsquery, numeric); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.qdblp_abstract_ids(query tsquery, nb numeric) RETURNS TABLE(id bigint)
    LANGUAGE sql
    AS $$ select id from dblp_text where to_tsvector('english',abstract) @@ query limit nb $$;


--
-- Name: qdblp_raw_text(text, numeric); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.qdblp_raw_text(kws text, nb numeric) RETURNS TABLE(id bigint, data json)
    LANGUAGE sql
    AS $$ select * from dblp where id in (select * from qdblp_abstract_ids(to_tsquery('english',kws),nb)) $$;


--
-- Name: qdblp_title_ids(tsquery, numeric); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.qdblp_title_ids(query tsquery, nb numeric) RETURNS TABLE(id bigint)
    LANGUAGE sql
    AS $$ select id from dblp_text where to_tsvector('english',title) @@ query limit nb $$;


--
-- Name: qdblp_v_abstract(bigint); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.qdblp_v_abstract(qid bigint) RETURNS public.vector
    LANGUAGE sql
    AS $$select abstract_v from dblp_v where id=qid; $$;


--
-- Name: qdblp_v_title(bigint); Type: FUNCTION; Schema: public; Owner: -
--

CREATE FUNCTION public.qdblp_v_title(qid bigint) RETURNS public.vector
    LANGUAGE sql
    AS $$select title_v from dblp_v where id=qid; $$;




--
-- Name: dblp; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.dblp (
    id bigint NOT NULL,
    doc json
);


--
-- Name: dblp_text; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.dblp_text (
    id bigint NOT NULL,
    title text,
    length integer,
    abstract text
);


--
-- Name: dblp_v; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.dblp_v (
    id bigint NOT NULL,
    title_v public.vector(384),
    abstract_v public.vector(384)
);


--
-- Name: st1_runs_2024; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.st1_runs_2024 (
    run_id character varying(80) NOT NULL,
    manual boolean NOT NULL,
    topic character varying(10) NOT NULL,
    query character varying(10) NOT NULL,
    doc bigint NOT NULL,
    rel real NOT NULL,
    comb real NOT NULL
);


--
-- Name: st1_runs_2024_comb; Type: VIEW; Schema: public; Owner: -
--

CREATE VIEW public.st1_runs_2024_comb AS
 SELECT st1_runs_2024.run_id,
    st1_runs_2024.query,
    st1_runs_2024.doc,
    st1_runs_2024.comb,
    row_number() OVER (PARTITION BY st1_runs_2024.run_id, st1_runs_2024.query ORDER BY st1_runs_2024.comb DESC) AS seq
   FROM public.st1_runs_2024
  ORDER BY st1_runs_2024.run_id, st1_runs_2024.query, (row_number() OVER (PARTITION BY st1_runs_2024.run_id, st1_runs_2024.query ORDER BY st1_runs_2024.comb DESC));


--
-- Name: st1_comb_assessing; Type: VIEW; Schema: public; Owner: -
--

CREATE VIEW public.st1_comb_assessing AS
 SELECT m.run_id,
    m.query,
    sum((((d.doc -> '_source'::text) ->> 'nb_references'::text))::integer) AS nb_ref
   FROM public.st1_runs_2024_comb m,
    public.dblp d
  WHERE ((m.seq <= 10) AND (m.doc = d.id))
  GROUP BY m.run_id, m.query;


--
-- Name: st1_complexity_manual; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.st1_complexity_manual (
    topic_id character varying(10) NOT NULL,
    doc_id bigint NOT NULL,
    comp_score integer NOT NULL,
    cred_score integer,
    student_type character varying(50) NOT NULL
);


--
-- Name: st1_complexity_metrics; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.st1_complexity_metrics (
    id bigint NOT NULL,
    nltk_sent integer,
    nltk_tok integer,
    nltk_cmu_tok integer,
    nltk_cmu_syl integer,
    nltk_cmu_wrd_per_sent real,
    nltk_cmu_syl_per_wrd real,
    nltk_cmu_fkgl real,
    read_sent integer,
    read_tok integer,
    read_syl integer,
    read_char integer,
    read_wordtypes integer,
    read_long_words integer,
    read_complex_words integer,
    read_char_per_wrd real,
    read_wrd_per_sent real,
    read_syl_per_wrd real,
    read_type_token_ratio real,
    read_fkgl real
);


--
-- Name: st1_qrels_origin; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.st1_qrels_origin (
    topic character varying(8) NOT NULL,
    query character varying(16) NOT NULL,
    doc bigint NOT NULL,
    rel integer,
    origin character varying(16) NOT NULL
);


--
-- Name: st1_qrels_test; Type: VIEW; Schema: public; Owner: -
--

CREATE VIEW public.st1_qrels_test AS
 SELECT st1_qrels_origin.topic,
    st1_qrels_origin.query,
    st1_qrels_origin.doc,
    st1_qrels_origin.rel,
    st1_qrels_origin.origin
   FROM public.st1_qrels_origin
  WHERE ((st1_qrels_origin.origin)::text = '2024_test'::text);


--
-- Name: st1_qrels_train; Type: VIEW; Schema: public; Owner: -
--

CREATE VIEW public.st1_qrels_train AS
 SELECT st1_qrels_origin.topic,
    st1_qrels_origin.query,
    st1_qrels_origin.doc,
    st1_qrels_origin.rel,
    st1_qrels_origin.origin
   FROM public.st1_qrels_origin
  WHERE ((st1_qrels_origin.origin)::text <> '2024_test'::text);


--
-- Name: st1_qrels_train_knn; Type: VIEW; Schema: public; Owner: -
--

CREATE VIEW public.st1_qrels_train_knn AS
 SELECT st1_qrels_train.topic,
    st1_qrels_train.query,
    public.dblp_knn_title(public.qdblp_v_title(st1_qrels_train.doc), (10)::numeric, ('-0.8'::numeric)::double precision) AS doc,
    st1_qrels_train.rel,
    st1_qrels_train.origin
   FROM public.st1_qrels_train
  WHERE (st1_qrels_train.rel = 2)
UNION
 SELECT st1_qrels_train.topic,
    st1_qrels_train.query,
    st1_qrels_train.doc,
    st1_qrels_train.rel,
    st1_qrels_train.origin
   FROM public.st1_qrels_train
  WHERE (st1_qrels_train.rel < 2);


--
-- Name: st1_queries; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.st1_queries (
    topic_id character varying(8) NOT NULL,
    query_id character varying(16) NOT NULL,
    query_text text
);


--
-- Name: st1_runs_2023; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.st1_runs_2023 (
    run_id character varying(80) NOT NULL,
    manual boolean NOT NULL,
    topic character varying(10) NOT NULL,
    query character varying(10) NOT NULL,
    doc bigint NOT NULL,
    rel real NOT NULL
);


--
-- Name: st1_runs_2024_rel; Type: VIEW; Schema: public; Owner: -
--

CREATE VIEW public.st1_runs_2024_rel AS
 SELECT st1_runs_2024.run_id,
    st1_runs_2024.query,
    st1_runs_2024.doc,
    st1_runs_2024.rel,
    row_number() OVER (PARTITION BY st1_runs_2024.run_id, st1_runs_2024.query ORDER BY st1_runs_2024.rel DESC) AS seq
   FROM public.st1_runs_2024
  ORDER BY st1_runs_2024.run_id, st1_runs_2024.query, (row_number() OVER (PARTITION BY st1_runs_2024.run_id, st1_runs_2024.query ORDER BY st1_runs_2024.rel DESC));


--
-- Name: st1_topics; Type: TABLE; Schema: public; Owner: -
--

CREATE TABLE public.st1_topics (
    topic_id character varying(8) NOT NULL,
    topic_text text,
    topic_url text,
    nb_q bigint
);


--
-- Name: dblp dblp_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.dblp
    ADD CONSTRAINT dblp_pkey PRIMARY KEY (id);


--
-- Name: dblp_text dblp_text_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.dblp_text
    ADD CONSTRAINT dblp_text_pkey PRIMARY KEY (id);


--
-- Name: dblp_v dblp_v_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.dblp_v
    ADD CONSTRAINT dblp_v_pkey PRIMARY KEY (id);


--
-- Name: st1_queries queries_pk; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_queries
    ADD CONSTRAINT queries_pk PRIMARY KEY (query_id);


--
-- Name: st1_complexity_manual st1_complexity_manual_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_complexity_manual
    ADD CONSTRAINT st1_complexity_manual_pkey PRIMARY KEY (topic_id, doc_id, comp_score, student_type);


--
-- Name: st1_complexity_metrics st1_complexity_metrics_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_complexity_metrics
    ADD CONSTRAINT st1_complexity_metrics_pkey PRIMARY KEY (id);


--
-- Name: st1_qrels_origin st1_qrels_origin_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_qrels_origin
    ADD CONSTRAINT st1_qrels_origin_pkey PRIMARY KEY (query, doc);


--
-- Name: st1_runs_2023 st1_runs_2023_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_runs_2023
    ADD CONSTRAINT st1_runs_2023_pkey PRIMARY KEY (run_id, topic, query, doc);


--
-- Name: st1_runs_2024 st1_runs_2024_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_runs_2024
    ADD CONSTRAINT st1_runs_2024_pkey PRIMARY KEY (run_id, topic, query, doc);


--
-- Name: st1_topics st1_topics_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_topics
    ADD CONSTRAINT st1_topics_pkey PRIMARY KEY (topic_id);


--
-- Name: st1_topics st1_topics_topic_text_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_topics
    ADD CONSTRAINT st1_topics_topic_text_key UNIQUE (topic_text);


--
-- Name: st1_topics st1_topics_topic_url_key; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_topics
    ADD CONSTRAINT st1_topics_topic_url_key UNIQUE (topic_url);


--
-- Name: dblp_text_length_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX dblp_text_length_idx ON public.dblp_text USING btree (length);


--
-- Name: dblp_text_to_tsvector_abstract_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX dblp_text_to_tsvector_abstract_idx ON public.dblp_text USING gin (to_tsvector('english'::regconfig, abstract));


--
-- Name: dblp_text_to_tsvector_title_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX dblp_text_to_tsvector_title_idx ON public.dblp_text USING gin (to_tsvector('english'::regconfig, title));


--
-- Name: dblp_v_abstract_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX dblp_v_abstract_idx ON public.dblp_v USING ivfflat (abstract_v public.vector_ip_ops) WITH (lists='2212');


--
-- Name: dblp_v_title_idx; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX dblp_v_title_idx ON public.dblp_v USING ivfflat (title_v public.vector_ip_ops) WITH (lists='2212');


--
-- Name: fki_complexity_man_docs; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_complexity_man_docs ON public.st1_complexity_manual USING btree (doc_id);


--
-- Name: fki_complexity_man_topic; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_complexity_man_topic ON public.st1_complexity_manual USING btree (topic_id);


--
-- Name: fki_complexity_metrics_doc; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_complexity_metrics_doc ON public.st1_complexity_metrics USING btree (id);


--
-- Name: fki_dblp_text_fk; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_dblp_text_fk ON public.dblp_text USING btree (id);


--
-- Name: fki_dblp_v_fk; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_dblp_v_fk ON public.dblp_v USING btree (id);


--
-- Name: fki_qrels_docs_fk; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_qrels_docs_fk ON public.st1_qrels_origin USING btree (doc);


--
-- Name: fki_qrels_queries_fk; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_qrels_queries_fk ON public.st1_qrels_origin USING btree (query);


--
-- Name: fki_qrels_topics_fk; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_qrels_topics_fk ON public.st1_qrels_origin USING btree (topic);


--
-- Name: fki_runs_2023_doc; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_runs_2023_doc ON public.st1_runs_2023 USING btree (doc);


--
-- Name: fki_runs_2023_queries; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_runs_2023_queries ON public.st1_runs_2023 USING btree (query);


--
-- Name: fki_runs_2023_topics; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_runs_2023_topics ON public.st1_runs_2023 USING btree (topic);


--
-- Name: fki_st1_runs_2024_query; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_st1_runs_2024_query ON public.st1_runs_2024 USING btree (query);


--
-- Name: fki_st1_runs_2024_topic; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX fki_st1_runs_2024_topic ON public.st1_runs_2024 USING btree (topic);


--
-- Name: st1_complexity_manual complexity_man_docs; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_complexity_manual
    ADD CONSTRAINT complexity_man_docs FOREIGN KEY (doc_id) REFERENCES public.dblp(id) NOT VALID;


--
-- Name: st1_complexity_manual complexity_man_topic; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_complexity_manual
    ADD CONSTRAINT complexity_man_topic FOREIGN KEY (topic_id) REFERENCES public.st1_topics(topic_id) NOT VALID;


--
-- Name: st1_complexity_metrics complexity_metrics_doc; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_complexity_metrics
    ADD CONSTRAINT complexity_metrics_doc FOREIGN KEY (id) REFERENCES public.dblp(id) NOT VALID;


--
-- Name: dblp_text dblp_text_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.dblp_text
    ADD CONSTRAINT dblp_text_fk FOREIGN KEY (id) REFERENCES public.dblp(id) NOT VALID;


--
-- Name: dblp_v dblp_v_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.dblp_v
    ADD CONSTRAINT dblp_v_fk FOREIGN KEY (id) REFERENCES public.dblp(id) NOT VALID;


--
-- Name: st1_qrels_origin qrels_docs_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_qrels_origin
    ADD CONSTRAINT qrels_docs_fk FOREIGN KEY (doc) REFERENCES public.dblp(id) NOT VALID;


--
-- Name: st1_qrels_origin qrels_queries_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_qrels_origin
    ADD CONSTRAINT qrels_queries_fk FOREIGN KEY (query) REFERENCES public.st1_queries(query_id) NOT VALID;


--
-- Name: st1_qrels_origin qrels_topics_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_qrels_origin
    ADD CONSTRAINT qrels_topics_fk FOREIGN KEY (topic) REFERENCES public.st1_topics(topic_id) NOT VALID;


--
-- Name: st1_runs_2023 runs_2023_doc; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_runs_2023
    ADD CONSTRAINT runs_2023_doc FOREIGN KEY (doc) REFERENCES public.dblp(id) NOT VALID;


--
-- Name: st1_runs_2023 runs_2023_queries; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_runs_2023
    ADD CONSTRAINT runs_2023_queries FOREIGN KEY (query) REFERENCES public.st1_queries(query_id) NOT VALID;


--
-- Name: st1_runs_2023 runs_2023_topics; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_runs_2023
    ADD CONSTRAINT runs_2023_topics FOREIGN KEY (topic) REFERENCES public.st1_topics(topic_id) NOT VALID;


--
-- Name: st1_queries st1_queries_topic_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_queries
    ADD CONSTRAINT st1_queries_topic_id_fkey FOREIGN KEY (topic_id) REFERENCES public.st1_topics(topic_id);


--
-- Name: st1_runs_2024 st1_runs_2024_doc_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_runs_2024
    ADD CONSTRAINT st1_runs_2024_doc_fkey FOREIGN KEY (doc) REFERENCES public.dblp(id);


--
-- Name: st1_runs_2024 st1_runs_2024_query; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_runs_2024
    ADD CONSTRAINT st1_runs_2024_query FOREIGN KEY (query) REFERENCES public.st1_queries(query_id) NOT VALID;


--
-- Name: st1_runs_2024 st1_runs_2024_topic; Type: FK CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY public.st1_runs_2024
    ADD CONSTRAINT st1_runs_2024_topic FOREIGN KEY (topic) REFERENCES public.st1_topics(topic_id) NOT VALID;


--
--

