Revision history for BreakTranscript


Revision [17026]

Last edited on 2015-11-24 11:26:56 by walker [Additional query and formatting]
Additions:
====Speech QC Queries====
//**Interview** - A query that finds the speeches of type "interview", but the title does not reflect our formatting rules://
//**Interview** - A query that finds speeches from a long time ago with the location as the news show on which they appeared. It's likely these errors will have to be corrected manually. Most are marked as speeches as well://
//**Text** - A query that finds speeches where click here (regardless of capitalization) appears in the speechtext://
//**URL** - A query that finds speeches lacking a URL://
//**URL** - A query that finds speeches lacking a URL, but has one mentioned in the speech text (could be the source)://
//**Dates** - A query that finds speeches lacking a speechdate://
//**Dates** - A query that displays all speeches created in the future (with title and speech text)//
WHERE s.created > NOW()
//**Missing State of the States** - A query that finds speeches by governors between Jan 01 YYYY and March 15 YYYY (in search of State of the State speeches)://
//**Cats and Tags** - A query that finds speeches with a certain tag, but not a certain category (originally used to find speeches with 'sanctions-on-x' without Trade as a category)://
Deletions:
====Speech Error Queries====
//**Interview** - A query that finds the speeches of type "intervie", but the title does not reflect our formatting rules://
//**Interview** - A query that finds speeches from a long time ago with the location as the news show on which they appeared. It's likely these errors will have to be corrected manually). Most are marked as speeches as well://
//A query that finds speeches where click here (regardless of capitalization) appears in the speechtext://
//A query that finds speeches lacking a URL://
//A query that finds speeches lacking a URL, but has one mentioned in the speech text (could be the source)://
//A query that finds speeches lacking a speechdate://
//A query that finds speeches by governors between Jan 01 YYYY and March 15 YYYY (in search of State of the State speeches)://
//A query that finds speeches with a certain tag, but not a certain category (originally used to find speeches with 'sanctions-on-x' without Trade as a category)://


Revision [16954]

Edited on 2015-11-06 13:06:24 by EmilyF [Additional query and formatting]
Additions:
//**Titles** - A query that displays all speeches created after a certain date (with title and speech text)//
Deletions:
//**Titles** - A query that displays all speeches after a certain date (with title and speech text)//


Revision [16953]

Edited on 2015-11-06 13:05:52 by EmilyF [adding general titles query]
Additions:
//**Titles** - A query that displays all speeches after a certain date (with title and speech text)//
SELECT s.speech_id, c.candidate_id, s.title, s.created, s.speechtext
FROM speech s JOIN speech_candidate sc USING (speech_id) JOIN candidate c USING (candidate_id)
WHERE s.created >= '06-15-2015'
ORDER BY s.created DESC


Revision [14685]

Edited on 2015-04-07 14:35:59 by MichaelM [reorganization with other SQL pages]
Additions:
IT can perform global changes if we provide a .csv with zero false positives or other errors. If IT does a global change and we identify errors later, they will be next to impossible to isolate and fix so it's better to be 100% sure before hand.
%%(language-ref)
SELECT s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
FROM speech s
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.url, s.speechdate
%%
//**Thomas** - A query that finds the speeches with thomas.loc.gov URLs, but do not have the type Floor Speech//
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.url
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.location
%%
//**Hearing** - A query that finds speeches of type hearing, but the title does not reflect our formatting rules://
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
//**Interview** - A query that finds speeches from a long time ago with the location as the news show on which they appeared. It's likely these errors will have to be corrected manually). Most are marked as speeches as well://
%%(language-ref)
SELECT speech_id, title, location, speechdate
WHERE location LIKE '%Meet the Press%' OR location LIKE '%60%' OR location LIKE '%FOX%' OR location LIKE '%Hardball%' OR location LIKE '%Morning%' OR location LIKE '%ABC%' OR location LIKE '%CNN%' OR location LIKE '%Larry King%' OR location LIKE '%Late Edition%' OR location LIKE '%This Week%' OR location LIKE '%Hannity%' OR location LIKE '%MSNBC%' OR location LIKE '%CBS%'
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.location, c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.speechdate, c.candidate_id
%%
%%(language-ref)
SELECT s.speechdate, c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.speechdate
%%
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id
%%
//A query that finds speeches by governors between Jan 01 YYYY and March 15 YYYY (in search of State of the State speeches)://
%%(language-ref)
SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
WHERE o.officetype_id = 'G' AND s.speechtype_id = 1 AND s.speechdate BETWEEN 'YYYY-01-01' AND 'YYYY-03-15'
ORDER BY s.location
%%
%%(language-ref)
SELECT DISTINCT a.speech_id, a.candidate_id, a.title, a.speechdate
WHERE st.tag_id = ########) a
WHERE sc.category_id = ####### AND st.tag_id = #######)
ORDER BY a.speech_id
%%
Deletions:
Changes can only be done automatically if there are definitely 0 false positives, otherwise they will be next to impossible to isolate and fix.
%%(language-ref)SELECT s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.url, s.speechdate%%
//**Thomas** - A query that finds the speeches with thomas.loc.gov URLs, but do not have the type Floor Speech
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.url%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.location%%
//**Hearing** - A query that finds speeches of type hearing, but the title does not reflect our formatting rules:// **Resolved 10/17/2013**
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
//**Interview** - A query that finds speeches from a long time ago with the location as the news show they appeared on (will have to be done manually), most are marked as speeches as well.://
%%(language-ref)SELECT speech_id, title, location, speechdate
WHERE location LIKE '%Meet the Press%' OR location LIKE '%60%' OR location LIKE '%FOX%' OR location LIKE '%Hardball%' OR location LIKE '%Morning%' OR location LIKE '%ABC%' OR location LIKE '%CNN%' OR location LIKE '%Larry King%' OR location LIKE '%Late Edition%' OR location LIKE '%This Week%' OR location LIKE '%Hannity%' OR location LIKE '%MSNBC%' OR location LIKE '%CBS%'%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.location, c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id, s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.speechdate, c.candidate_id%%
%%SELECT s.speechdate, c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.speechdate%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id%%
//A query that finds speeches by governors between Jan 01 2013 and March 15 2013 (in search of State of the State speeches)://
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
WHERE o.officetype_id = 'G' AND s.speechtype_id = 1 AND s.speechdate BETWEEN '2013-01-01' AND '2013-03-15'
ORDER BY s.location%%
%%SELECT DISTINCT a.speech_id, a.candidate_id, a.title, a.speechdate
WHERE st.tag_id = Y) a
WHERE sc.category_id = X AND st.tag_id = Y)
ORDER BY a.speech_id%%


Revision [12376]

Edited on 2015-01-08 13:54:36 by LeishaD [formatting]
Additions:
FROM speech s JOIN speech_candidate sc using (speech_id) JOIN candidate c using (candidate_id)
FROM speech s JOIN speech_candidate sc USING (speech_id) JOIN candidate c USING (candidate_id) JOIN office_candidate oc USING (candidate_id) JOIN office o USING (office_id)
Deletions:
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id) JOIN office_candidate oc ON (oc.candidate_id = c.candidate_id) JOIN office o ON (o.office_id = oc.office_id)


Revision [11723]

Edited on 2014-10-28 16:55:54 by LeishaD [formatting]
Additions:
WHERE location LIKE '%Meet the Press%' OR location LIKE '%60%' OR location LIKE '%FOX%' OR location LIKE '%Hardball%' OR location LIKE '%Morning%' OR location LIKE '%ABC%' OR location LIKE '%CNN%' OR location LIKE '%Larry King%' OR location LIKE '%Late Edition%' OR location LIKE '%This Week%' OR location LIKE '%Hannity%' OR location LIKE '%MSNBC%' OR location LIKE '%CBS%'%%
Deletions:
WHERE location LIKE '%Meet the Press%' OR location LIKE '%60%' OR location LIKE '%FOX%' OR location LIKE '%Hardball%' OR location LIKE '%Morning%' OR location LIKE '%ABC%' OR location LIKE '%CNN%' OR location LIKE '%Larry King%' OR location LIKE '%Late Edition%' OR location LIKE '%This Week%' OR location LIKE '%Hannity%' OR location LIKE '%MSNBC%' OR location LIKE '%CBS%'


Revision [11722]

Edited on 2014-10-28 16:54:29 by LeishaD [added an "interview" query]
Additions:
//**Interview** - A query that finds speeches from a long time ago with the location as the news show they appeared on (will have to be done manually), most are marked as speeches as well.://
%%(language-ref)SELECT speech_id, title, location, speechdate
FROM speech
WHERE location LIKE '%Meet the Press%' OR location LIKE '%60%' OR location LIKE '%FOX%' OR location LIKE '%Hardball%' OR location LIKE '%Morning%' OR location LIKE '%ABC%' OR location LIKE '%CNN%' OR location LIKE '%Larry King%' OR location LIKE '%Late Edition%' OR location LIKE '%This Week%' OR location LIKE '%Hannity%' OR location LIKE '%MSNBC%' OR location LIKE '%CBS%'


Revision [11360]

Edited on 2014-08-20 15:10:58 by LeishaD [Fixed formatting]
Additions:
Bear in mind some of these queries will return intimidatingly large numbers. **Beware of false positives.** Out of almost 900,000 speeches, errors are to be expected. Depending on the error, it may be possible to give the query to IT who can fix some errors automatically. Others will have to be done manually.
Changes can only be done automatically if there are definitely 0 false positives, otherwise they will be next to impossible to isolate and fix.
//**Interview** - A query that finds the speeches of type "intervie", but the title does not reflect our formatting rules://
//**Issue Position** - A query that finds speeches where the title includes the words Issue Position, but the type is not "Issue Position"://
//A query that finds speeches lacking a URL, but has one mentioned in the speech text (could be the source)://
Deletions:
Bear in mind some of these queries will return intimidatingly large numbers. **Beware of false positives.** Out of almost 800,000 speeches, errors are to be expected. Depending on the error, it may be possible to give the query to IT who can fix some errors automatically. Others will have to be done manually.
//**Interview** - A query that finds the speeches of type “interview”, but the title does not reflect our formatting rules://
//**Issue Position** - A query that finds speeches where the title includes the words Issue Position, but the type is not “Issue Position”://
//A query that finds speeches lacking a URL://, but has one mentioned in the speech text (could be the source)


Revision [11356]

Edited on 2014-08-19 17:03:22 by LeishaD [added lacking a URL, but has URL in text]
Additions:
//A query that finds speeches lacking a URL://, but has one mentioned in the speech text (could be the source)
%%SELECT s.speechdate, c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
WHERE s.url = '' AND s.speechtext LIKE '%http://%'
ORDER BY s.speechdate%%


Revision [11355]

Edited on 2014-08-19 16:51:16 by LeishaD [Added speeches w/ a tag, but not a certain cat]
Additions:
//A query that finds speeches with a certain tag, but not a certain category (originally used to find speeches with 'sanctions-on-x' without Trade as a category)://
%%SELECT DISTINCT a.speech_id, a.candidate_id, a.title, a.speechdate
FROM
(Select s.speech_id, scan.candidate_id, s.title, s.speechdate
FROM speech_category sc JOIN speech s USING (speech_id) JOIN speech_tag st USING (speech_id) JOIN speech_candidate scan USING (speech_id)
WHERE st.tag_id = Y) a
WHERE a.speech_id NOT IN
(Select s.speech_id
FROM speech_category sc JOIN speech s USING (speech_id) JOIN speech_tag st USING (speech_id)
WHERE sc.category_id = X AND st.tag_id = Y)
ORDER BY a.speech_id%%


Revision [11143]

Edited on 2014-07-01 11:59:55 by LeishaD [Added speeches w/ a tag, but not a certain cat]
Additions:
//A query that finds speeches where click here (regardless of capitalization) appears in the speechtext://
Deletions:
//A query that finds speeches where click here” (regardless of capitalization) appears in the speechtext://


Revision [11142]

Edited on 2014-07-01 11:46:20 by LeishaD [fixing weird formatting]
Additions:
//**Thomas** - A query that finds the speeches with thomas.loc.gov URLs, but do not have the type Floor Speech
//**Thomas** - A query that finds the speeches with thomas.loc.gov URLs, but do not have Washington, DC as the location://
//**Hearing** - A query that finds speeches of type hearing, but the title does not reflect our formatting rules:// **Resolved 10/17/2013**
//**Hearing** - A query that finds speeches with Hearing of the in the title, but the type is not hearing://
//**Interview** - A query that finds the speeches with Transcript in the title, but the type is not interview://
//**Letter** - A query that finds speeches of type letter, but the the title does not reflect our formatting rules://
//**Letter** - A query that finds speeches where the title includes the words letter to, but the type is not letter://
//**Issue Position** - A query that finds speeches of type Issue Position, but the title does not reflect our formatting rules://
//**Issue Position** - A query that finds speeches where the title includes the words Issue Position, but the type is not “Issue Position”://
//**Washington, DC** - A query that finds some of the incorrect variations of Washington, DC in the speeches table://
//**Spanish** - A query that finds speeches which include the words prensa, declaracion, discurso that is, probably written in Spanish:// **Alex Coffman went through the results and fixed 95% of the errors found by this query.**
//A query that finds speeches where click here” (regardless of capitalization) appears in the speechtext://
Deletions:
//**Thomas** - A query that finds the speeches with “thomas.loc.gov” URLs, but do not have the type “Floor Speech”://
//**Thomas** - A query that finds the speeches with “thomas.loc.gov” URLs, but do not have “Washington, DC” as the location://
//**Hearing** - A query that finds speeches of type “hearing”, but the title does not reflect our formatting rules:// **Resolved 10/17/2013**
//**Hearing** - A query that finds speeches with “Hearing of the” in the title, but the type is not “hearing”://
//**Interview** - A query that finds the speeches with “Transcript” in the title, but the type is not “interview”://
//**Letter** - A query that finds speeches of type “letter”, but the the title does not reflect our formatting rules://
//**Letter** - A query that finds speeches where the title includes the words “letter to”, but the type is not “letter”://
//**Issue Position** - A query that finds speeches of type “Issue Position”, but the title does not reflect our formatting rules://
//**Issue Position** - A query that finds speeches where the title includes the words “Issue Position”, but the type is not “Issue Position”://
//**Washington, DC** - A query that finds some of the incorrect variations of “Washington, DC” in the speeches table://
//**Spanish** - A query that finds speeches which include the words “prensa, declaracion, discurso” that is, probably written in Spanish:// **Alex Coffman went through the results and fixed 95% of the errors found by this query.**
//A query that finds speeches where “click here” (regardless of capitalization) appears in the speechtext://


Revision [11141]

Edited on 2014-07-01 11:43:27 by LeishaD [fixing weird formatting]
Additions:
//**Thomas** - A query that finds speeches with Page or Time breaks://
Deletions:
//**Thomas** - A query that finds speeches with “page” or “time” breaks://


Revision [10111]

Edited on 2013-10-17 15:13:11 by MichaelM [fixing weird formatting]
Additions:
//A query that finds speeches where “click here” (regardless of capitalization) appears in the speechtext://
Deletions:
//A query that finds speeches where “click here” (regardless of capitolization) appears in the speechtext://


Revision [10110]

Edited on 2013-10-17 15:12:55 by MichaelM [fixing weird formatting]
Additions:
//A query that finds speeches where “click here” (regardless of capitolization) appears in the speechtext://
WHERE s.speechtext ILIKE '%click here%'
Deletions:
//A query that finds speeches where “XXXXXXXXXXXXXX” appears in the speechtext://
WHERE s.speechtext LIKE '%XXXXXXXXXXXXXX%'


Revision [10109]

Edited on 2013-10-17 15:06:14 by MichaelM [fixing weird formatting]
Additions:
//**Hearing** - A query that finds speeches of type “hearing”, but the title does not reflect our formatting rules:// **Resolved 10/17/2013**
Deletions:
**Ready to Correct**
**Ready to Correct**
**Ready to Correct**
//**Hearing** - A query that finds speeches of type “hearing”, but the title does not reflect our formatting rules://


Revision [9839]

Edited on 2013-09-20 16:35:33 by MichaelM [fixing weird formatting]
Additions:
WHERE s.url LIKE '%thomas.loc.gov%' AND s.location != 'Washington, DC'
Deletions:
WHERE s.url LIKE '%homas.%' AND s.url NOT LIKE '%vote%' AND s.url NOT LIKE '%juan%' AND s.url NOT LIKE '%barbara%' AND s.location != 'Washington, DC'


Revision [9838]

Edited on 2013-09-20 16:25:25 by MichaelM [fixing weird formatting]
Additions:
**Ready to Correct**
WHERE s.url LIKE '%homas.%' AND s.url NOT LIKE '%vote%' AND s.url NOT LIKE '%juan%' AND s.url NOT LIKE '%governor%' AND s.speechtype_id != 14
**Ready to Correct**
Deletions:
WHERE s.url LIKE '%homas.%' AND s.url NOT LIKE '%vote%' AND s.speechtype_id != 14


Revision [9837]

Edited on 2013-09-20 16:22:36 by MichaelM [fixing weird formatting]
Additions:
WHERE s.url LIKE '%homas.%' AND s.url NOT LIKE '%vote%' AND s.url NOT LIKE '%juan%' AND s.url NOT LIKE '%governor%' AND s.url != 'http://thomas.loc.gov'
Deletions:
WHERE s.url LIKE '%homas.%' AND s.url NOT LIKE '%vote%' AND s.url NOT LIKE '%juan%' AND s.url != 'http://thomas.loc.gov'


Revision [9761]

Edited on 2013-09-13 16:40:40 by MichaelM [fixing weird formatting]
Additions:
WHERE s.url LIKE '%homas.%' AND s.url NOT LIKE '%vote%' AND s.url NOT LIKE '%juan%' AND s.url NOT LIKE '%barbara%' AND s.location != 'Washington, DC'
Deletions:
WHERE s.url LIKE '%thomas.loc.gov%' AND s.location != 'Washington, DC'


Revision [9760]

Edited on 2013-09-13 16:34:33 by MichaelM [fixing weird formatting]
Additions:
Bear in mind some of these queries will return intimidatingly large numbers. **Beware of false positives.** Out of almost 800,000 speeches, errors are to be expected. Depending on the error, it may be possible to give the query to IT who can fix some errors automatically. Others will have to be done manually.
Deletions:
Bear in mind some of these queries will return intimidatingly large numbers. **Beware of false positives.** Out of over 700,000 speeches, errors are to be expected. Depending on the error, it may be possible to give the query to IT who can fix some errors automatically. Others will have to be done manually.


Revision [9759]

Edited on 2013-09-13 16:33:59 by MichaelM [fixing weird formatting]
Additions:
//**Thomas** - A query that finds the speeches with “thomas.loc.gov” URLs, but do not have the type “Floor Speech”://
WHERE s.url LIKE '%homas.%' AND s.url NOT LIKE '%vote%' AND s.speechtype_id != 14
ORDER BY s.url%%
Deletions:
//**Thomas** - A query that finds the speeches with “thomas.loc.gov” URLs, but do not have the type “speech”://
WHERE s.url LIKE '%thomas.loc.gov%' AND s.speechtype_id != 1


Revision [9755]

Edited on 2013-09-12 12:29:04 by MichaelM [fixing weird formatting]
Additions:
WHERE s.url LIKE '%homas.%' AND s.url NOT LIKE '%vote%' AND s.url NOT LIKE '%juan%' AND s.url != 'http://thomas.loc.gov'
Deletions:
WHERE s.url LIKE '%thomas.%' AND s.url NOT LIKE '%vote%' AND s.url != 'http://thomas.loc.gov'


Revision [9754]

Edited on 2013-09-12 11:08:01 by MichaelM [fixing weird formatting]
Additions:
//**Pledges** - A query that finds speeches with the type: "pledge"://
%%(language-ref)SELECT s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.title%%
Deletions:
SELECT s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY s.title


Revision [9723]

Edited on 2013-09-06 08:09:19 by MichaelM [fixing weird formatting]
Additions:
SELECT s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
WHERE s.speechtype_id = 11
GROUP BY s.speech_id
ORDER BY s.title


Revision [9722]

Edited on 2013-09-05 13:53:12 by MichaelM [fixing weird formatting]
Additions:
WHERE s.title NOT LIKE 'Letter to%' AND s.speechtype_id = 2
WHERE s.title LIKE 'Letter to%' AND s.speechtype_id != 2
Deletions:
WHERE s.title NOT LIKE '%Letter to%' AND s.speechtype_id = 2
WHERE s.title LIKE '%Letter to%' AND s.speechtype_id != 2


Revision [9673]

Edited on 2013-08-27 16:06:02 by MichaelM [fixing weird formatting]
Additions:
//**Spanish** - A query that finds speeches which include the words “prensa, declaracion, discurso” that is, probably written in Spanish:// **Alex Coffman went through the results and fixed 95% of the errors found by this query.**
Deletions:
//**Spanish** - A query that finds speeches which include the words “prensa, declaracion, discurso” that is, probably written in Spanish://**Alex Coffman went through the results and fixed 95% of the errors found by this query.**


Revision [9672]

Edited on 2013-08-27 16:04:49 by MichaelM [fixing weird formatting]
Additions:
//**Spanish** - A query that finds speeches which include the words “prensa, declaracion, discurso” that is, probably written in Spanish://**Alex Coffman went through the results and fixed 95% of the errors found by this query.**
Deletions:
//**Spanish** - A query that finds speeches which include the words “prensa, declaracion, discurso” that is, probably written in Spanish://
**Alex Coffman went through the results and fixed 95% of the errors found by this query.**


Revision [9667]

Edited on 2013-08-27 12:18:22 by MichaelM [fixing weird formatting]
Additions:
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
ORDER BY c.candidate_id%%
%%(language-ref)SELECT c.candidate_id, s.speech_id, s.speechdate, s.title, s.url, s.speechtype_id, s.location
Deletions:
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.title, s.url
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.title, s.url, s.speechtype_id
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.url, s.location
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.location
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.title, s.url, s.speechtype_id
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.title, s.url, s.speechtype_id
%%(language-ref)SELECT s.speech_id, c.lastname, s.speechdate, s.title, s.location


Revision [9661]

Edited on 2013-08-26 08:26:02 by MichaelM [fixing weird formatting]
Additions:
WHERE s.url LIKE '%thomas.%' AND s.url NOT LIKE '%vote%' AND s.url != 'http://thomas.loc.gov'
ORDER BY s.url, s.speechdate%%
**Alex Coffman went through the results and fixed 95% of the errors found by this query.**
Deletions:
WHERE s.url LIKE '%omas.l%' AND s.url != 'http://thomas.loc.gov'
**As of 08/16/2013 this query has been run, and the errors were corrected by IT. Thanks Ed and Clinton.**


Revision [9658]

Edited on 2013-08-23 16:53:25 by MichaelM [fixing weird formatting]
Additions:
//A query that finds speeches lacking a speechdate://
WHERE s.speechdate IS NULL AND s.speechtype_id != 7


Revision [9657]

Edited on 2013-08-23 16:48:34 by MichaelM [fixing weird formatting]
Additions:
//A query that finds speeches lacking a URL://
WHERE s.url = ''
ORDER BY s.speechdate, c.candidate_id%%


Revision [9603]

Edited on 2013-08-16 16:19:45 by MichaelM [fixing weird formatting]
Additions:
**As of 08/16/2013 this query has been run, and the errors were corrected by IT. Thanks Ed and Clinton.**


Revision [9602]

Edited on 2013-08-16 14:34:46 by MichaelM [fixing weird formatting]
Additions:
WHERE s.url LIKE '%omas.l%' AND s.url != 'http://thomas.loc.gov'
Deletions:
WHERE s.url LIKE '%thomas.loc.gov%' AND s.url != 'http://thomas.loc.gov' AND s.url != 'http://thomas.loc.gov/'


Revision [9591]

Edited on 2013-08-14 14:23:06 by MichaelM [fixing weird formatting]
Additions:
//A query that finds speeches by governors between Jan 01 2013 and March 15 2013 (in search of State of the State speeches)://
%%(language-ref)SELECT s.speech_id, c.lastname, s.speechdate, s.title, s.location
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id) JOIN office_candidate oc ON (oc.candidate_id = c.candidate_id) JOIN office o ON (o.office_id = oc.office_id)
WHERE o.officetype_id = 'G' AND s.speechtype_id = 1 AND s.speechdate BETWEEN '2013-01-01' AND '2013-03-15'
ORDER BY s.location%%


Revision [9580]

Edited on 2013-08-09 14:46:45 by MichaelM [fixing weird formatting]
Additions:
//**Issue Position** - A query that finds speeches where the title includes the words “Issue Position”, but the type is not “Issue Position”://
WHERE s.speechtype_id != 7 AND s.title LIKE '%Issue Position:%'
Deletions:
//**Issue Position** - A query that finds speeches where the title includes the words “Issue Position”, but the type is not “Issues Position”://


Revision [9579]

Edited on 2013-08-09 14:45:10 by MichaelM [fixing weird formatting]
Additions:
//**Letter** - A query that finds speeches of type “letter”, but the the title does not reflect our formatting rules://
Deletions:
//**Letter** - A query that finds speeches of type“letter”, but the the title does not reflect our formatting rules://


Revision [9534]

Edited on 2013-07-26 13:50:41 by MichaelM [fixing weird formatting]
Deletions:
//**Speechdate** - A query that finds some speeches with unusual “speechdates”://
WHERE s.speechdate < 'YYYY-MM-DD'


Revision [9533]

Edited on 2013-07-25 16:06:25 by MichaelM [fixing weird formatting]
Additions:
//A query that finds speeches where “XXXXXXXXXXXXXX” appears in the speechtext://
Deletions:
//**Thomas** - A query that finds speeches where “XXXXXXXXXXXXXX” appears in the speechtext://


Revision [9532]

Edited on 2013-07-25 15:50:01 by MichaelM [fixing weird formatting]
Additions:
Bear in mind some of these queries will return intimidatingly large numbers. **Beware of false positives.** Out of over 700,000 speeches, errors are to be expected. Depending on the error, it may be possible to give the query to IT who can fix some errors automatically. Others will have to be done manually.
Deletions:
Bear in mind, some of these queries will return intimidatingly large numbers. **Beware of false positives.** Out of over 700,000 speeches, mistakes are to be expected. Depending on the error, it may be possible to give the query to IT who can fix some errors automatically. Others will have to be done manually.


Revision [9531]

Edited on 2013-07-25 15:49:21 by MichaelM [fixing weird formatting]
Additions:
Bear in mind, some of these queries will return intimidatingly large numbers. **Beware of false positives.** Out of over 700,000 speeches, mistakes are to be expected. Depending on the error, it may be possible to give the query to IT who can fix some errors automatically. Others will have to be done manually.
Deletions:
Bear in mind, some of these queries will return intimidatingly large numbers. **Beware of false positives.** Out of over 700,000 speeches, that is to be expected. Depending on the error, it may be possible to give the query to IT who can fix errors automatically. Others will have to be done manually.


Revision [9530]

Edited on 2013-07-25 15:09:50 by MichaelM [fixing weird formatting]
Additions:
//**Thomas** - A query that finds speeches where “XXXXXXXXXXXXXX” appears in the speechtext://
WHERE s.speechtext LIKE '%XXXXXXXXXXXXXX%'
Deletions:
//**Thomas** - A query that finds speeches where “thomas.loc.gov” appears in the speechtext://
WHERE s.speechtext LIKE '%thomas.loc.gov%'
//**Thomas** - A query that finds speeches where “ORDER OF BUSINESS” appears in the speechtext://
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.speechtext LIKE '%ORDER OF BUSINESS%'
//**Thomas** - A query that finds speeches where “Is there objection to the request” appears in the speechtext://
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.speechtext LIKE '%Is there objection to the request%'


Revision [9529]

Edited on 2013-07-25 14:51:27 by MichaelM [fixing weird formatting]
Additions:
//**Thomas** - A query that finds speeches where “Is there objection to the request” appears in the speechtext://


Revision [9528]

Edited on 2013-07-25 14:51:05 by MichaelM [fixing weird formatting]
Additions:
WHERE s.speechtext LIKE '%Is there objection to the request%'


Revision [9527]

Edited on 2013-07-25 14:50:05 by MichaelM [fixing weird formatting]
Additions:
WHERE s.speechtext LIKE '%ORDER OF BUSINESS%'
Deletions:
WHERE s.speechtext LIKE '%ORDER OF BUSINESS%%'


Revision [9526]

Edited on 2013-07-25 14:48:33 by MichaelM [fixing weird formatting]
Additions:
//**Thomas** - A query that finds speeches where “ORDER OF BUSINESS” appears in the speechtext://
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.speechtext LIKE '%ORDER OF BUSINESS%%'


Revision [9525]

Edited on 2013-07-25 11:36:06 by MichaelM [fixing weird formatting]
Additions:
WHERE s.speechdate < 'YYYY-MM-DD'
Deletions:
WHERE s.speechdate < '2000-01-01'


Revision [9511]

Edited on 2013-07-24 08:51:53 by MichaelM [fixing weird formatting]
Additions:
====Speech Error Queries====
Bear in mind, some of these queries will return intimidatingly large numbers. **Beware of false positives.** Out of over 700,000 speeches, that is to be expected. Depending on the error, it may be possible to give the query to IT who can fix errors automatically. Others will have to be done manually.
Deletions:
====Speeches Error Queries====
Bear in mind, some of these queries will return intimidatingly large numbers. Out of over 700,000 speeches, that is to be expected. Depending on the error, it may be possible to give the query to IT who can fix errors automatically. Others will have to be done manually. **Beware of false positives.**


Revision [9500]

Edited on 2013-07-23 14:48:18 by MichaelM [fixing weird formatting]
Additions:
SpeechesGuide
[[QueriesForSpeeches Speech Research Queries]]


Revision [9499]

Edited on 2013-07-23 14:48:07 by MichaelM [fixing weird formatting]
Additions:
[[QueriesForSpeeches Speech Research Queries]]>>This is a list of queries to be run from time to time to analyze the consistency of our data, i.e. to correct errors and standardize formatting. Notice that the SELECT, FROM, and ORDER BY clauses are all roughly the same. The goal is to display specific information in a specific order so that we can systematically identify and correct public statements containing errors.
Deletions:
[[QueriesForSpeeches Speeches Research Queries]]>>This is a list of queries to be run from time to time to analyze the consistency of our data, i.e. to correct errors and standardize formatting. Notice that the SELECT, FROM, and ORDER BY clauses are all roughly the same. The goal is to display specific information in a specific order so that we can systematically identify and correct public statements containing errors.


Revision [9495]

Edited on 2013-07-23 14:45:50 by MichaelM [fixing weird formatting]
Additions:
[[QueriesForSpeeches Speeches Research Queries]]>>This is a list of queries to be run from time to time to analyze the consistency of our data, i.e. to correct errors and standardize formatting. Notice that the SELECT, FROM, and ORDER BY clauses are all roughly the same. The goal is to display specific information in a specific order so that we can systematically identify and correct public statements containing errors.
Deletions:
[[QuerriesForSpeeches Speeches Research Queries]]>>This is a list of queries to be run from time to time to analyze the consistency of our data, i.e. to correct errors and standardize formatting. Notice that the SELECT, FROM, and ORDER BY clauses are all roughly the same. The goal is to display specific information in a specific order so that we can systematically identify and correct public statements containing errors.


Revision [9494]

Edited on 2013-07-23 14:45:31 by MichaelM [fixing weird formatting]
Additions:
[[QuerriesForSpeeches Speeches Research Queries]]>>This is a list of queries to be run from time to time to analyze the consistency of our data, i.e. to correct errors and standardize formatting. Notice that the SELECT, FROM, and ORDER BY clauses are all roughly the same. The goal is to display specific information in a specific order so that we can systematically identify and correct public statements containing errors.
Deletions:
[[BreakTranscript Speeches Error Queries]]>>This is a list of queries to be run from time to time to analyze the consistency of our data, i.e. to correct errors and standardize formatting. Notice that the SELECT, FROM, and ORDER BY clauses are all roughly the same. The goal is to display specific information in a specific order so that we can systematically identify and correct public statements containing errors.


Revision [9493]

Edited on 2013-07-23 14:45:00 by MichaelM [fixing weird formatting]
Additions:
>>SpeechesGuide
[[UsefulResearchQueries Useful Research Queries]]
[[BreakTranscript Speeches Error Queries]]>>This is a list of queries to be run from time to time to analyze the consistency of our data, i.e. to correct errors and standardize formatting. Notice that the SELECT, FROM, and ORDER BY clauses are all roughly the same. The goal is to display specific information in a specific order so that we can systematically identify and correct public statements containing errors.
Deletions:
This is a list of queries to be run from time to time to analyze the consistency of our data, i.e. to correct errors and standardize formatting. Notice that the SELECT, FROM, and ORDER BY clauses are all roughly the same. The goal is to display specific information in a specific order so that we can systematically identify and correct public statements containing errors.


Revision [9491]

Edited on 2013-07-23 14:43:28 by MichaelM [fixing weird formatting]

No Differences

Revision [9490]

Edited on 2013-07-23 14:43:15 by MichaelM [fixing weird formatting]
Deletions:
If you can think of other queries to improve our data or ways to improve these queries which will improve our data, please send them to me. You don’t even have to write the query yourself, you can just send a suggestion in the form: “we need a query that finds ______ errors in ______ statements.”


Revision [9489]

Edited on 2013-07-23 14:42:51 by MichaelM [fixing weird formatting]
Deletions:
**...there will definitely be false positives**
**...there will definitely be false positives**
**...there will definitely be false positives**
**...there will definitely be false positives**
**...there will definitely be false positives**


Revision [9482]

Edited on 2013-07-23 14:20:25 by MichaelM [fixing weird formatting]
Additions:
**...there will definitely be false positives**
**...there will definitely be false positives**
**...there will definitely be false positives**
**...there will definitely be false positives**
**...there will definitely be false positives**
Deletions:
**there will definitely be false positives**
**there will definitely be false positives**
**there will definitely be false positives**
**there will definitely be false positives**
**there will definitely be false positives**


Revision [9481]

Edited on 2013-07-23 14:19:52 by MichaelM [fixing weird formatting]

No Differences

Revision [9480]

Edited on 2013-07-23 14:19:17 by MichaelM [fixing weird formatting]
Additions:
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.title, s.url
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.title, s.url, s.speechtype_id
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.url, s.location
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.location
ORDER BY s.location, c.candidate_id, s.speechdate%%
Deletions:
SELECT c.candidate_id, c.lastname, s.speechdate, s.title, s.url
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.title, s.url, s.speechtype_id
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.url, s.location
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.title
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.location
ORDER BY s.location, c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.title
ORDER BY c.candidate_id, s.speechdate
SELECT c.candidate_id, c.lastname, s.speechdate, s.title
ORDER BY c.candidate_id, s.speechdate


Revision [9479]

Edited on 2013-07-23 14:17:47 by MichaelM [fixing weird formatting]
Additions:
%%(language-ref)SELECT c.candidate_id, c.lastname, s.speechdate, s.title
ORDER BY c.candidate_id, s.speechdate%%


Revision [9475]

Edited on 2013-07-23 14:14:17 by MichaelM [fixing weird formatting]
Additions:
====Speeches Error Queries====


Revision [9474]

Edited on 2013-07-23 14:11:38 by MichaelM [fixing weird formatting]
Additions:
Bear in mind, some of these queries will return intimidatingly large numbers. Out of over 700,000 speeches, that is to be expected. Depending on the error, it may be possible to give the query to IT who can fix errors automatically. Others will have to be done manually. **Beware of false positives.**
**there will definitely be false positives**
**there will definitely be false positives**
**there will definitely be false positives**
**there will definitely be false positives**
**there will definitely be false positives**
Deletions:
Bear in mind, some of these queries will return intimidatingly large numbers. Out of over 700,000 speeches, that is to be expected. Depending on the error, it may be possible to give the query to IT who can fix errors automatically. Others will have to be done manually. Beware of false positives.
but there will definitely be false positives
but there will definitely be false positives
but there will definitely be false positives
but there will definitely be false positives
still returns false positives


Revision [9473]

Edited on 2013-07-23 14:10:43 by MichaelM [fixing weird formatting]
Additions:
//**Thomas** - A query that finds speeches with “page” or “time” breaks://
//**Thomas** - A query that finds the thomas speeches with incorrect URLs://
//**Thomas** - A query that finds the speeches with “thomas.loc.gov” URLs, but do not have the type “speech”://
//**Thomas** - A query that finds the speeches with “thomas.loc.gov” URLs, but do not have “Washington, DC” as the location://
//**Thomas** - A query that finds speeches where “thomas.loc.gov” appears in the speechtext://
//**Hearing** - A query that finds speeches of type “hearing”, but the title does not reflect our formatting rules://
//**Hearing** - A query that finds speeches with “Hearing of the” in the title, but the type is not “hearing”://
//**Interview** - A query that finds the speeches of type “interview”, but the title does not reflect our formatting rules://
//**Interview** - A query that finds the speeches with “Transcript” in the title, but the type is not “interview”://
//**Letter** - A query that finds speeches of type“letter”, but the the title does not reflect our formatting rules://
//**Letter** - A query that finds speeches where the title includes the words “letter to”, but the type is not “letter”://
//**Issue Position** - A query that finds speeches of type “Issue Position”, but the title does not reflect our formatting rules://
//**Issue Position** - A query that finds speeches where the title includes the words “Issue Position”, but the type is not “Issues Position”://
//**Washington, DC** - A query that finds some of the incorrect variations of “Washington, DC” in the speeches table://
//**Speechdate** - A query that finds some speeches with unusual “speechdates”://
//**Spanish** - A query that finds speeches which include the words “prensa, declaracion, discurso” that is, probably written in Spanish://
Deletions:
Thomas - A query that finds speeches with “page” or “time” breaks:
Thomas - A query that finds the thomas speeches with incorrect URLs:
Thomas - A query that finds the speeches with “thomas.loc.gov” URLs, but do not have the type “speech”:
Thomas - A query that finds the speeches with “thomas.loc.gov” URLs, but do not have “Washington, DC” as the location:
Thomas - A query that finds speeches where “thomas.loc.gov” appears in the speechtext:
Hearing - A query that finds speeches of type “hearing”, but the title does not reflect our formatting rules:
Hearing - A query that finds speeches with “Hearing of the” in the title, but the type is not “hearing”:
Interview - A query that finds the speeches of type “interview”, but the title does not reflect our formatting rules:
Interview - A query that finds the speeches with “Transcript” in the title, but the type is not “interview”:
Letter - A query that finds speeches of type“letter”, but the the title does not reflect our formatting rules:
Letter - A query that finds speeches where the title includes the words “letter to”, but the type is not “letter”:
Issue Position - A query that finds speeches of type “Issue Position”, but the title does not reflect our formatting rules.
Issue Position - A query that finds speeches where the title includes the words “Issue Position”, but the type is not “Issues Position”:
Washington, DC - A query that finds some of the incorrect variations of “Washington, DC” in the speeches table:
Speechdate - A query that finds some speeches with unusual “speechdates”:
Spanish - A query that finds speeches which include the words “prensa, declaracion, discurso” that is, they’re probably written in Spanish:


Revision [9472]

Edited on 2013-07-23 14:08:07 by MichaelM [fixing weird formatting]
Additions:
This is a list of queries to be run from time to time to analyze the consistency of our data, i.e. to correct errors and standardize formatting. Notice that the SELECT, FROM, and ORDER BY clauses are all roughly the same. The goal is to display specific information in a specific order so that we can systematically identify and correct public statements containing errors.

Bear in mind, some of these queries will return intimidatingly large numbers. Out of over 700,000 speeches, that is to be expected. Depending on the error, it may be possible to give the query to IT who can fix errors automatically. Others will have to be done manually. Beware of false positives.

If you can think of other queries to improve our data or ways to improve these queries which will improve our data, please send them to me. You don’t even have to write the query yourself, you can just send a suggestion in the form: “we need a query that finds ______ errors in ______ statements.”

Thomas - A query that finds speeches with “page” or “time” breaks:
SELECT c.candidate_id, c.lastname, s.speechdate, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.speechtext LIKE '%[Page:%' OR s.speechtext LIKE '%[Time:%'
ORDER BY c.candidate_id, s.speechdate

Thomas - A query that finds the thomas speeches with incorrect URLs:
SELECT c.candidate_id, c.lastname, s.speechdate, s.title, s.url
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.url LIKE '%thomas.loc.gov%' AND s.url != 'http://thomas.loc.gov' AND s.url != 'http://thomas.loc.gov/'
ORDER BY c.candidate_id, s.speechdate

Thomas - A query that finds the speeches with “thomas.loc.gov” URLs, but do not have the type “speech”:
SELECT c.candidate_id, c.lastname, s.speechdate, s.title, s.url, s.speechtype_id
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.url LIKE '%thomas.loc.gov%' AND s.speechtype_id != 1
ORDER BY c.candidate_id, s.speechdate

Thomas - A query that finds the speeches with “thomas.loc.gov” URLs, but do not have “Washington, DC” as the location:
SELECT c.candidate_id, c.lastname, s.speechdate, s.url, s.location
FROM speech s JOIN speech_candidate sc USING (speech_id) JOIN candidate c USING (candidate_id)
WHERE s.url LIKE '%thomas.loc.gov%' AND s.location != 'Washington, DC'
ORDER BY c.candidate_id, s.speechdate

Thomas - A query that finds speeches where “thomas.loc.gov” appears in the speechtext:
SELECT c.candidate_id, c.lastname, s.speechdate, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.speechtext LIKE '%thomas.loc.gov%'
ORDER BY c.candidate_id, s.speechdate

Hearing - A query that finds speeches of type “hearing”, but the title does not reflect our formatting rules:
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE title NOT LIKE '%Hearing of the%' AND speechtype_id = 13
ORDER BY c.candidate_id, s.speechdate

Hearing - A query that finds speeches with “Hearing of the” in the title, but the type is not “hearing”:
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE title LIKE '%Hearing of the%' AND speechtype_id != 13
ORDER BY c.candidate_id, s.speechdate
but there will definitely be false positives

Interview - A query that finds the speeches of type “interview”, but the title does not reflect our formatting rules:
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.title NOT LIKE '%Transcript%' AND s.speechtype_id = 3
ORDER BY c.candidate_id, s.speechdate

Interview - A query that finds the speeches with “Transcript” in the title, but the type is not “interview”:
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.title LIKE '%Transcript%' AND s.speechtype_id != 3
ORDER BY c.candidate_id, s.speechdate
but there will definitely be false positives

Letter - A query that finds speeches of type“letter”, but the the title does not reflect our formatting rules:
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.title NOT LIKE '%Letter to%' AND s.speechtype_id = 2
ORDER BY c.candidate_id, s.speechdate

Letter - A query that finds speeches where the title includes the words “letter to”, but the type is not “letter”:
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.title LIKE '%Letter to%' AND s.speechtype_id != 2
ORDER BY c.candidate_id, s.speechdate
but there will definitely be false positives

Issue Position - A query that finds speeches of type “Issue Position”, but the title does not reflect our formatting rules.
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.speechtype_id = 7 AND s.title NOT LIKE '%Issue Position:%'
ORDER BY c.candidate_id, s.speechdate

Issue Position - A query that finds speeches where the title includes the words “Issue Position”, but the type is not “Issues Position”:
SELECT c.candidate_id, c.lastname, s.speechdate, s.speechtype_id, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.speechtype_id = 7 AND s.title NOT LIKE '%Issue Position:%'
ORDER BY c.candidate_id, s.speechdate
but there will definitely be false positives

Washington, DC - A query that finds some of the incorrect variations of “Washington, DC” in the speeches table:
SELECT c.candidate_id, c.lastname, s.speechdate, s.location
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.location LIKE '%ashingto%' AND s.location LIKE '%D%' AND s.location != 'Washington, DC'
ORDER BY s.location, c.candidate_id, s.speechdate
still returns false positives

Speechdate - A query that finds some speeches with unusual “speechdates”:
SELECT c.candidate_id, c.lastname, s.speechdate, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.speechdate < '2000-01-01'
ORDER BY c.candidate_id, s.speechdate

Spanish - A query that finds speeches which include the words “prensa, declaracion, discurso” that is, they’re probably written in Spanish:
SELECT c.candidate_id, c.lastname, s.speechdate, s.title
FROM speech s JOIN speech_candidate sc ON (s.speech_id = sc.speech_id) JOIN candidate c ON (c.candidate_id = sc.candidate_id)
WHERE s.speechtext LIKE '%discurso%' OR s.speechtext LIKE '%prensa%' OR s.speechtext LIKE '%declaracion%'
ORDER BY c.candidate_id, s.speechdate
Deletions:
The contents of this page have been moved to the field boxes page. This page is empty and can be used for something else. MichaelM 05/04/2013


Revision [8810]

Edited on 2013-05-04 11:47:35 by MichaelM [fixing weird formatting]
Additions:
The contents of this page have been moved to the field boxes page. This page is empty and can be used for something else. MichaelM 05/04/2013
Deletions:
This page is empty and can be used for something else. MichaelM 05/04/2013


Revision [8804]

Edited on 2013-05-04 11:40:54 by MichaelM [fixing weird formatting]
Additions:
This page is empty and can be used for something else. MichaelM 05/04/2013
Deletions:
**==== Break in Transcript ====**

We do not always take full transcripts. If you are not taking a full transcript, use BREAK IN TRANSCRIPT at the beginning of the entry, between statements, and at the end of the entry if the official/candidate does not have the final word. If a press release includes a very long list which disrupts the flow of the official's words and does not help clarify the speaker's words, use BREAK IN TRANSCRIPT.

There should be one space after the official/candidate's final statement and then BREAK IN TRANSCRIPT. If the official/candidate goes on to speak much later in the transcript, there should be one space after the BREAK IN TRANSCRIPT and then the text.

~~Text
~~//space//
~~BREAK IN TRANSCRIPT
~~//space//
~~TEXT


Revision [4064]

Edited on 2010-05-26 11:35:09 by DanielKollar [Info on entering title into text box removed]
Deletions:
~~Title


Revision [1669]

Edited on 2008-12-02 15:53:50 by CassieHerbert [Info on entering title into text box removed]
Additions:
There should be one space after the official/candidate's final statement and then BREAK IN TRANSCRIPT. If the official/candidate goes on to speak much later in the transcript, there should be one space after the BREAK IN TRANSCRIPT and then the text.
Deletions:
There should be one space after the official/candidate's final statement and then BREAK IN TRANSCRIPT. If the official/candidate goes on the speak much later in the transcript, there should be one space after the BREAK IN TRANSCRIPT and then the text.


Revision [1621]

Edited on 2008-12-01 16:20:03 by CassieHerbert [Info on entering title into text box removed]
Additions:
~~Title
~~//space//
~~Text
~~//space//
~~BREAK IN TRANSCRIPT
~~//space//
~~TEXT
Deletions:
Title
//space//
Text
//space//
BREAK IN TRANSCRIPT
//space//
TEXT


Revision [1620]

The oldest known version of this page was created on 2008-12-01 16:19:26 by CassieHerbert [Info on entering title into text box removed]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki