You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
1.4 KiB

<?php
namespace App\Wrappers;
use App\Configuration;
use Darksparrow\DeegraphInteractions\Core\DeegraphServer;
use Darksparrow\DeegraphInteractions\DataStructures\NewNodeDetails;
use Darksparrow\DeegraphInteractions\DataStructures\UUID;
use Darksparrow\DeegraphInteractions\QueryBuilder\QueryBuilder;
class DeegraphInteractions
{
public static function GetConnection(): DeegraphServer
{
return new DeegraphServer(
token : Configuration::GetConfig("Deegraph", "Token"),
server : Configuration::GetConfig("Deegraph", "Host"),
port : Configuration::GetConfig("Deegraph", "Port"),
allowSelfSignedCerts: Configuration::GetConfig("Deegraph", "AllowSelfSignedCerts"),
);
}
public static function NewNode(
string $dataURL = null,
string $schema = null,
): NewNodeDetails
{
return self::GetConnection()->CreateNewNode(
actorID: new UUID(Configuration::GetConfig("Deegraph", "LoginNode")),
dataURL: $dataURL,
schema : $schema,
creator: new UUID(Configuration::GetConfig("Deegraph", "LoginNode")),
);
}
public static function AddProperty()
{
$query = QueryBuilder::Link()
->linkOfRelativePath($node->NodeID, $this->NodeID)
->as($key);
if($force) $query = $query->Force();
$query = $query->Build();
}
}