-- DBMS: bigquery
CREATE TABLE `open-targets-prod.platform.targets`
(
  id STRING,
  approvedSymbol STRING,
  biotype STRING,
  transcriptIds STRUCT<list ARRAY<STRUCT<element STRING>>>,
  canonicalTranscript STRUCT<id STRING, chromosome STRING, start INT64, `end` INT64, strand STRING>,
  canonicalExons STRUCT<list ARRAY<STRUCT<element STRING>>>,
  genomicLocation STRUCT<chromosome STRING, start INT64, `end` INT64, strand INT64> NOT NULL,
  alternativeGenes STRUCT<list ARRAY<STRUCT<element STRING>>>,
  approvedName STRING NOT NULL,
  go STRUCT<list ARRAY<STRUCT<element STRUCT<id STRING, source STRING, evidence STRING, aspect STRING, geneProduct STRING, ecoId STRING>>>>,
  hallmarks STRUCT<attributes STRUCT<list ARRAY<STRUCT<element STRUCT<pmid INT64, description STRING, attribute_name STRING> NOT NULL>>>, cancerHallmarks STRUCT<list ARRAY<STRUCT<element STRUCT<pmid INT64, description STRING, impact STRING, label STRING> NOT NULL>>>>,
  synonyms STRUCT<list ARRAY<STRUCT<element STRUCT<label STRING, source STRING>>>> NOT NULL,
  symbolSynonyms STRUCT<list ARRAY<STRUCT<element STRUCT<label STRING, source STRING>>>> NOT NULL,
  nameSynonyms STRUCT<list ARRAY<STRUCT<element STRUCT<label STRING, source STRING>>>> NOT NULL,
  functionDescriptions STRUCT<list ARRAY<STRUCT<element STRING>>>,
  subcellularLocations STRUCT<list ARRAY<STRUCT<element STRUCT<location STRING, source STRING, termSL STRING, labelSL STRING>>>>,
  targetClass STRUCT<list ARRAY<STRUCT<element STRUCT<id INT64, label STRING, level STRING NOT NULL> NOT NULL>>>,
  obsoleteSymbols STRUCT<list ARRAY<STRUCT<element STRUCT<label STRING, source STRING>>>> NOT NULL,
  obsoleteNames STRUCT<list ARRAY<STRUCT<element STRUCT<label STRING, source STRING>>>> NOT NULL,
  constraint STRUCT<list ARRAY<STRUCT<element STRUCT<constraintType STRING NOT NULL, score FLOAT64, exp FLOAT64, obs INT64, oe FLOAT64, oeLower FLOAT64, oeUpper FLOAT64, upperRank INT64, upperBin INT64, upperBin6 INT64> NOT NULL>>>,
  tep STRUCT<targetFromSourceId STRING, description STRING, therapeuticArea STRING, url STRING>,
  proteinIds STRUCT<list ARRAY<STRUCT<element STRUCT<id STRING, source STRING> NOT NULL>>>,
  dbXrefs STRUCT<list ARRAY<STRUCT<element STRUCT<id STRING, source STRING>>>> NOT NULL,
  chemicalProbes STRUCT<list ARRAY<STRUCT<element STRUCT<control STRING, drugId STRING, id STRING, isHighQuality BOOL, mechanismOfAction STRUCT<list ARRAY<STRUCT<element STRING>>>, origin STRUCT<list ARRAY<STRUCT<element STRING>>>, probeMinerScore INT64, probesDrugsScore INT64, scoreInCells INT64, scoreInOrganisms INT64, targetFromSourceId STRING, urls STRUCT<list ARRAY<STRUCT<element STRUCT<niceName STRING, url STRING>>>>> NOT NULL>>>,
  homologues STRUCT<list ARRAY<STRUCT<element STRUCT<speciesId STRING, speciesName STRING, homologyType STRING, targetGeneId STRING, isHighConfidence STRING, targetGeneSymbol STRING, queryPercentageIdentity FLOAT64, targetPercentageIdentity FLOAT64, priority INT64> NOT NULL>>>,
  tractability STRUCT<list ARRAY<STRUCT<element STRUCT<modality STRING NOT NULL, id STRING NOT NULL, value BOOL NOT NULL> NOT NULL>>>,
  safetyLiabilities STRUCT<list ARRAY<STRUCT<element STRUCT<event STRING, eventId STRING, effects STRUCT<list ARRAY<STRUCT<element STRUCT<direction STRING, dosing STRING>>>>, biosamples STRUCT<list ARRAY<STRUCT<element STRUCT<cellFormat STRING, cellLabel STRING, tissueId STRING, tissueLabel STRING>>>>, datasource STRING, literature STRING, url STRING, studies STRUCT<list ARRAY<STRUCT<element STRUCT<description STRING, name STRING, type STRING>>>>> NOT NULL>>>,
  pathways STRUCT<list ARRAY<STRUCT<element STRUCT<pathwayId STRING, pathway STRING, topLevelTerm STRING> NOT NULL>>>
);

INSERT INTO `open-targets-prod.platform.targets` (id, approvedSymbol, biotype, transcriptIds, canonicalTranscript, canonicalExons, genomicLocation, alternativeGenes, approvedName, go, hallmarks, synonyms, symbolSynonyms, nameSynonyms, functionDescriptions, subcellularLocations, targetClass, obsoleteSymbols, obsoleteNames, constraint, tep, proteinIds, dbXrefs, chemicalProbes, homologues, tractability, safetyLiabilities, pathways) VALUES ('ENSG00000293196', 'ENSG00000293196', 'lncRNA', {'list': "[{'element': 'ENST00000518134'}]"}, NULL, NULL, {'chromosome': '5', 'start': 151765859, 'end': 151766378, 'strand': -1}, NULL, 'novel transcript', NULL, NULL, {'list': '[]'}, {'list': '[]'}, {'list': '[]'}, NULL, NULL, NULL, {'list': '[]'}, {'list': '[]'}, NULL, NULL, NULL, {'list': '[]'}, NULL, NULL, NULL, NULL, NULL), ('ENSG00000293024', 'ENSG00000293024', 'lncRNA', {'list': "[{'element': 'ENST00000616940'} {'element': 'ENST00000612877'}\n {'element': 'ENST00000618377'} {'element': 'ENST00000615751'}\n {'element': 'ENST00000618611'} {'element': 'ENST00000621842'}\n {'element': 'ENST00000614581'} {'element': 'ENST00000648065'}]"}, NULL, NULL, {'chromosome': '15', 'start': 94841059, 'end': 95169864, 'strand': 1}, NULL, 'novel transcript', NULL, NULL, {'list': '[]'}, {'list': '[]'}, {'list': '[]'}, NULL, NULL, NULL, {'list': '[]'}, {'list': '[]'}, NULL, NULL, NULL, {'list': '[]'}, NULL, NULL, NULL, NULL, NULL), ('ENSG00000293100', 'ENSG00000293100', 'lncRNA', {'list': "[{'element': 'ENST00000533798'}]"}, NULL, NULL, {'chromosome': '6', 'start': 75610958, 'end': 75611788, 'strand': -1}, NULL, 'novel transcript', NULL, NULL, {'list': '[]'}, {'list': '[]'}, {'list': '[]'}, NULL, NULL, NULL, {'list': '[]'}, {'list': '[]'}, NULL, NULL, NULL, {'list': '[]'}, NULL, NULL, NULL, NULL, NULL), ('ENSG00000291258', 'ENSG00000291258', 'lncRNA', {'list': "[{'element': 'ENST00000563202'} {'element': 'ENST00000700878'}\n {'element': 'ENST00000563144'} {'element': 'ENST00000564604'}\n {'element': 'ENST00000566178'}]"}, NULL, NULL, {'chromosome': '15', 'start': 28815346, 'end': 28859007, 'strand': 1}, NULL, 'novel transcript', NULL, NULL, {'list': '[]'}, {'list': '[]'}, {'list': '[]'}, NULL, NULL, NULL, {'list': '[]'}, {'list': '[]'}, NULL, NULL, NULL, {'list': '[]'}, NULL, NULL, NULL, NULL, NULL), ('ENSG00000293000', 'ENSG00000293000', 'lncRNA', {'list': "[{'element': 'ENST00000379010'}]"}, NULL, NULL, {'chromosome': '8', 'start': 85656442, 'end': 85663039, 'strand': -1}, NULL, 'novel transcript', NULL, NULL, {'list': '[]'}, {'list': '[]'}, {'list': '[]'}, NULL, NULL, NULL, {'list': '[]'}, {'list': '[]'}, NULL, NULL, NULL, {'list': '[]'}, NULL, NULL, NULL, NULL, NULL);