function testQueryGetFullUri() { $q = new Query(); $q->addPrefix('rdfs', 'http://www.w3.org/2000/01/rdf-schema#'); $q->addPrefix('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); $q->addPrefix('xsd', 'http://www.w3.org/2001/XMLSchema#'); $this->assertEqual('http://www.w3.org/2001/XMLSchema#integer', $q->getFullUri('xsd:integer')); $this->assertFalse($q->getFullUri('yyy:integer')); $this->assertFalse($q->getFullUri('integer')); }
/** * Checks if there is a datatype given and appends it to the node. * * @param string $node Node to check * * @return void */ protected function checkDtypeLang(&$node, $nSubstrLength = 1) { $this->_fastForward(); switch (substr(current($this->tokens), 0, 1)) { case '^': if (substr(current($this->tokens), 0, 2) == '^^') { $node = new Literal(substr($node, 1, -1)); $node->setDatatype($this->query->getFullUri(substr(current($this->tokens), 2))); } break; case '@': $node = new Literal(substr($node, $nSubstrLength, -$nSubstrLength), substr(current($this->tokens), $nSubstrLength)); break; default: prev($this->tokens); $node = new Literal(substr($node, $nSubstrLength, -$nSubstrLength)); break; } }