diff --git a/CloudObjects/SDK/Common/CryptoHelper.php b/CloudObjects/SDK/Common/CryptoHelper.php index b48efa7..fe231b8 100644 --- a/CloudObjects/SDK/Common/CryptoHelper.php +++ b/CloudObjects/SDK/Common/CryptoHelper.php @@ -59,7 +59,7 @@ class CryptoHelper { $this->objectRetriever = $objectRetriever; $this->namespace = isset($namespaceCoid) - ? $objectRetriever->getObject($namespaceCoid) + ? $objectRetriever->getObjectNode($namespaceCoid) : $objectRetriever->getAuthenticatingNamespaceObject(); $this->reader = new NodeReader([ diff --git a/CloudObjects/SDK/Helpers/SharedSecretAuthentication.php b/CloudObjects/SDK/Helpers/SharedSecretAuthentication.php index 483d714..2665194 100644 --- a/CloudObjects/SDK/Helpers/SharedSecretAuthentication.php +++ b/CloudObjects/SDK/Helpers/SharedSecretAuthentication.php @@ -50,7 +50,7 @@ class SharedSecretAuthentication { return self::RESULT_INVALID_PASSWORD; // Retrieve namespace - $namespace = $retriever->getObject($namespaceCoid); + $namespace = $retriever->getObjectNode($namespaceCoid); if (!isset($namespace)) return self::RESULT_NAMESPACE_NOT_FOUND; @@ -87,7 +87,7 @@ class SharedSecretAuthentication { return self::RESULT_INVALID_PASSWORD; // Retrieve namespace - $namespace = $this->objectRetriever->getObject($namespaceCoid); + $namespace = $this->objectRetriever->getObjectNode($namespaceCoid); if (!isset($namespace)) return self::RESULT_NAMESPACE_NOT_FOUND; diff --git a/CloudObjects/SDK/JSON/SchemaValidator.php b/CloudObjects/SDK/JSON/SchemaValidator.php index 7cfc1c5..eb99fab 100644 --- a/CloudObjects/SDK/JSON/SchemaValidator.php +++ b/CloudObjects/SDK/JSON/SchemaValidator.php @@ -68,7 +68,7 @@ class SchemaValidator { * @param Node $node The COID of the specification. */ public function validateAgainstCOID($data, IRI $coid) { - $object = $this->objectRetriever->getObject($coid); + $object = $this->objectRetriever->getObjectNode($coid); Assert::true($this->reader->hasType($object, 'json:Element'), "You can only validate data against JSON elements!"); $this->validateAgainstNode($data, $object); diff --git a/CloudObjects/SDK/WebAPI/APIClientFactory.php b/CloudObjects/SDK/WebAPI/APIClientFactory.php index 5d16185..4e1b5f0 100644 --- a/CloudObjects/SDK/WebAPI/APIClientFactory.php +++ b/CloudObjects/SDK/WebAPI/APIClientFactory.php @@ -157,7 +157,7 @@ class APIClientFactory { if ($this->reader->hasProperty($api, 'oauth2:hasAuthorizationServer')) { // We have an authorization server for this endpoint/API $authServerCoid = $this->reader->getFirstValueIRI($api, 'oauth2:hasAuthorizationServer'); - $authServerObject = $this->objectRetriever->getObject($authServerCoid); + $authServerObject = $this->objectRetriever->getObjectNode($authServerCoid); if (!isset($authServerObject)) throw new InvalidObjectConfigurationException("Authorization server object <" . (string)$authServerCoid . "> not available."); @@ -220,7 +220,7 @@ class APIClientFactory { public function __construct(ObjectRetriever $objectRetriever, IRI $namespaceCoid = null) { $this->objectRetriever = $objectRetriever; $this->namespace = isset($namespaceCoid) - ? $objectRetriever->getObject($namespaceCoid) + ? $objectRetriever->getObjectNode($namespaceCoid) : $objectRetriever->getAuthenticatingNamespaceObject(); $this->reader = new NodeReader([ @@ -242,7 +242,7 @@ class APIClientFactory { public function getClientWithCOID(IRI $apiCoid, bool $specificClient = false) { $idString = (string)$apiCoid.(string)$specificClient; if (!isset($this->apiClients[$idString])) { - $object = $this->objectRetriever->getObject($apiCoid); + $object = $this->objectRetriever->getObjectNode($apiCoid); if (!isset($object)) throw new CoreAPIException("Could not retrieve API <".(string)$apiCoid.">."); $this->apiClients[$idString] = $this->createClient($object, $specificClient); diff --git a/tests/OfflineTests/NodeReaderMockTest.php b/tests/OfflineTests/NodeReaderMockTest.php index 1a7c63c..722376b 100644 --- a/tests/OfflineTests/NodeReaderMockTest.php +++ b/tests/OfflineTests/NodeReaderMockTest.php @@ -40,7 +40,7 @@ class NodeReaderMockTest extends \PHPUnit\Framework\TestCase { public function testHasType1() { $coid = new IRI('coid://cloudobjects.io'); $this->useRootResourceMock(); - $object = $this->retriever->getObject($coid); + $object = $this->retriever->getObjectNode($coid); $this->assertTrue($this->reader->hasType($object, 'coid://cloudobjects.io/Namespace')); $this->assertTrue($this->reader->hasType($object, 'co:Namespace')); @@ -51,7 +51,7 @@ class NodeReaderMockTest extends \PHPUnit\Framework\TestCase { public function testHasPropertyValue1() { $coid = new IRI('coid://cloudobjects.io'); $this->useRootResourceMock(); - $object = $this->retriever->getObject($coid); + $object = $this->retriever->getObjectNode($coid); $this->assertTrue($this->reader->hasPropertyValue($object, 'http://www.w3.org/2000/01/rdf-schema#label', 'CloudObjects')); $this->assertTrue($this->reader->hasPropertyValue($object, 'rdfs:label', 'CloudObjects')); @@ -60,7 +60,7 @@ class NodeReaderMockTest extends \PHPUnit\Framework\TestCase { public function testGetFirstValueString1() { $coid = new IRI('coid://cloudobjects.io'); $this->useRootResourceMock(); - $object = $this->retriever->getObject($coid); + $object = $this->retriever->getObjectNode($coid); $this->assertEquals('CloudObjects', $this->reader->getFirstValueString($object, 'http://www.w3.org/2000/01/rdf-schema#label')); $this->assertEquals('CloudObjects', $this->reader->getFirstValueString($object, 'rdfs:label')); @@ -75,7 +75,7 @@ class NodeReaderMockTest extends \PHPUnit\Framework\TestCase { public function testGetFirstValueIRI1() { $coid = new IRI('coid://cloudobjects.io'); $this->useRootResourceMock(); - $object = $this->retriever->getObject($coid); + $object = $this->retriever->getObjectNode($coid); $this->assertInstanceOf('ML\IRI\IRI', $this->reader->getFirstValueIRI($object, 'coid://cloudobjects.io/isVisibleTo')); $this->assertInstanceOf('ML\IRI\IRI', $this->reader->getFirstValueIRI($object, 'co:isVisibleTo')); @@ -87,7 +87,7 @@ class NodeReaderMockTest extends \PHPUnit\Framework\TestCase { public function testGetFirstValueNode1() { $coid = new IRI('coid://cloudobjects.io'); $this->useRootResourceMock(); - $object = $this->retriever->getObject($coid); + $object = $this->retriever->getObjectNode($coid); $this->assertInstanceOf('ML\JsonLD\Node', $this->reader->getFirstValueNode($object, 'coid://cloudobjects.io/isVisibleTo')); $this->assertInstanceOf('ML\JsonLD\Node', $this->reader->getFirstValueNode($object, 'co:isVisibleTo')); @@ -99,7 +99,7 @@ class NodeReaderMockTest extends \PHPUnit\Framework\TestCase { public function testGetAllValuesString1() { $coid = new IRI('coid://cloudobjects.io'); $this->useRootResourceMock(); - $object = $this->retriever->getObject($coid); + $object = $this->retriever->getObjectNode($coid); $this->assertCount(1, $this->reader->getAllValuesString($object, 'http://www.w3.org/2000/01/rdf-schema#label')); $this->assertCount(1, $this->reader->getAllValuesString($object, 'rdfs:label')); @@ -116,7 +116,7 @@ class NodeReaderMockTest extends \PHPUnit\Framework\TestCase { public function testGetAllValuesIRI1() { $coid = new IRI('coid://cloudobjects.io'); $this->useRootResourceMock(); - $object = $this->retriever->getObject($coid); + $object = $this->retriever->getObjectNode($coid); $this->assertCount(0, $this->reader->getAllValuesIRI($object, 'http://www.w3.org/2000/01/rdf-schema#label')); $this->assertCount(0, $this->reader->getAllValuesIRI($object, 'rdfs:label')); @@ -136,7 +136,7 @@ class NodeReaderMockTest extends \PHPUnit\Framework\TestCase { public function testGetAllValuesNode1() { $coid = new IRI('coid://cloudobjects.io'); $this->useRootResourceMock(); - $object = $this->retriever->getObject($coid); + $object = $this->retriever->getObjectNode($coid); $this->assertCount(0, $this->reader->getAllValuesNode($object, 'http://www.w3.org/2000/01/rdf-schema#label')); $this->assertCount(0, $this->reader->getAllValuesNode($object, 'rdfs:label')); diff --git a/tests/OnlineTests/ObjectRetrieverPublicTest.php b/tests/OnlineTests/ObjectRetrieverPublicTest.php index 8ec8cc4..401ec36 100644 --- a/tests/OnlineTests/ObjectRetrieverPublicTest.php +++ b/tests/OnlineTests/ObjectRetrieverPublicTest.php @@ -26,7 +26,7 @@ class ObjectRetrieverPublicTest extends \PHPUnit\Framework\TestCase { public function testGetRootObject() { $coid = new IRI('coid://cloudobjects.io'); - $object = $this->retriever->getObject($coid); + $object = $this->retriever->getObjectNode($coid); $this->assertNotNull($object); $this->assertEquals((string)$coid, $object->getID()); $this->assertNotNull($object->getProperty('http://www.w3.org/2000/01/rdf-schema#label'));