From: Danilo S. B. <ds...@ho...> - 2006-10-01 07:14:32
|
I don´t get store MemModel in my DB No error messages are show. I don´t know what to do even more. Someone could send a complete example of creating a MEMMODELl (without files) and storing in a data base ?. By statemant i get. It´s kind urgent. Thank you very much ! My tests <? define("RDFAPI_INCLUDE_DIR", "C:/Arquivos de programas/Apache Group/Apache/htdocs/rap/api/"); include(RDFAPI_INCLUDE_DIR . "RdfAPI.php"); include("func1.php"); $bd = conecta(); $resultado = mysql_query("select * from artigo where(id='1');",$bd); $titulo = mysql_result($resultado,0,2); $id_artigo = mysql_result($resultado,0,0); $model = ModelFactory::getResModel(MEMMODEL); define('DSB', 'http://www.dc.uel.br/~dsbizarro/'); $URI = "http://www.dc.uel.br/~dsbizarro/artigo#"; $fullName = "John Smith"; $modelURI = "http://www.dsb.com"; $modelURI2 = "http://www.dsb2.com"; $full = $model->createLiteral($fullname); $artigo = $model->createResource($URI); $compra = $model->createProperty(DSB.'compra'); $vende = $model->createProperty(DSB.'vende'); $artigo->addProperty($compra , $full); $artigo2 = $model->createResource($URI); $literal1 = $model->createLiteral("COMPROU"); $literal2 = $model->createLiteral("VENDEU"); $artigo2->addProperty($compra, $literal1); $artigo2->addProperty($vende, $literal2); // List the nicknames echo '<b>Known nicknames for '.$full->getLabel().':</b><BR>'; foreach ($artigo2->listProperties($vende) as $currentResource) { echo $currentResource->getLabelObject().'<BR>'; }; $bag_smiths = $model->createBag(); $beckySmith = $model->createResource('http://somewhere/BeckySmith'); $beckySmithFN = $model->createLiteral('Becky Smith'); $beckySmith->addProperty($compra,$beckySmithFN ); // Add persons to bag $bag_smiths->add($beckySmith); $bag_smiths->add($artigo); $DBmodel = ModelFactory::getDbStore(); $DB = $DBmodel->getModel($modelURI); //$DB->add($statement); //$model->addModel($DB); //$DBmodel->putModel($model,$modelURI) ; $DBmodel->putModel($model,$modelURI) ; $DBmodel->close(); ?> _________________________________________________________________ Inscreva-se no novo Windows Live Mail beta e seja um dos primeiros a testar as novidades-grátis. Saiba mais: http://www.ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d |