/** * tests createProperty() and createResource */ function testCreateProptertyCreateResourceTest() { $_SESSION['test'] = 'ResModel createProperty createResource test'; $model1 = new MemModel(); $needle = new Statement(new Resource('http://www.example.org/needle'), new Resource('http://www.example.org/pred3'), new Resource('http://www.example.org/ob')); $model1->add($needle); $resmodel = new ResModel($model1); $resresource = $resmodel->createResource('http://www.example.org/testresource'); $prop = $resmodel->createProperty('http://www.example.org/pred'); $resresource->addProperty($prop, new ResLiteral('Object')); $subject = new ResResource('http://www.example.org/testresource'); $property = new ResResource('http://www.example.org/pred'); $res = $resmodel->getProperty($subject, $property); $this->assertEqual('Triple(Resource("http://www.example.org/testresource"), Resource("http://www.example.org/pred"), Literal("Object"))', $res->toString()); $model1->close(); }
/** * Answer some statement (this, p, O) in the associated model. * If there are several such statements, any one of them may be returned. * If no such statements exist, null is returned. * * @param ResResource $property * @return object ResResource * @access public */ function getProperty($property) { return $this->model->getProperty($this, $property); }