<?php  
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");  


include_once("config.php");
include_once("sem/queries.php");  

$qname = $_REQUEST["qname"];
$queryType = $_REQUEST["queryType"];

if ($queryType == "alltriples"){
	$json = queryAllTriples($qname);
	echo json_encode($json);
}
else if ($queryType == "propertyrange"){
	$json = queryPropertyRange($qname);
	echo json_encode($json);
}
else if ($queryType == "label2qname"){
	$label = $_REQUEST["label"];
	echo label2QName($label);
	//echo $label;
}
else if ($queryType == "locallexparse"){
	$desc = $_REQUEST["desc"];
	echo localLexParse($desc);
}
else if ($queryType == "formatentry"){
	$desc = $_REQUEST["desc"];
	$lang = $_REQUEST["lang"];
	echo formatEntry($desc, $lang);
}
else if ($queryType == "getserversstatus"){
	echo getServersStatus();
}
else if ($queryType == "slotvalubreakdown"){
	$slotQName = $_REQUEST["slot"];
	$qname = $_REQUEST["concept"];
	echo slotValuBreakdown($slotQName, $qname);
}
else if ($queryType == "getVersion")
{
	require_once 'bsw/utils.php';
	echo getVersion();
}
//

?>  