tripal_chado.semweb.inc 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <?php
  2. /**
  3. * Adds defaults to the chado_semweb table.
  4. */
  5. function tripal_chado_populate_chado_semweb_table() {
  6. // Add in all tables and fields into the chado_semweb table.
  7. $chado_tables = chado_get_table_names(TRUE);
  8. foreach ($chado_tables as $chado_table) {
  9. tripal_add_chado_semweb_table($chado_table);
  10. }
  11. // Now set defaults!
  12. //
  13. // VOCABUARIES:
  14. // Add in vocabularies of terms that will be used for the semantic web
  15. //
  16. tripal_insert_db(array(
  17. 'name' => 'foaf',
  18. 'description' => 'Friend of a Friend. A dictionary of people-related terms that can be used in structured data).',
  19. 'url' => 'http://www.foaf-project.org/',
  20. 'urlprefix' => 'http://xmlns.com/foaf/spec/#',
  21. ));
  22. tripal_insert_cv('foaf','Friend of a Friend');
  23. tripal_insert_db(array(
  24. 'name' => 'schema',
  25. 'description' => 'Schema.org. Schema.org is sponsored by Google, Microsoft, Yahoo and Yandex. The vocabularies are developed by an open community process.',
  26. 'url' => 'https://schema.org/',
  27. 'urlprefix' => 'https://schema.org/',
  28. ));
  29. tripal_insert_cv('schema','Schema.org');
  30. tripal_insert_db(array(
  31. 'name' => 'TAXRANK',
  32. 'description' => 'Taxonomic rank vocabulary. A vocabulary of taxonomic ranks (species, family, phylum, etc).',
  33. 'url' => 'https://github.com/phenoscape/taxrank',
  34. 'urlprefix' => 'http://purl.obolibrary.org/obo/TAXRANK_',
  35. ));
  36. tripal_insert_cv('taxrank','Taxonomic rank vocabulary');
  37. tripal_insert_db(array(
  38. 'name' => 'NCBITaxon',
  39. 'description' => 'NCBI organismal classification. An ontology representation of the NCBI organismal taxonomy.',
  40. 'url' => 'http://www.berkeleybop.org/ontologies/ncbitaxon/',
  41. 'urlprefix' => 'http://purl.obolibrary.org/obo/ncbitaxon#',
  42. ));
  43. tripal_insert_cv('ncbitaxon','NCBI organismal classification');
  44. tripal_insert_db(array(
  45. 'name' => 'SWO',
  46. 'description' => 'Software Ontology. An ontology representation of the NCBI organismal taxonomy.',
  47. 'url' => 'http://theswo.sourceforge.net/',
  48. 'urlprefix' => '',
  49. ));
  50. tripal_insert_cv('swo','Software Ontology');
  51. tripal_insert_db(array(
  52. 'name' => 'IAO',
  53. 'description' => 'The Information Artifact Ontology (IAO) is a new ' .
  54. 'ontology of information entities, originally driven by work by the ' .
  55. 'OBI digital entity and realizable information entity branch.',
  56. 'url' => 'https://github.com/information-artifact-ontology/IAO/',
  57. 'urlprefix' => 'http://purl.obolibrary.org/obo/IAO_',
  58. ));
  59. tripal_insert_cv('IAO','Information Artifact Ontology');
  60. tripal_insert_db(array(
  61. 'name' => 'SBO',
  62. 'description' => 'Systems Biology. Terms commonly used in Systems Biology, and in particular in computational modeling.',
  63. 'url' => 'http://www.ebi.ac.uk/sbo/main/',
  64. 'urlprefix' => 'http://purl.obolibrary.org/obo/SBO_',
  65. ));
  66. tripal_insert_cv('sbo','Systems Biology');
  67. //
  68. // SET TERM DEFAULTS
  69. //
  70. $name = tripal_insert_cvterm(array(
  71. 'id' => 'schema:name',
  72. 'name' => 'name',
  73. 'cv_name' => 'schema',
  74. 'definition' => 'The name of the item.',
  75. ));
  76. tripal_associate_chado_semweb_term(NULL, 'uniquename', $name);
  77. tripal_associate_chado_semweb_term(NULL, 'name', $name);
  78. $alternate_name = tripal_insert_cvterm(array(
  79. 'id' => 'schema:alternateName',
  80. 'name' => 'alternateName',
  81. 'cv_name' => 'schema',
  82. 'definition' => 'The name of the item.',
  83. ));
  84. $description = tripal_insert_cvterm(array(
  85. 'id' => 'schema:description',
  86. 'name' => 'description',
  87. 'cv_name' => 'schema',
  88. 'definition' => 'A description of the item.',
  89. ));
  90. tripal_associate_chado_semweb_term(NULL, 'description', $description);
  91. $definition = tripal_insert_cvterm(array(
  92. 'id' => 'IAO:0000115',
  93. 'name' => 'definition',
  94. 'cv_name' => 'iao',
  95. 'definition' => 'The official OBI definition, explaining the meaning of ' .
  96. 'a class or property. Shall be Aristotelian, formalized and normalized. ' .
  97. 'Can be augmented with colloquial definitions.',
  98. ));
  99. tripal_associate_chado_semweb_term(NULL, 'definition', $definition);
  100. $comment = tripal_insert_cvterm(array(
  101. 'id' => 'schema:comment',
  102. 'name' => 'comment',
  103. 'cv_name' => 'schema',
  104. 'definition' => 'Comments, typically from users.',
  105. ));
  106. tripal_associate_chado_semweb_term(NULL, 'comment', $comment);
  107. $time_last_modified = tripal_insert_cvterm(array(
  108. 'id' => 'local:timelastmodified',
  109. 'name' => 'time_last_modified',
  110. 'cv_name' => 'local',
  111. 'definition' => 'The time at which a record for an item was first added.',
  112. ));
  113. tripal_associate_chado_semweb_term(NULL, 'timelastmodified', $time_last_modified);
  114. $time_accessioned = tripal_insert_cvterm(array(
  115. 'id' => 'local:timeaccessioned',
  116. 'name' => 'time_accessioned',
  117. 'cv_name' => 'local',
  118. 'definition' => 'The time at which a record for an item was last upated or modified.',
  119. ));
  120. tripal_associate_chado_semweb_term(NULL, 'timeaccessioned', $time_accessioned);
  121. $time_executed = tripal_insert_cvterm(array(
  122. 'id' => 'local:timeexecuted',
  123. 'name' => 'time_executed',
  124. 'cv_name' => 'local',
  125. 'definition' => 'The time at which a task was executed.',
  126. ));
  127. tripal_associate_chado_semweb_term(NULL, 'timeaccessioned', $time_executed);
  128. $dbxref = tripal_insert_cvterm(array(
  129. 'id' => 'SBO:0000554',
  130. 'name' => 'database cross reference',
  131. 'cv_name' => 'sbo',
  132. 'definition' => 'An annotation which directs one to information contained within a database.',
  133. ));
  134. $relationship = tripal_insert_cvterm(array(
  135. 'id' => 'SBO:0000374',
  136. 'name' => 'relationship',
  137. 'cv_name' => 'sbo',
  138. 'definition' => 'connectedness between entities and/or interactions representing their relatedness or influence. [ src_code:NR ]',
  139. ));
  140. //
  141. // ANALYSIS TABLE
  142. //
  143. $term = tripal_insert_cvterm(array(
  144. 'id' => 'SWO:0000001',
  145. 'name' => 'software',
  146. 'cv_name' => 'schema',
  147. 'definition' => 'Computer software, or generally just software, is any ' .
  148. 'set of machine-readable instructions (most often in the form of a ' .
  149. 'computer program) that conform to a given syntax (sometimes ' .
  150. 'referred to as a language) that is interpretable by a given ' .
  151. 'processor and that directs a computer\'s processor to perform ' .
  152. 'specific operations.',
  153. ));
  154. tripal_associate_chado_semweb_term('analysis', 'program', $term);
  155. $term = tripal_insert_cvterm(array(
  156. 'id' => 'IAO:0000129',
  157. 'name' => 'version number',
  158. 'cv_name' => 'IAO',
  159. 'definition' => 'A version number is an ' .
  160. 'information content entity which is a sequence of characters ' .
  161. 'borne by part of each of a class of manufactured products or its ' .
  162. 'packaging and indicates its order within a set of other products ' .
  163. 'having the same name.',
  164. ));
  165. tripal_associate_chado_semweb_term('analysis', 'programversion', $term);
  166. $term = tripal_insert_cvterm(array(
  167. 'id' => 'IAO:0000064',
  168. 'name' => 'algorithm',
  169. 'cv_name' => 'IAO',
  170. 'definition' => 'An algorithm is a set of instructions for performing a paticular calculation.',
  171. ));
  172. tripal_associate_chado_semweb_term('analysis', 'algorithm', $term);
  173. //
  174. // ORGANISM TABLE
  175. //
  176. $term = tripal_insert_cvterm(array(
  177. 'id' => 'TAXRANK:0000005',
  178. 'name' => 'genus',
  179. 'cv_name' => 'taxrank',
  180. ));
  181. tripal_associate_chado_semweb_term('organism', 'genus', $term);
  182. $term = tripal_insert_cvterm(array(
  183. 'id' => 'TAXRANK:0000006',
  184. 'name' => 'species',
  185. 'cv_name' => 'taxrank',
  186. ));
  187. tripal_associate_chado_semweb_term('organism', 'species', $term);
  188. $term = tripal_insert_cvterm(array(
  189. 'id' => 'TAXRANK:0000045',
  190. 'name' => 'infraspecies',
  191. 'cv_name' => 'taxrank',
  192. ));
  193. tripal_associate_chado_semweb_term('organism', 'infraspecific_name', $term);
  194. $term = tripal_insert_cvterm(array(
  195. 'id' => 'local:infraspecific_type',
  196. 'name' => 'infraspecific_type',
  197. 'definition' => 'The connector type for the infraspecific name',
  198. 'cv_name' => 'local',
  199. ));
  200. tripal_associate_chado_semweb_term('organism', 'type_id', $term);
  201. $term = tripal_insert_cvterm(array(
  202. 'id' => 'NCBITaxon:common_name',
  203. 'name' => 'common name',
  204. 'cv_name' => 'ncbitaxon',
  205. ));
  206. tripal_associate_chado_semweb_term('organism', 'common_name', $term);
  207. $term = tripal_insert_cvterm(array(
  208. 'id' => 'local:abbreviation',
  209. 'name' => 'abbreviation',
  210. 'cv_name' => 'local',
  211. ));
  212. tripal_associate_chado_semweb_term('organism', 'abbreviation', $term);
  213. //
  214. // FEATURE TABLE
  215. //
  216. tripal_associate_chado_semweb_term('feature', 'name', $alternate_name);
  217. //
  218. // PUB TABLE
  219. //
  220. tripal_associate_chado_semweb_term('pub', 'uniquename', $comment);
  221. //
  222. // STOCK TABLE
  223. //
  224. tripal_associate_chado_semweb_term('stock', 'name', $alternate_name);
  225. }