Ignore:
Timestamp:
09/01/11 15:59:15 (14 years ago)
Author:
basvannuland
Message:

application bug multiple values fixed
more dashboard rdf work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/classes/DashboardRDFWriter.php

    r91 r100  
    11<?php
    22
    3 class SurveyRDFWriter
     3class DashboardRDFWriter
    44{
    55    protected $model;
     
    2727    }
    2828   
    29     public function createDashboard($dTitle, $dDescription,$dRespondentGroup)
     29    public function createDashboard($dTitle, $dDescription, $dCreatorID)
    3030    {
    3131        $this->resourceDashboard = new Resource(DASHBOARD.'/'.$this->dashboardID);
     
    4646        $dashboardDescription = new Literal($dDescription);
    4747        $this->model->add(new Statement($this->resourceDashboard,$predicateDescription,$dashboardDescription));
     48       
     49        $predicateCreator = new Resource(CREATOR);
     50        $userID = new Literal($dCreatorID);
     51        $this->model->add(new Statement($this->resourceDashboard,$predicateCreator,$userID));
    4852    }
    4953   
    50     public function addGraph($gTitle,$gDescription,$gTypes,$gData)
     54    public function addGraph($gID,$gTitle,$gDescription,$gTypes,$gData)
    5155    {
    5256        $resourceGraph = new Resource(GRAPH);
     
    6064        $this->model->add(new Statement($resourceGraph,$predicateDescription,$graphDescription));
    6165       
     66        $predicateUniqueID = new Resource(UID);
     67        $graphID = new Literal($gID);
     68        $this->model->add(new Statement($resourceQuestion,$predicateUniqueID,$graphID));
     69       
    6270        $predicateGraphType = new Resource(GRAPH_TYPE);
    6371        foreach($gTypes as $gType)
     
    6775        }
    6876       
    69         $predicateData = new Resource(DATA);
     77        $predicateData = new Resource(HAS_DATA);
    7078        foreach($gData as $gThis)
    7179        {
    72             $graphData = new Literal($gThis);
    73             $this->model->add(new Statement($resourceGraph,$predicateData,$graphData));
     80            $resourceData = new Resource(DATA);
     81            $this->model->add(new Statement($resourceGraph,$predicateData,$resourceData));
     82           
     83            $dataType = new Literal($gThis['type']);
     84            $predicateDataType = new Resource(DATA_TYPE);
     85            $this->model->add(new Statement($resourceData,$predicateDataType,$dataType));
     86           
     87            $dataID = new Literal($gThis['id']);
     88            $this->model->add(new Statement($resourceData,$predicateUniqueID,$dataID));           
    7489        }
    7590       
Note: See TracChangeset for help on using the changeset viewer.