本文整理汇总了PHP中Node::getUri方法的典型用法代码示例。如果您正苦于以下问题:PHP Node::getUri方法的具体用法?PHP Node::getUri怎么用?PHP Node::getUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Node
的用法示例。
在下文中一共展示了Node::getUri方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getBindingString
/**
* Helper Function for function buildXmlResult($vartable). Generates
* an xml string for a single variable an their corresponding value.
*
* @param String $varname The variables name
* @param Node $varvalue The value of the variable
* @return String The xml string
*/
protected function _getBindingString($varname, $varvalue)
{
$binding = '<binding name="' . $varname . '">';
$value = '<unbound/>';
if ($varvalue instanceof BlankNode) {
$value = '<bnode>' . $varvalue->getLabel() . '</bnode>';
} else {
if ($varvalue instanceof Resource) {
$value = '<uri>' . $varvalue->getUri() . '</uri>';
} else {
if ($varvalue instanceof Literal) {
$label = htmlspecialchars($varvalue->getLabel());
$value = '<literal>' . $label . '</literal>';
if ($varvalue->getDatatype() != null) {
$value = '<literal datatype="' . $varvalue->getDatatype() . '">' . $label . '</literal>';
}
if ($varvalue->getLanguage() != null) {
$value = '<literal xml:lang="' . $varvalue->getLanguage() . '">' . $label . '</literal>';
}
}
}
}
$binding = $binding . $value . '</binding>';
return $binding;
}
示例2: equals
/**
* @see \Saft\Rdf\Node
*/
public function equals(Node $toCompare)
{
// It only compares URIs, everything will be quit with false.
if ($toCompare->isNamed()) {
return $this->getUri() == $toCompare->getUri();
}
return false;
}
示例3: index
/**
* create new node index
*
* @throws \Neo4j\Exception\HttpException
*
* @param \Neo4j\Node $node
* @param string $key
* @param string $value
*
* @return void
*/
public function index(Node $node, $key, $value)
{
$this->_uri = $this->_db->getBaseUri() . 'index/node/' . $key . '/' . $value;
$this->_data = $node->getUri();
list($response, $http_code) = Request::post($this->_uri, $this->_data);
if ($http_code != 201) {
throw new \Neo4j\Exception\HttpException($http_code);
}
}
示例4: __construct
/**
* @param string $value The Literal value
* @param Node $datatype The datatype of the Literal (respectively defaults to xsd:string or rdf:langString)
* @param string $lang The language tag of the Literal (optional)
*/
public function __construct($value, Node $datatype = null, $lang = null)
{
if ($value === null) {
throw new \Exception('Literal value can\'t be null. Please use AnyPattern if you need a variable.');
} elseif (!is_string($value)) {
throw new \Exception("The literal value has to be of type string");
}
$this->value = $value;
if ($lang !== null) {
$this->lang = (string) $lang;
}
if ($lang !== null && $datatype !== null && $datatype->isNamed() && $datatype->getUri() !== self::$rdfLangString) {
throw new \Exception('Language tagged Literals must have <' . self::$rdfLangString . '> datatype.');
}
if ($datatype !== null) {
$this->datatype = $datatype;
} elseif ($lang !== null) {
$this->datatype = new NamedNodeImpl(self::$rdfLangString);
} else {
$this->datatype = new NamedNodeImpl(self::$xsdString);
}
}