Constructor
To create a new resource use the get method in a graph: $resource = $graph->resource('http://www.example.com/');
public function __construct($uri, $graph = null) {
if (!is_string($uri) or $uri == null or $uri == '') {
throw new InvalidArgumentException("\$uri should be a string and cannot be null or empty");
}
$this->uri = $uri;
# Check that $graph is an EasyRdf_Graph object
if (is_object($graph) and $graph instanceof EasyRdf_Graph) {
$this->graph = $graph;
}
elseif (!is_null($graph)) {
throw new InvalidArgumentException("\$graph should be an EasyRdf_Graph object");
}
}