From: Nick D. <ni...@is...> - 2005-11-16 00:30:35
|
Hi, I've been playing with RAP recently, and would like to congratulate you on your efforts. I've finally spent a couple of hours getting my toy code to use the DB backend, and this seems to be working nicely so far. One thing I did struggle with was the code to get an OntModel from the DB. Could you tell me whether the below is appropriate: $dbURI = "http://www.etc..."; $mysql_database = ModelFactory::getDbStore('MySQL', 'localhost', etc...'); $memModel = $mysql_database->getModel($dbURI); $ontModel = $memModel->getOntModel(RDFS_VOCABULARY); This worked to a certain extent, but I was getting an error when trying to listClasses on the ontModel: PHP Fatal error: Call to a member function TYPE() on a non-object in /Users/drummond/Sites/rdfapi-php/api/ontModel/OntModel.php on line 127 So I had a look and fixed the method below, which now works fine - the getResModel() probably needs the same fix. function & getOntModel($vocabulary) { require_once( RDFAPI_INCLUDE_DIR . PACKAGE_ONTMODEL); require_once(RDFAPI_INCLUDE_DIR.'ontModel/'.$vocabulary); $vocab = new RdfsVocabulary(); return new OntModel(& $this, $vocab); } Also, I keep vaguely aware of development of other APIs and understand pOWL builds on top of RAP. Does this mean that OWL support is likely to stay out of RAP itself? Thanks for your time. Nick |