$describer = new $describer_class(); } else { require_once MORIARTY_DIR . 'store.class.php'; $describer = new Store($store_uri); } $response = $describer->describe($resource_uri, 'cbd', 'json'); $body = ''; $content_location = ''; $etag = ''; if ($response->is_success()) { if (array_key_exists('etag', $response->headers)) { $etag = $response->headers['etag']; } $g = new SimpleGraph(); $g->from_json($response->body); if (!$g->has_triples_about($resource_uri)) { send_not_found($uri, $template); } else { $g->remove_property_values($resource_uri, 'http://schemas.talis.com/2005/dir/schema#etag'); if ($uri != $doc_uri) { header("HTTP/1.1 303 See Other"); header("Location: " . $doc_uri); exit; } else { $g->add_resource_triple($doc_uri, RDF_TYPE, FOAF_DOCUMENT); $g->add_resource_triple($doc_uri, RDF_TYPE, 'http://purl.org/dc/dcmitype/Text'); $g->add_resource_triple($doc_uri, FOAF_PRIMARYTOPIC, $resource_uri); $g->add_literal_triple($doc_uri, 'http://purl.org/dc/terms/title', 'Linked Data for ' . $g->get_label($resource_uri, TRUE)); foreach ($media_types as $extension => $type_info) { $alt_uri = $resource_uri . '.' . $extension; $g->add_resource_triple($doc_uri, 'http://purl.org/dc/terms/hasFormat', $alt_uri);