Fix australian/american spelling of Organization
Fix australian/american spelling of Organization


Former-commit-id: fe93f73332392945d7a9462b1a543c639e28c766

--- a/getAgency.php
+++ b/getAgency.php
@@ -6,18 +6,22 @@
 function displayValue($key, $value, $mode) {
     global $db, $schemas;
     if ($mode == "view") {
-
+if (strpos($key, "_") === 0 || $key== "metadata") return;
         echo "<tr>";
 
         echo "<td>" . $schemas['agency']["properties"][$key]['x-title'] . "<br><small>" . $schemas['agency']["properties"][$key]['description'] . "</small></td><td>";
         if (is_array($value)) {
             echo "<ol>";
             foreach ($value as $subkey => $subvalue) {
-                if (isset($schemas['agency']["properties"][$key]['x-property'])) {
-                    echo '<li property="' . $schemas['agency']["properties"][$key]['x-property'] . '">';
-                } else {
-                    echo "<li>";
-                }
+                 
+                    echo "<li ";
+                    if (isset($schemas['agency']["properties"][$key]['x-property'])) {
+                    echo ' property="' . $schemas['agency']["properties"][$key]['x-property'] . '" ';
+                }    if (isset($schemas['agency']["properties"][$key]['x-itemprop'])) {
+                    echo ' itemprop="' . $schemas['agency']["properties"][$key]['x-itemprop'] . '" ';
+                }
+                echo " >";
+                
                 echo "$subvalue</li>";
             }
             echo "</ol></td></tr>";
@@ -28,8 +32,8 @@
                 echo "<span>";
             }
             if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") {
-                echo "<a href='$value'>view</a></span>";
-            } else {
+                echo "<a ".($key == 'website' ? 'itemprop="url"':'')." href='$value'>$value</a>";
+                          } else {
                 echo "$value</span>";
             }
         }
@@ -61,7 +65,8 @@
             } else {
                 echo "<label>$key</label><input  class='input-text' type='text' id='$key' name='$key' value='$value'/>";
                 if ((strpos($key, "URL") > 0 || $key == 'website') && $value != "") {
-                    echo "<a href='$value'>view</a>";
+                    echo "<a ".($key == 'website' ? 'itemprop="url"':'')." href='$value'>view</a>";
+                        
                 }
                 if ($key == 'abn') {
                     echo "<a href='http://www.abr.business.gov.au/SearchByAbn.aspx?SearchText=$value'>view abn</a>";
@@ -148,8 +153,8 @@
     }
 
     if ($mode == "view") {
-        echo '<div typeof="schema:GovernmentOrganisation" about="#' . $row['_id'] . '"><table width="100%">';
-        echo '<tr> <td colspan="2"><h3>' . $row['name'] . "</h3></td></tr>";
+        echo '<div itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization" about="#' . $row['_id'] . '"><table width="100%">';
+        echo '<tr> <td colspan="2"><h3 itemprop="name">' . $row['name'] . "</h3></td></tr>";
         echo "<tr><th>Field Name</th><th>Field Value</th></tr>";
     }
     if ($mode == "edit") {
@@ -202,10 +207,10 @@
             echo '<ul>';
             foreach ($rows as $row) {
                 //   print_r($row);
-                echo '<li typeof="schema:GovernmentOrganisation foaf:Organization" about="getAgency.php?id=' . $row->value->_id . '">
-<a href="getAgency.php?id=' . $row->value->_id . '" rel="schema:url foaf:page" property="schema:name foaf:name">' .
+                echo '<li itemscope itemtype="http://schema.org/GovernmentOrganization" typeof="schema:GovernmentOrganization foaf:Organization" about="getAgency.php?id=' . $row->value->_id . '">
+<a href="getAgency.php?id=' . $row->value->_id . '" rel="schema:url foaf:page" property="schema:name foaf:name" itemprop="url"><span itemprop="name">' .
                 $row->value->name
-                . '</a></li>';
+                . '</span></a></li>';
             }
             echo "</ul>";
         } catch (SetteeRestClientException $e) {

--- a/schemas/agency.json.php
+++ b/schemas/agency.json.php
@@ -4,9 +4,9 @@
     "description" => "Representation of government agency and online transparency measures",
     "type" => "object",
     "properties" => Array(
-        "name" => Array("type" => "string", "required" => true, "x-property" => "schema:name foaf:name", "x-title" => "Name", "description" => "Name, most recent and broadest"),
+        "name" => Array("type" => "string", "required" => true, "x-itemprop" => "name", "x-property" => "schema:name foaf:name", "x-title" => "Name", "description" => "Name, most recent and broadest"),
         "shortName" => Array("type" => "string", "required" => false, "x-title" => "Short Name", "description" => "Name shortened, usually to an acronym"),
-        "foiEmail" => Array("type" => "string", "required" => false, "x-title" => "FOI Contact Email", "description" => "FOI contact email if not foi@"),
+        "foiEmail" => Array("type" => "string", "required" => false, "x-title" => "FOI Contact Email", "x-itemprop" => "email", "description" => "FOI contact email if not foi@"),
         "sameAs" => Array("type" => "array", "required" => false, "x-property"=>"owl:sameAs","x-title" => "Same As", "description" => "Same as other URLs/URIs for this entity",
             "items" => Array("type" => "string")),
         "otherNames" => Array("type" => "array", "required" => true, "x-title" => "Past/Other Names", "description" => "Other names for organisation",
@@ -15,7 +15,7 @@
             "items" => Array("type" => "string")),
         "orgType" => Array("type" => "string", "required" => true, "x-title" => "Organisation Type", "description" => "Org type based on legal formation via FMA/CAC legislation etc."),
         "parentOrg" => Array("type" => "string", "required" => true, "x-title" => "Parent Organisation", "description" => "Parent organisation, usually a department of state"),
-        "website" => Array("type" => "string", "required" => true, "x-title" => "Website", "x-property" => "schema:url foaf:homepage", "description" => "Website URL"),
+        "website" => Array("type" => "string", "required" => true, "x-title" => "Website", "x-itemprop" => "url", "x-property" => "schema:url foaf:homepage", "description" => "Website URL"),
         "abn" => Array("type" => "string", "required" => true, "x-title" => "Australian Business Number", "description" => "ABN from business register"),
         "employees" => Array("type" => "string", "required" => true, "x-title" => "2010-2011 employees", "description" => "2010-2011 employees"),
         "contractListURL" => Array("type" => "string", "required" => true,  "x-title" => "Contract Listing", "description" => "Departmental and agency contracts, <a href='http://www.aph.gov.au/senate/pubs/standing_orders/d05.htm'>mandated by the Senate</a>" ),