Example #1
0
 public static function setUpBeforeClass()
 {
     self::$client = new Zend_Http_Client();
     self::$client->SetHeaders(array('Accept' => 'text/html,application/xhtml+xml,application/xml', 'Content-Type' => 'text/xml', 'Accept-Language' => 'nl,en-US,en', 'Accept-Encoding' => 'gzip, deflate', 'Connection' => 'keep-alive'));
     // create a test concept X
     $randomn = rand(0, 2048);
     self::$prefLabelX = 'prefLabelX_' . $randomn;
     self::$notationX = 'test-x-' . $randomn;
     self::$uuidX = uniqid();
     self::$aboutX = BASE_URI_ . CONCEPT_collection . "/" . self::$notationX;
     $xmlX = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:openskos="http://openskos.org/xmlns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmi="http://dublincore.org/documents/dcmi-terms/#">' . '<rdf:Description rdf:about="' . self::$aboutX . '">' . '<rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>' . '<skos:prefLabel xml:lang="nl">' . self::$prefLabelX . '</skos:prefLabel>' . '<openskos:set rdf:resource="' . BASE_URI_ . CONCEPT_collection . '"/>' . '<openskos:uuid>' . self::$uuidX . '</openskos:uuid>' . '<skos:notation>' . self::$notationX . '</skos:notation>' . '<skos:inScheme  rdf:resource="http://data.beeldengeluid.nl/gtaa/Onderwerpen"/>' . '<skos:topConceptOf rdf:resource="http://data.beeldengeluid.nl/gtaa/Onderwerpen"/>' . '<skos:definition xml:lang="nl">testje (voor def ingevoegd)</skos:definition>' . '</rdf:Description>' . '</rdf:RDF>';
     self::$responseX = RequestResponse::CreateConceptRequest(self::$client, $xmlX, "false");
     print "\n Creation status for concept X: " . self::$responseX->getStatus();
     // create a test concept X
     self::$prefLabelY = 'prefLabelY_' . $randomn;
     self::$notationY = 'test-y-' . $randomn;
     self::$uuidY = uniqid();
     self::$aboutY = BASE_URI_ . CONCEPT_collection . "/" . self::$notationY;
     $xmlY = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:openskos="http://openskos.org/xmlns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmi="http://dublincore.org/documents/dcmi-terms/#">' . '<rdf:Description rdf:about="' . self::$aboutY . '">' . '<rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>' . '<skos:prefLabel xml:lang="nl">' . self::$prefLabelY . '</skos:prefLabel>' . '<openskos:set rdf:resource="' . BASE_URI_ . CONCEPT_collection . '"/>' . '<openskos:uuid>' . self::$uuidY . '</openskos:uuid>' . '<skos:notation>' . self::$notationY . '</skos:notation>' . '<skos:inScheme  rdf:resource="http://data.beeldengeluid.nl/gtaa/Onderwerpen"/>' . '<skos:topConceptOf rdf:resource="http://data.beeldengeluid.nl/gtaa/Onderwerpen"/>' . '<skos:definition xml:lang="nl">testje (voor def ingevoegd)</skos:definition>' . '</rdf:Description>' . '</rdf:RDF>';
     self::$responseY = RequestResponse::CreateConceptRequest(self::$client, $xmlY, "false");
     print "\n Creation status for concept X: " . self::$responseY->getStatus();
 }