Exercise 4: WebId 2.0 in PHP

Document created by Milanez on May 30, 2020
Version 1Show Document
  • View in full screen mode
<?php

$WebIdFull = "F1AbE6pYH8lK3Jk2dIj1acJ13rQQexAQCag6hGBbQBQVqMfqQ7ov8FlfosFwIRaAy2h-zmQU0VSVkVSXE5VR1JFRU5cTlVHUkVFTlxXSUNISVRBXENSQUNLSU5HIFBST0NFU1NcRVFVSVBNRU5UXFAtNzIzfElOU1RBTExBVElPTiBEQVRF";
$Path = "SERVER\\NuGreen\\NuGreen\\Wichita\\Cracking Process\\Equipment\\P-723|Installation Date";
echo "WebId: $WebIdFull<br>Path: $Path<hr>";

$type = "P"; // Specify the information in WebID as Path-only
$version = "1"; // for WebID v2.0, this is always 1
$marker = "Ab"; // Specify Object type as PIPoint
$extraMarker = "E"; // Identifies the parent AFObject type of the Attribute as an Element
$encodedPath = base64_encode(strtoupper($Path));

$WebIdPathOnly = $type.$version.$marker.$extraMarker.$encodedPath;
echo "WebId path only: $WebIdPathOnly<br>Encoded path: $encodedPath<hr>";

?>

Attachments

    Outcomes