<commit_before><html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
<?php

  $baseIri = "http://www.wikipathways.org/wpi/webservicetest/";
  $ns1 = "http://www.wso2.org/php/xsd";
  $ns2 = "http://www.wikipathways.org/webservice";

  print "<h1>Pathway Info for WP1</h1>";
  $wp1Iri = $baseIri . "?pwId=WP1&method=getPathwayInfo&format=xml";
  $wp1Dom = DOMDocument::load($wp1Iri);

  foreach ($wp1Dom->getElementsByTagNameNS($ns1, 'pathwayInfo') as $pathwayInfo) {
      foreach ($pathwayInfo->getElementsByTagNameNS($ns2, '*') as $child) {
          echo $child->localName, ": ", $child->nodeValue, "<br>";
      }
  }

  print "<h1>Pathway History for WP1, from 2011 to Present</h1>";
  $wp1Iri = $baseIri . "?pwId=WP1&timestamp=20110101000000&method=getPathwayHistory&format=xml";
  $wp1Dom = DOMDocument::load($wp1Iri);

  foreach ($wp1Dom->getElementsByTagNameNS($ns2, 'history') as $history) {
      foreach ($history->getElementsByTagNameNS($ns2, '*') as $child) {
          echo $child->localName, ": ", $child->nodeValue, "<br>";
      }
  }

  print "<h1>All Organisms</h1>";
  $allOrganismsIri = $baseIri . "?method=listOrganisms&format=xml";
  $allOrganismsDom = DOMDocument::load($allOrganismsIri);

  foreach ($allOrganismsDom->getElementsByTagNameNS($ns1, 'organisms') as $organism) {
      echo $organism->nodeValue, "<br>";
  }

  print "<h1>All Pathway Names for Homo sapiens</h1>";
  $allPathwaysIri = $baseIri . "?organism=Homo+sapiens&method=listPathways&format=xml";
  $allPathwaysDom = DOMDocument::load($allPathwaysIri);

  foreach ($allPathwaysDom->getElementsByTagNameNS($ns1, 'pathways') as $pathway) {
      foreach ($pathway->getElementsByTagNameNS($ns2, 'name') as $name) {
          echo $name->nodeValue, "<br>";
      }
  }

?> 
 </body>
</html><commit_msg>Use simpler API calls<commit_after><html>
 <head>
  <title>PHP Examples for WikiPathways API</title>
 </head>
 <body>
<?php

  $baseIri = "http://webservice.wikipathways.org/";
  $ns1 = "http://www.wso2.org/php/xsd";
  $ns2 = "http://www.wikipathways.org/webservice";

  print "<h1>Pathway Info for WP1</h1>";
  $wp1Iri = $baseIri . "getPathwayInfo?pwId=WP1";
  $wp1Dom = DOMDocument::load($wp1Iri);

  foreach ($wp1Dom->getElementsByTagNameNS($ns1, 'pathwayInfo') as $pathwayInfo) {
      foreach ($pathwayInfo->getElementsByTagNameNS($ns2, '*') as $child) {
          echo $child->localName, ": ", $child->nodeValue, "<br>";
      }
  }

  print "<h1>Pathway History for WP1, from 2011 to Present</h1>";
  $wp1Iri = $baseIri . "getPathwayHistory?pwId=WP1&timestamp=20110101000000";
  $wp1Dom = DOMDocument::load($wp1Iri);

  foreach ($wp1Dom->getElementsByTagNameNS($ns2, 'history') as $history) {
      foreach ($history->getElementsByTagNameNS($ns2, '*') as $child) {
          echo $child->localName, ": ", $child->nodeValue, "<br>";
      }
  }

  print "<h1>All Organisms</h1>";
  $allOrganismsIri = $baseIri . "listOrganisms?format=xml";
  $allOrganismsDom = DOMDocument::load($allOrganismsIri);

  foreach ($allOrganismsDom->getElementsByTagNameNS($ns1, 'organisms') as $organism) {
      echo $organism->nodeValue, "<br>";
  }

  print "<h1>All Pathway Names for Homo sapiens</h1>";
  $allPathwaysIri = $baseIri . "listPathways?organism=Homo+sapiens";
  $allPathwaysDom = DOMDocument::load($allPathwaysIri);

  foreach ($allPathwaysDom->getElementsByTagNameNS($ns1, 'pathways') as $pathway) {
      foreach ($pathway->getElementsByTagNameNS($ns2, 'name') as $name) {
          echo $name->nodeValue, "<br>";
      }
  }

?> 
 </body>
</html>
{'fraction_non_alphanumeric': 0.18330513254371122, 'fraction_numerical': 0.02707275803722504, 'mean_word_length': 4.516329704510109, 'pattern_counts': {'":': 4, '<': 45, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, 'xml': 5}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3287053', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1311, 'n_words': 217}