示例#1
0
<?php

/* READ yakNE AND CREATE THE ONTOLOGY FILE FOR EXALEAD
 * A BATCH ./compileOntology.sh COMPILES EVERY NIGHT THE XML to one DICO (see crontab-e)
 * */
ini_set('display_errors', 1);
$templateFile = './input/ontologyTemplate.xml';
$outputFile = './output/ontologies/yakne.xml';
require_once "../LIB/conf.php";
$conf = new conf();
$yakNEColl = $conf->mdb()->yakNE;
$yakNE = $yakNEColl->find(array('status' => 1));
$ontolgyXML = '<Ontology xmlns="exa:com.exalead.mot.components.ontology">
	<Pkg path="yakNE" >';
$row = 0;
foreach ($yakNE as $ne) {
    $row++;
    //echo '<br>NE:'.$ne['title'];
    foreach ($ne['match'] as $match) {
        if (empty($match['level'])) {
            $level = "normalized";
        } else {
            $level = $match['level'];
        }
        //echo '<br>-->match:'.$match['title'];
        $ontolgyXML .= '
			<Entry display="' . indexForOntology($match['title']) . '"><Form level="' . $level . '"/></Entry>';
    }
}
$ontolgyXML .= '
	</Pkg>
示例#2
0
 2 : Waiting for validation
 3 : blacklisted by operator
 10 : GMAP did not succeed to find a location
 11 : if the place the info is mapped to has been blacklisted by the operator
 12 : Location found is not in the feed zone
 13 : info not geolocalized and refused by parser defaultPrintFlag (= 3 )
*/
/*FEED DEFAULT PRINT FLAG*/
// "defaultPrintFlag" => 0, if not geolocalized, we localize at the default location but we don't print on the map ( only in the text feed )
// "defaultPrintFlag" => 1,// if not geolocalized, we localize at the default location and we print on the map
// "defaultPrintFlag" => 2,// do not perform a geoloc and locate on the default location of the feed
// "defaultPrintFlag" => 3, if not geolocalized, we don't take the info -> stored in status 13
require_once "../LIB/conf.php";
$conf = new conf();
$m = new Mongo();
$db = $conf->mdb();
$infoColl = $db->info;
$placeColl = $db->place;
$yakcatColl = $db->yakcat;
$yakNEColl = $db->yakNE;
$tagColl = $db->tag;
$batchlogColl = $db->batchlog;
$statColl = $db->stat;
$feedColl = $db->feed;
$logCallToGMap = 0;
$logInfoInserted = 0;
$logPlaceInserted = 0;
$logInfoAlreadyInDB = 0;
$logPlaceAlreadyInDB = 0;
$logPrint = 0;
$logStatus10 = 0;
示例#3
0
 * */
ini_set('display_errors', 1);
$zone = empty($_GET['zone']) ? 0 : (int) $_GET['zone'];
if ($zone == 0) {
    echo "Zone is not set, please use ?zone=1 for Paris<br><b>BATCH FAILED</b><br>";
    exit;
}
$yakcat = empty($_GET['yakcat']) ? 0 : $_GET['yakcat'];
if (!($yakcat == "VILLE" || $yakcat == "YAKDICO")) {
    echo "yakcat is not set, please use ?yakcat=VILLE or ?yakcat=YAKDICO<br><b>BATCH FAILED</b><br>";
    exit;
}
$templateFile = './input/ontologyTemplate.xml';
require_once "../LIB/conf.php";
$conf = new conf();
$placeColl = $conf->mdb()->place;
$yakcatId = null;
if ($yakcat == "VILLE") {
    $yakcatId = new MongoId("507e5a9a1d22b30c44000068");
    $pkg = array('villetitle', 'villetext');
} elseif ($yakcat == "YAKDICO") {
    $yakcatId = new MongoId("5056b7aafa9a95180b000000");
    $pkg = array('yakdicotitle', 'yakdicotext');
}
$query = array("yakCat" => $yakcatId, "status" => 1, "zone" => (int) $zone);
// ID YAKCAT = YAKDICO
$places = $placeColl->find($query);
foreach ($pkg as $p) {
    $outputFile = './output/ontology/' . $p . '_zone' . $zone . '.xml';
    $row = 0;
    $ontolgyXML = '<Ontology xmlns="exa:com.exalead.mot.components.ontology">