query_all = '''
SELECT * FROM STG_ROSOKA.JP_GENERAL
'''

query_stopwords = '''
SELECT * FROM STOPWORDS
'''

query_athg_keywords = '''
SELECT * FROM ATHG_KEYWORDS
'''

query_future_keywords = '''
SELECT * FROM FUTURE_KEYWORDS
'''

query_entity_dict = '''
SELECT * FROM ENTITY_DICTIONARY
'''

query_pp = '''
SELECT * FROM PREDICTION_PROB
'''

query_pe = '''
SELECT * FROM PREDICTION_ENTITY
'''

query_ps = '''
SELECT * FROM PREDICTION_ENTITY_SOURCES
'''

query_document_news = '''
SELECT DTA.ID,DTA.TANGGAL,
  DTA.TITLE,
  DTA.CONTENT,
  DTA.URL,
  N_KEYWORDS_TITLE,
  N_UNIQE_KEYWORDS_TITLE,
  N_KEYWORDS_CONTENT,
  N_UNIQE_KEYWORDS_CONTENT,
  TITLE_SCORE,
  CONTENT_SCORE,
  KEYWORDS_INTENSITY,
  SCORE
FROM
  (SELECT JP_G.ID,
    JP_BLOG."DATE" TANGGAL,
    JP_BLOG.TITLE,
    JP_BLOG.CONTENT,
    JP_BLOG.URL
  FROM
    (SELECT * FROM EDW_DV.VW_JP_GENERAL WHERE PLATFORM = 'BLOG'
    ) JP_G
  LEFT JOIN EDW_DV.VW_JP_MEDIA_CUSTOM JP_BLOG
  ON JP_G.ID = JP_BLOG.ID
  WHERE EDW_DM.F_CONVERT_DATE(JP_BLOG."DATE") BETWEEN TRUNC(SYSDATE)-1 AND TRUNC(SYSDATE)
  UNION
  SELECT JP_G.ID,
    JP_MEDIA.TANGGAL,
    JP_MEDIA.TITLE,
    JP_MEDIA.CONTENT,
    JP_MEDIA.URL
  FROM
    (SELECT * FROM EDW_DV.VW_JP_GENERAL WHERE PLATFORM = 'MEDIA'
    ) JP_G
  LEFT JOIN EDW_DV.VW_JP_MEDIA_POST_METADATA JP_MEDIA
  ON JP_G.ID = JP_MEDIA.ID
  WHERE EDW_DM.F_CONVERT_DATE(JP_MEDIA.TANGGAL) BETWEEN TRUNC(SYSDATE)-1 AND TRUNC(SYSDATE)) DTA
LEFT JOIN STG_ROSOKA.JP_MEDIA_SCORE JPS
ON JPS.ID = DTA.ID
'''

query_document_entity = '''
SELECT ID,TANGGAL,
  TITLE,
  CONTENT, TYPE, NORM,VALUE,SALIENCE,POLARITY, MOOD,INTENSITY, ASPECT
FROM
  (SELECT JP_G.ID,
    JP_BLOG."DATE" TANGGAL,
    JP_BLOG.TITLE,
    JP_BLOG.CONTENT
  FROM
    (SELECT * FROM EDW_DV.VW_JP_GENERAL WHERE PLATFORM = 'BLOG'
    ) JP_G
  LEFT JOIN EDW_DV.VW_JP_MEDIA_CUSTOM JP_BLOG
  ON JP_G.ID = JP_BLOG.ID
  WHERE EDW_DM.F_CONVERT_DATE(JP_BLOG."DATE") BETWEEN TRUNC(SYSDATE)-1 AND TRUNC(SYSDATE)
  UNION
  SELECT JP_G.ID,
    JP_MEDIA.TANGGAL,
    JP_MEDIA.TITLE,
    JP_MEDIA.CONTENT
  FROM
    (SELECT * FROM EDW_DV.VW_JP_GENERAL WHERE PLATFORM = 'MEDIA'
    ) JP_G
  LEFT JOIN EDW_DV.VW_JP_MEDIA_POST_METADATA JP_MEDIA
  ON JP_G.ID = JP_MEDIA.ID
  WHERE EDW_DM.F_CONVERT_DATE(JP_MEDIA.TANGGAL) BETWEEN TRUNC(SYSDATE)-1 AND TRUNC(SYSDATE)) DTA
LEFT JOIN
  (SELECT JR_G.RAW_ID,
    JR_G.SOURCEID,
    JR_ETT.TYPE,
    JR_ETT.NORM,
    JR_ETI.VALUE,
    SALIENCE,POLARITY, MOOD,INTENSITY, ASPECT
  FROM EDW_DV.VW_JR_GENERAL JR_G
  LEFT JOIN EDW_DV.VW_JR_ENTITYLIST_ENTITY JR_ETT
  ON JR_G.SOURCEID = JR_ETT.SOURCEID
  LEFT JOIN STG_ROSOKA.JR_ENTITYLIST_INSTANCES JR_ETI
  ON JR_ETT.EID = JR_ETI.EID AND JR_ETI.LOAD_ID_SH1 = JR_ETT.LOAD_ID_SH1
  WHERE JR_ETT.TYPE IN ('PERSON','ORG','PLACE','EVENT')) ETT ON DTA.ID  = ETT.RAW_ID
'''

