Skip to content
m0mo edited this page Dec 13, 2011 · 1 revision

Further, it is possible to search statements in the model. The search function contains three parameters, namely, subject, predicate and object, and returns an array containing all results. If a parameters is defined as NULL, it can be seen as a placeholder and is true for all statements in the model. Since we want to enable users to further use the resource-centric approach we added two search functions. The function $result = $model->search($subject, $predicate, $object) merely returns a list of statements, while the function $result = $model->searchResources($subject, $predicate, $object) returns a list of resources with properties. Usage of the search functions is presented in code snippet 5.4.

<?php
	require_once 'path/to/API.php';
       
        // create or load model
        // create the $subject, $predicate, $object

        // returns list of statements
        $result = $model->search($subject, $predicate, $object);
        
        // returns list of resources + properties
        $result = $model->searchResources($subject, $predicate, $object);
?>
Clone this wiki locally