Пример #1
0
Soprano::Node NG::CopyVisitor::vertexProxy(const Soprano::Node & node) 
{
    if(node.isBlank())
	return node;

    if(node.isLiteral())
	return node;

    Soprano::Node answer;
    QHash< QUrl, QUrl >::const_iterator it =
	d->proxyUrls->find(node.uri());
    if(it == d->proxyUrls->end()) {
	// Create new

	// Create new url
	// FIXME What label should be passed to the generateUniqueUri
	answer = Soprano::Node(
		     d->targetManager->generateUniqueUri("unknown")
		 );
	Q_ASSERT(!answer.uri().isEmpty());

	// Add to table
	//kDebug() << "Adding proxy to " << node.uri() << " : " << answer.uri();
	d->proxyUrls->insert(node.uri(), answer.uri());
    } else {
	answer  = Soprano::Node(it.value());
    }

    return answer;
}
Пример #2
0
QString NG::DotVisitor::vertexDescription(const Soprano::Node & node)
{
    if(node.isBlank()) {
        static QString blank("blank");
        return blank;
    } else if(node.isLiteral())
        return node.toString().replace('\"', "'");
    else { // Node is resource
        return node.uri().toString();
    }
}