--- a/app/DoctrineMigrations/Version20140129151724.php Fri Jul 04 16:57:59 2014 +0200
+++ b/app/DoctrineMigrations/Version20140129151724.php Fri Jul 04 16:58:31 2014 +0200
@@ -42,29 +42,29 @@
$evm->removeEventListener(array('onFlush', 'preRemove', 'postPersist', 'postUpdate', 'postRemove'), $listenerInst);
// First step : we populate the dbpedia uris thanks to the dbpedia-owl:wikiPageID
-// echo "\nFIRST STEP";
-// $query = $em->createQuery('SELECT t FROM WikiTagBundle:Tag t WHERE t.wikipediaPageId IS NOT NULL ORDER BY t.label ASC');//->setMaxResults(240)->setFirstResult(500);
-// $tags = $query->getResult();
-// $i = 1;
-// $nb_set = 0;
-// echo "\n".count($tags)." tags to search.";
-// foreach($tags as $tag){
-// $l = $tag->getLabel();
-// $uri = WikiTagUtils::getDbpediaUri($tag->getWikipediaPageId(), array(), false, "pageid");
-// $tag->setDbpediaUri($uri);
-// $em->persist($tag);
-// if($uri!=NULL && $uri!=""){
-// $nb_set++;
-// }
-// if( $i % 50 == 0 ){
-// $em->flush();
-// echo "\n FLUSH";
-// }
-// $i++;
-// echo "\n$i : $l \t\t: $uri";
-// }
-// $em->flush();
-// echo "\nFIRST STEP : $nb_set uris found";
+ echo "\nFIRST STEP";
+ $query = $em->createQuery('SELECT t FROM WikiTagBundle:Tag t WHERE t.wikipediaPageId IS NOT NULL ORDER BY t.label ASC');//->setMaxResults(240)->setFirstResult(500);
+ $tags = $query->getResult();
+ $i = 1;
+ $nb_set = 0;
+ echo "\n".count($tags)." tags to search.";
+ foreach($tags as $tag){
+ $l = $tag->getLabel();
+ $uri = WikiTagUtils::getDbpediaUri($tag->getWikipediaPageId(), array(), false, "pageid");
+ $tag->setDbpediaUri($uri);
+ $em->persist($tag);
+ if($uri!=NULL && $uri!=""){
+ $nb_set++;
+ }
+ if( $i % 50 == 0 ){
+ $em->flush();
+ echo "\n FLUSH";
+ }
+ $i++;
+ echo "\n$i : $l \t\t: $uri";
+ }
+ $em->flush();
+ echo "\nFIRST STEP : $nb_set uris found";
// Second step : we populate the dbpedia uris not found thanks to the foaf:isPrimaryTopicOf