<?php
require_once ("header.php");
setGlobals();
$q = "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX crm:<http://www.cidoc-crm.org/rdfs/cidoc_crm_v5.0.2_english_label.rdfs#>
PREFIX rro:<https://rdf.ng-london.org.uk/raphael/ontology/>
PREFIX rri:<https://rdf.ng-london.org.uk/raphael/resource/>
SELECT
?Painting ?Label ?Location ?Medium ?Support
?Height ?Width ?Collection ?Title ?sTitle
?Artist ?Date ?Thumbnail ?Curator
WHERE {
?Painting rdf:type rro:RC12.Painting;
rro:RP10.has_current_location ?Location;
rro:RP72.was_produced ?Production;
rdfs:label ?Label;
rro:RP99.is_part_of ?Collection;
rro:RP231I.has_the_display_image ?dim .
Optional { ?Painting rro:RP9.has_curator ?Curator . }.
Optional { ?Painting rro:RP20.has_medium ?Medium . }.
Optional { ?Painting rro:RP32.has_support ?Support . }.
Optional { ?Painting rro:RP36.has_width_in_cm ?Width . }.
Optional { ?Painting rro:RP16.has_height_in_cm ?Height . }.
Optional { ?Painting rro:RP34.has_title ?Title . }.
Optional { ?Painting rro:RP31.has_short_title ?sTitle . }.
?dim rro:RP259.has_thumbnail ?Thumbnail .
?Production rro:RP43.was_carried_out_by ?Artist;
Optional { ?Production rro:RP209.has_time-span ?Date . }.
FILTER ( ?Painting = rri:NG27 ) . }";
$r = selectQuery ($q, true);
$r = $r[0];
$tb = imgUrl ($r["Thumbnail"]);
$arr = selectQuery ($q, true);
$r = $arr[0];
$p = $r["Painting"];
$tb = imgUrl ($r["Thumbnail"]["value"]);
$r["Label"] = $r["Label"]["value"];
echo htmlHeader ();
echo <<<END
<table id="qtable" class="qresults"><tr>
<td width="150px">
<img src="$tb" width="150px" alt="Thumbnail for $r[Label]" title="Thumbnail for $r[Label]"/>
</td>
<td><ul>
END;
$ar = getArtist ($r["Artist"]["value"]);
echoLabel ("Artist", $r["Artist"]["value"]);
echo "<li><font class=\"red\">Artist dates:</font> ".
$ar["birth"]["value"]." - ". $ar["death"]["value"]."</li>";
echo "<li><font class=\"red\">Full title:</font>".$r["Title"]["value"]."</li>";
echoLabel ("Date made", $r["Date"]["value"]);
$ms = "";
$tr = getInfo ($r["Medium"]["value"], "rdfs:label");
$ms .= $tr . " on ";
$tr = getInfo ($r["Support"]["value"], "rdfs:label");
$ms .= $tr;
echo "<li><font class=\"red\">Medium and support:</font> $ms</li>".
"<li><font class=\"red\">Dimensions:</font> ".
$r["Height"]["value"]." x ".$r["Width"]["value"]." cm</li>".
"<li><font class=\"red\">Inventory number:</font> $r[Label]</li>";
echoLabel ("Location in Gallery", $r["Location"]["value"]);
echo "<li><font class=\"red\">URI:</font> <a href=\"".
"$r[Painting]\">$r[Label]</a></li>".
"<li><font class=\"red\">NG Website:</font> <a href=\"".
"http://www.nationalgallery.org.uk/goto/painting.ashx?ID=".
"$r[Label]\">$r[Label]</a></li>".
"</ul></td></tr></table></td></tr></table>";
?> |