Rev | Line | |
---|
[12] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | class SurveyRDFReader
|
---|
| 4 | {
|
---|
| 5 | var $model;
|
---|
[14] | 6 |
|
---|
[12] | 7 | public function SurveyRDFReader()
|
---|
| 8 | {
|
---|
| 9 | // Create empty MemModel
|
---|
| 10 | $factory = new ModelFactory();
|
---|
| 11 | $this->model = $factory->getDefaultModel();
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | public function loadSurvey($sTitle)
|
---|
| 15 | {
|
---|
| 16 | $this->model->load('surveys/'.$sTitle.'.rdf');
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | public function readSurveyTitle()
|
---|
| 20 | {
|
---|
| 21 | $querystring = '
|
---|
[14] | 22 | PREFIX predicate: <' .SURVEYTOOL_PREDICATES_NAMESPACE . '>
|
---|
| 23 | PREFIX namespace: <' . SURVEYTOOL_NAMESPACE . '>
|
---|
| 24 | SELECT ?surveyTitle
|
---|
| 25 | WHERE { namespace:Survey predicate:title ?surveyTitle }';
|
---|
[12] | 26 |
|
---|
| 27 | $result = $this->model->sparqlQuery($querystring);
|
---|
| 28 |
|
---|
| 29 | return $result;
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | public function readSurveyDescription()
|
---|
| 33 | {
|
---|
| 34 | $querystring = '
|
---|
[14] | 35 | PREFIX predicate: <' . SURVEYTOOL_PREDICATES_NAMESPACE . '>
|
---|
| 36 | PREFIX namespace: <' . SURVEYTOOL_NAMESPACE . '>
|
---|
| 37 | SELECT ?surveyDescription
|
---|
| 38 | WHERE { namespace:Survey predicate:description ?surveyDescription }';
|
---|
[12] | 39 |
|
---|
| 40 | $result = $this->model->sparqlQuery($querystring);
|
---|
| 41 |
|
---|
| 42 | return $result;
|
---|
| 43 | }
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | ?>
|
---|
Note: See
TracBrowser
for help on using the repository browser.