Last change
on this file since 16 was
16,
checked in by basvannuland, 14 years ago
|
little work on the ontology
|
File size:
1.0 KB
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | class SurveyRDFReader
|
---|
4 | {
|
---|
5 | var $model;
|
---|
6 |
|
---|
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 = '
|
---|
22 | PREFIX predicates: <' .SURVEYTOOL_PREDICATES_NAMESPACE . '>
|
---|
23 | PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
|
---|
24 | SELECT ?title
|
---|
25 | WHERE { resources:survey predicates:title ?title }';
|
---|
26 |
|
---|
27 | $result = $this->model->sparqlQuery($querystring);
|
---|
28 |
|
---|
29 | return $result;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public function readSurveyDescription()
|
---|
33 | {
|
---|
34 | $querystring = '
|
---|
35 | PREFIX predicates: <' .SURVEYTOOL_PREDICATES_NAMESPACE . '>
|
---|
36 | PREFIX resources: <' . SURVEYTOOL_RESOURCES_NAMESPACE . '>
|
---|
37 | SELECT ?description
|
---|
38 | WHERE { resources:survey predicates:description ?description }';
|
---|
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.