tripal / t4d8

This is a temporary repository for Drupal 9 upgrade for Tripal v4. It is meant to house issues related to the upgrade.
GNU General Public License v2.0
1 stars 10 forks source link

Content Types Creation With Terms #244

Closed spficklin closed 2 years ago

spficklin commented 2 years ago

Issue #212

This PR updates the ChadoPrepare task so that it creates content types using Terms instead of only hard-coded labels.

Changes Added:

To make this happen I made the following changes.

  1. Added functions for importing all of the default ontologies and terms.
    • You'll notice in the ChadoPrepare task that there are a lot of addOntologyXXXX functions. One for each ontology. Each one of these functions adds the IdSpace, Vocabulary and Terms that are required to get content types up and running.
    • There are more ontologies and terms than just what is needed for the content types. I actually added all of the terms used to map columns and tables of Chado in the semantic web part. But, I did not add the support for semantic web. I just added all the terms since I was at it.
  2. Update the function for creating the entity types to be a bit more error tolerant and to automate name creation of the entity types so that it's not up to the programmer to hard-code it.
  3. Minor bug fixes also included:
    • I updated the ChadoIdSpace and ChadoVocabulary classes so their error messages were a bit more informative.
    • I fixed a bug in the ChadoIdSpace where it wasn't getting the default vocabulary if the IdSpace was loaded. I could have issued a new PR for that, but it was such a small change I figured it could be looked at easy enough and this code would break if it wasn't for that fix.
    • I fixed a bug in the ChadoIdSpace where it now checks if the term is valid in the constructor. It could be a perfectly good IdSpace but the is_valid flag didn't get set.

I don't think the creation of Entity Types is done, but I'm not familiar with the design to know what to do after this. The term is being passed in when creating the entity type but I'm not sure if that's correct. So, I'm stopping the code updates until it can be looked at by @4ctrl-alt-del and @laceysanderson.

How to Test

  1. Start with a brand new Tripal installation or drop the chado schema just to get a fresh start and reinstall the tripal and tripal_chado modules.
  2. Install a new version of Chado
  3. Run the prepare step. You should see all of the content types get created.
spficklin commented 2 years ago

Oh, this PR builds off of PR #230 . So, this should not be merged until after that PR is tested and merged.

risharde commented 2 years ago

Reporting back to @spficklin - everything seems working based on instructions for testing but just reporting a warning error.

Dropped Chado via the UI interface Uninstalled the Tripal module and all dependency modules via UI Reinstalled Tripal module via the UI (ran job on the command line) Confirming the content types notices when running prepare task on terminal. I can see there's items now iwthin the Tripal Content Type section and the edit button for each brings me to the content type forms for configuration (I didn't try to save anything since I didn't want to break anything outside of chado). Let me know if we need to test further. There's one type of warning that is repeating itself, please see the following output example: [warning] Creating default object from empty value OBOImporter.php:2378

2022-07-08 17:56:17: Job ID 2. 2022-07-08 17:56:17: Calling: tripal_chado_prepare_chado(chado) [notice] Creating Tripal Materialized Views and Custom Tables... [notice] Loading ontologies... [notice] Importing The Sequence Ontology [notice] Downloading URL http://purl.obolibrary.org/obo/so.obo, saving to /tmp/obo_OaZyV0 [notice] Step 1: Preloading File /tmp/obo_OaZyV0... [warning] Creating default object from empty value OBOImporter.php:2378 [notice] Found the following namespaces: @namespaces. [notice] Step 2: Examining relationships... [notice] Step 3: Loading type defs...04 bytes. [notice] Step 4: Loading terms...: 47,266,240 bytes. [notice] Step 5: Cleanup...Memory: 47,520,320 bytes. [notice] Importing A vocabulary of taxonomic ranks (species, family, phylum, etc) [notice] Downloading URL http://purl.obolibrary.org/obo/taxrank.obo, saving to /tmp/obo_33wTLV [notice] Step 1: Preloading File /tmp/obo_33wTLV... [warning] Creating default object from empty value OBOImporter.php:2378 [notice] Found the following namespaces: @namespaces. [notice] Step 2: Examining relationships... [notice] Step 3: Loading type defs...28 bytes. [notice] Step 4: Loading terms...: 33,922,048 bytes. [notice] Step 5: Cleanup...Memory: 33,931,872 bytes. [notice] Importing Tripal Contact Ontology. A temporary ontology until a more formal appropriate ontology an be identified. [notice] Step 1: Preloading File //var/www/html/drupal/web/modules/t4d8/tripal_chado/files/tcontact.obo... [warning] Creating default object from empty value OBOImporter.php:2378 [notice] Found the following namespaces: @namespaces. [notice] Step 2: Examining relationships... [notice] Step 3: Loading type defs...08 bytes. [notice] Step 4: Loading terms...: 33,767,072 bytes. [notice] Step 5: Cleanup...Memory: 33,768,928 bytes. [notice] Importing Tripal Publication Ontology. A temporary ontology until a more formal appropriate ontology an be identified. [notice] Step 1: Preloading File //var/www/html/drupal/web/modules/t4d8/tripal_chado/files/tpub.obo... [warning] Creating default object from empty value OBOImporter.php:2378 [notice] Found the following namespaces: @namespaces. [notice] Step 2: Examining relationships... [notice] Step 3: Loading type defs...40 bytes. [notice] Step 4: Loading terms...: 34,525,304 bytes. [notice] Step 5: Cleanup...Memory: 34,544,152 bytes. [notice] Populating materialized view cv_root_mview... [notice] Making semantic connections for Chado tables/fields... [notice] Map Chado Controlled vocabularies to Tripal Terms... [notice] Populating materialized view db2cv_mview... [notice] Creating default content types... [notice] Content type, "Organism", created.. [notice] Content type, "Analysis", created.. [notice] Content type, "Project", created.. [notice] Content type, "Study", created.. [notice] Content type, "Contact", created.. [notice] Content type, "Publication", created.. [notice] Content type, "Protocol", created.. [notice] Content type, "Gene", created.. [notice] Content type, "mRNA", created.. [notice] Content type, "Phylogenetic Tree", created.. [notice] Content type, "Physical Map", created.. [notice] Content type, "DNA Library", created.. [notice] Content type, "Genome Assembly", created.. [notice] Content type, "Genome Annotation", created.. [notice] Content type, "Genome Project", created.. [notice] Content type, "Genetic Map", created.. [notice] Content type, "QTL", created.. [notice] Content type, "Sequence Variant", created.. [notice] Content type, "Genetic Marker", created.. [notice] Content type, "Heritable Phenotypic Marker", created.. [notice] Content type, "Phenotypic Trait", created.. [notice] Content type, "Germplasm Accession", created.. [notice] Content type, "Breeding Cross", created.. [notice] Content type, "Germplasm Variety", created.. [notice] Content type, "Recombinant Inbred Line", created.. [notice] Content type, "Biological Sample", created.. [notice] Content type, "Assay", created.. [notice] Content type, "Array Design", created..

laceysanderson commented 2 years ago

Some merge conflicts need to me fixed before further testing. I took a look but there are a few that would be best fixed by @spficklin when he has a moment.

spficklin commented 2 years ago

Okay @laceysanderson and @risharde the merge conflicts are fixed. I tested it on my side again and it seems to still work just fine. It is now fixed and this is ready again for review.

risharde commented 2 years ago

Update: Clearing the cache solved this problem @spficklin so nevermind this WSOD issue.

@spficklin I dropped the chado schema and tried to uninstall tripal chado module from within the UI interface and got the following white screen of death. I'll attempt to install back a chado schema and then try to uninstall the tripal chado module and update this. image

risharde commented 2 years ago

@spficklin Tested and this seems to work great! No noticeable errors on the preparer steps and I can see the content types listed in the Tripal Content Types section of the UI!

laceysanderson commented 2 years ago

Everything is great here except maybe for the terms attachment to content types. In order to not hold up this PR, I've made an issue for that (#256) so that we check it independently. As such, this PR is ready to merge -thanks @spficklin

spficklin commented 2 years ago

Thanks @laceysanderson for the merge and review!! And @risharde for the review.