User login

Snips of TCS import function for Taxonomy XML for future reference

<?php
// commented out below from TCS, possibly of interest
  //  $term = (object) array(
  //    'predicates' => array(),
  //  );
   
//    $term->id = $concept->getAttribute('id');

//    $term->uri = $url;

//      $term->name = $termname->textContent;
//      $term->namerefs[] = $termname->getAttribute('ref');

    // Find ALL its relationships. Store them in an array for later linking
//    $relationships = $xp->query("${prefix}TaxonRelationships/${prefix}TaxonRelationship", $concept);

        // $term->relationships array is here for other storage mechanisms (term_relations) to investigate and serialize if they can
//        $term->relationships[$reltype][$reftarget] = $reftarget ;
//        $term->predicates[$reltype][$reftarget] = $reftarget ;
   
    // OBO has extra metadata fields which Drupal by itself will not store.
    // IF we want to save that data, it must be massaged into saveable fields
    // by another module eg the new experimental eol.module
    // that grabs the data on hook_node_presave() and saves it using taxonomy_enhancer.
    //
    // This import module will attempt to NOT make any judgements at this
    // stage about how that data shall be stored.
    //
    // Let other hooks do their own logic with the data on save.
   
//     $term->xml = $xmldoc->saveXML($concept);
    #dpm(simplexml_import_dom($concept));   
  
    #dpm(array("found a taxonConcept ". $term->name ." " . $term->id, $term));
    // Add this term to our list, indexed as best we can.
//    $terms[$term->id] = $term;
   
    // Index this thing as a duplicate handle so we can find it easily if asked for the URL
//    if ($url && (count($concepts) == 1)) {
//      $terms[$url] = &$terms[$term->id];
//    }

  // The first placeholder term definitions are set up.
  // They may want to refer to each other, So now scan the refs for known referees
  // and actually create them so we have tids to link.
  //
  // $terms list may also include pre-existing terms, included for cross-reference and linking
?>

Resolution

Searched words: 
taxonomy_xml_tcs_parse taxonomy xml tcs parse function

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.