Last change
on this file since 40 was
40,
checked in by basvannuland, 14 years ago
|
added database readers and writers for application info and facilitator info
possible to store survey application and creator info
|
File size:
800 bytes
|
Rev | Line | |
---|
[40] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | class UserRDFReader
|
---|
| 4 | {
|
---|
| 5 | protected $model;
|
---|
| 6 |
|
---|
| 7 | public function __construct()
|
---|
| 8 | {
|
---|
| 9 | // Create empty MemModel
|
---|
| 10 | $factory = new ModelFactory();
|
---|
| 11 | $this->model = $factory->getDefaultModel();
|
---|
| 12 |
|
---|
| 13 | $fileName = 'users/users.rdf';
|
---|
| 14 |
|
---|
| 15 | if(file_exists($fileName))
|
---|
| 16 | $this->model->load($fileName);
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | public function readUserInfo($userID)
|
---|
| 20 | {
|
---|
| 21 | $querystring = '
|
---|
| 22 | PREFIX predicates: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
|
---|
| 23 | PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
|
---|
| 24 | SELECT ?name
|
---|
| 25 | WHERE
|
---|
| 26 | {
|
---|
| 27 | _user predicates:resource_type resources:user ;
|
---|
| 28 | predicates:uid "' . $userID . '" ;
|
---|
| 29 | predicates:name ?name
|
---|
| 30 | }';
|
---|
| 31 |
|
---|
| 32 | $result = $this->model->sparqlQuery($querystring);
|
---|
| 33 |
|
---|
| 34 | return $result;
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.