} $nrules = $nrules + 1; $textualtriggeringrule = "Class: " . make_valid_id($phenotype_label) . "\n"; $textualtriggeringrule .= "\tSubClassOf: phenotype_rule " . "\n"; $textualtriggeringrule .= "\tAnnotations: rdfs:comment \"" . preg_replace('/\\s+/', ' ', trim($phenotype_logical_statements)) . "\"\n"; $textualtriggeringrule .= "\tAnnotations: rdfs:label \"" . $phenotype_label . "\"\n"; $humantriggeringrule = "Class: human_with_" . make_valid_id($phenotype_label) . "\n"; $humantriggeringrule .= " SubClassOf: human_triggering_phenotype_inference_rule" . "\n"; $humantriggeringrule .= " Annotations: rdfs:label \"human with " . $phenotype_label . "\"\n"; if (strlen($phenotype_logical_statements) != 0) { $humantriggeringrule .= "\tEquivalentTo: human and (" . preg_replace('/\\s+/', ' ', trim($phenotype_logical_statements)) . ")\n"; } $textualtriggeringrule .= " Annotations: source \"" . $phenotype_source . "\"\n"; $humantriggeringrule .= " Annotations: source \"" . $phenotype_source . "\"\n"; $textualtriggeringrule .= parse_multiple_URLs($phenotype_URL); $humantriggeringrule .= parse_multiple_URLs($phenotype_URL); if (isset($date_of_evidence) && $date_of_evidence != "") { $textualtriggeringrule .= " Annotations: date_of_evidence \"" . $date_of_evidence . "\"\n"; $humantriggeringrule .= " Annotations: date_of_evidence \"" . $date_of_evidence . "\"\n"; } if (isset($date_of_addition) && $date_of_addition != "") { $textualtriggeringrule .= " Annotations: date_of_addition \"" . $date_of_addition . "\"\n"; $humantriggeringrule .= " Annotations: date_of_addition \"" . $date_of_addition . "\"\n"; } if (isset($date_last_validation) && $date_last_validation != "") { $textualtriggeringrule .= " Annotations: date_last_validation \"" . $date_last_validation . "\"\n"; $humantriggeringrule .= " Annotations: date_last_validation \"" . $date_last_validation . "\"\n"; } if (isset($author_last_validation) && $author_last_validation != "") { $textualtriggeringrule .= " Annotations: author_last_validation \"" . $author_last_validation . "\"\n"; $humantriggeringrule .= " Annotations: author_last_validation \"" . $author_last_validation . "\"\n";
$row_array = array(); // Skip first row if ($row->getRowIndex() == 1) { continue; } // Processing of other rows (except the first) from here on $cellIterator = $row->getCellIterator(); foreach ($cellIterator as $cell) { $row_array[$cell->getColumn()] = $cell->getCalculatedValue(); } $entity_label = $row_array["A"]; $comment = $row_array["B"]; $external_URL = $row_array["C"]; $owl .= "Class: " . make_valid_id($entity_label) . "\n"; $owl .= " Annotations: rdfs:label \"" . $entity_label . "\"\n"; $owl .= parse_multiple_URLs($external_URL); $owl .= " Annotations: rdfs:comment \"" . $comment . "\"\n\n"; } /******************************************************************** ******** Sort rank of the elements in a genotype profile ********** ********************************************************************/ $list_genes = array(); $list_snps = array(); foreach ($list_genes_and_snps_in_rules as $value) { if (strpos($value, "rs") === 0) { $list_snps[] = $value; } else { $list_genes[] = $value; } } sort($list_snps);
if (isset($row_array["J"])) { $author_last_validation = $row_array['J']; } else { $author_last_validation = ""; } if (isset($row_array["K"])) { $author_addition = $row_array['K']; } else { $author_addition = ""; } $owl .= "Class: " . make_valid_id($phenotype_label) . "\n"; $owl .= "\tSubClassOf: human_triggering_phenotype_inference_rule " . "\n"; $owl .= "\tEquivalentTo: " . preg_replace('/\\s+/', ' ', trim($phenotype_logical_statements)) . "\n"; $owl .= "\tAnnotations: rdfs:label \"" . $phenotype_label . "\"\n"; $owl .= "\tAnnotations: source \"" . $phenotype_source . "\"\n"; $owl .= parse_multiple_URLs($phenotype_URL); if (isset($date_of_evidence) && $date_of_evidence == "") { $owl .= " Annotations: date_of_evidence \"" . $date_of_evidence . "\"\n"; } if (isset($date_of_addition) && $date_of_addition == "") { $owl .= " Annotations: date_of_addition \"" . $date_of_addition . "\"\n"; } if (isset($date_last_validation) && $date_last_validation == "") { $owl .= " Annotations: date_last_validation \"" . $date_last_validation . "\"\n"; } if (isset($author_last_validation) && $author_last_validation == "") { $owl .= " Annotations: author_last_validation \"" . $author_last_validation . "\"\n"; } if (isset($author_addition) && $author_addition == "") { $owl .= " Annotations: author_addition \"" . $author_addition . "\"\n"; }