hi,
I have just started to use RAP - RDF API and facing some problem in
searlizing OntModel..my codes runs without error but nothing is
serialized...The output file contains only this
=========== contents of output file ==================
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' />
==========================================
here is what I was trying
<?php
//================ my code ====================
$basename = *'http://www.findnwrite.com/courses/'*;
//Create OntModel
$ontModel = ModelFactory::getOntModel(MEMMODEL,RDFS_VOCABULARY, $basename);
// Add Classes and Properties
$clsDepartment = $ontModel->createOntClass($basename . "Department");
$clsCourses = $ontModel->createOntClass($basename . "Courses");
$prpRequires = $ontModel->createOntProperty($basename.*'requires'*);
$prpCredit = $ontModel->createOntProperty($basname.*'credit'*);
$prpStatisfy = $ontModel->createOntProperty($basename.*'statisfy'*);
$prpLabel = $ontModel->createOntProperty(RDFS::LABEL());
$prpSource = $ontModel->createOntProperty(DC::SOURCE());
$prpComment = $ontModel->createOntProperty(RDFS::COMMENT());
//Create a subclass for department
$department = $courses[*'Department'*][*'name'*];
$dept = $courses[*'Department'*][*'sname'*];
//Save the model
$ontModel->saveAs($department . *'.owl'*, "rdf");
*
echo* "{$department}: " . $ontModel->size() . *'statements were added'*;
?>
I will be thankful if someone can tell me where I am making a mistake
Regards
ritesh
--
-------------------------------
http://findnwrite.com
|