Esempio n. 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
     $randomn = rand(0, 2048);
     self::$prefLabel = 'testPrefLable_' . $randomn;
     self::$altLabel = 'testAltLable_' . $randomn;
     self::$hiddenLabel = 'testHiddenLable_' . $randomn;
     self::$notation = 'test-xxx-' . $randomn;
     self::$uuid = uniqid();
     self::$about = BASE_URI_ . "/" . OPENSKOS_SET_code . "/" . self::$notation;
     $xml = '<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::$about . '">' . '<rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/>' . '<skos:prefLabel xml:lang="nl">' . self::$prefLabel . '</skos:prefLabel>' . '<skos:altLabel xml:lang="nl">' . self::$altLabel . '</skos:altLabel>' . '<skos:hiddenLabel xml:lang="nl">' . self::$hiddenLabel . '</skos:hiddenLabel>' . '<openskos:set>' . OPENSKOS_SET_code . '</openskos:set>' . '<openskos:tenant>' . TENANT . '</openskos:tenant>' . '<openskos:uuid>' . self::$uuid . '</openskos:uuid>' . '<skos:notation>' . self::$notation . '</skos:notation>' . '<skos:topConceptOf rdf:resource="' . SCHEMA_URI_1 . '"/>' . '<skos:inScheme  rdf:resource="' . SCHEMA_URI_1 . '"/>' . '<skos:definition xml:lang="nl">testje (voor def ingevoegd)</skos:definition>' . '</rdf:Description>' . '</rdf:RDF>';
     self::$response0 = RequestResponse::CreateConceptRequest(self::$client, $xml, "false");
     print "\n Creation status: " . self::$response0->getStatus();
     //var_dump(self::$response0->getBody());
 }
Esempio n. 2
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();
 }