index.php
Go to the documentation of this file.
00001 <?php 00002 00005 00018 ini_set("display_errors", 00019 "Off"); // Don't display errors to the users. Set it to "On" to see errors for debugging purposes. 00020 00021 ini_set("memory_limit", "64M"); 00022 00023 00024 // Database connectivity procedures 00025 include_once("../../framework/db.php"); 00026 00027 // Content negotion class 00028 include_once("../../framework/Conneg.php"); 00029 00030 // The Web Service parent class 00031 include_once("../../framework/WebService.php"); 00032 00033 include_once("../../framework/ProcessorXML.php"); 00034 00035 // Loading the Named Entities Extraction web service 00036 include_once("ConverterIrJSON.php"); 00037 include_once("Dataset.php"); 00038 include_once("InstanceRecord.php"); 00039 include_once("LinkageSchema.php"); 00040 include_once("StructureSchema.php"); 00041 include_once("irJSONParser.php"); 00042 00043 include_once("../../framework/Logger.php"); 00044 00045 $document = ""; 00046 00047 /* 00048 3 mime choices for the text input: 00049 00050 (1) application/iron+json 00051 (2) application/rdf+xml 00052 (3) application/rdf+n3 00053 */ 00054 00055 if(isset($_POST['document'])) 00056 { 00057 $document = $_POST['document']; 00058 } 00059 00060 $docmime = "application/iron+json"; 00061 00062 if(isset($_POST['docmime'])) 00063 { 00064 $docmime = str_replace('\"', '"', $_POST['docmime']); 00065 } 00066 00067 $registered_ip = ""; 00068 00069 if(isset($_POST['registered_ip'])) 00070 { 00071 $registered_ip = $_POST['registered_ip']; 00072 } 00073 00074 $include_dataset_description = "false"; 00075 00076 if(isset($_POST['include_dataset_description'])) 00077 { 00078 $include_dataset_description = strtolower($_POST['include_dataset_description']); 00079 } 00080 00081 $mtime = microtime(); 00082 $mtime = explode(' ', $mtime); 00083 $mtime = $mtime[1] + $mtime[0]; 00084 $starttime = $mtime; 00085 00086 $start_datetime = date("Y-m-d h:i:s"); 00087 00088 $requester_ip = "0.0.0.0"; 00089 00090 if(isset($_SERVER['REMOTE_ADDR'])) 00091 { 00092 $requester_ip = $_SERVER['REMOTE_ADDR']; 00093 } 00094 00095 $parameters = ""; 00096 00097 if(isset($_SERVER['REQUEST_URI'])) 00098 { 00099 $parameters = $_SERVER['REQUEST_URI']; 00100 00101 $pos = strpos($parameters, "?"); 00102 00103 if($pos !== FALSE) 00104 { 00105 $parameters = substr($parameters, $pos, strlen($parameters) - $pos); 00106 } 00107 } 00108 elseif(isset($_SERVER['PHP_SELF'])) 00109 { 00110 $parameters = $_SERVER['PHP_SELF']; 00111 } 00112 00113 $ws_irv = new ConverterIrJSON($document, $docmime, $include_dataset_description, $registered_ip, $requester_ip); 00114 00115 $ws_irv->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], 00116 $_SERVER['HTTP_ACCEPT_LANGUAGE']); 00117 00118 $ws_irv->process(); 00119 00120 $ws_irv->ws_respond($ws_irv->ws_serialize()); 00121 00122 $mtime = microtime(); 00123 $mtime = explode(" ", $mtime); 00124 $mtime = $mtime[1] + $mtime[0]; 00125 $endtime = $mtime; 00126 $totaltime = ($endtime - $starttime); 00127 00128 $logger = new Logger("converter/irv", $requester_ip, "--", $_SERVER['HTTP_ACCEPT'], $start_datetime, $totaltime, 00129 $ws_irv->pipeline_getResponseHeaderStatus(), $_SERVER['HTTP_USER_AGENT']); 00130 00131 00133 00134 ?>
