{"id":408,"date":"2010-09-21T07:06:38","date_gmt":"2010-09-21T07:06:38","guid":{"rendered":"http:\/\/blog.soton.ac.uk\/webteam\/?p=408"},"modified":"2010-09-21T07:55:01","modified_gmt":"2010-09-21T07:55:01","slug":"dont-just-assume-people-will-resolve-uris","status":"publish","type":"post","link":"https:\/\/blog.soton.ac.uk\/webteam\/2010\/09\/21\/dont-just-assume-people-will-resolve-uris\/","title":{"rendered":"Don&#8217;t just assume people will resolve URIs"},"content":{"rendered":"<p>Some RDF documents are very large and not intended for immediate consumption, but rather loading into an endpoint or complex analysis.<\/p>\n<p>However, others are intended for more-or-less stand alone use. Examples would include a <a href=\"http:\/\/rdf.ecs.soton.ac.uk\/person\/1248\">FOAF profile<\/a> or the <a href=\"http:\/\/programme.ecs.soton.ac.uk\/1.0\/examples\/overlaps.rdf\">RDF event programme<\/a> that we&#8217;ve been working on. Having worked with a few of these as a developer, I suggest that it is good practice to include an rdf:type and a suitable label (dc:title, foaf:name, rdfs:label, skos:prefLabel) for them. This makes working with them much much easier.<\/p>\n<p style=\"text-align: left\">For example if you include:<\/p>\n<pre style=\"text-align: left\">example:myphoto foaf:depicts &lt;http:\/\/dbpedia.org\/resource\/Andrew_Eldritch&gt; .<\/pre>\n<p>That&#8217;s all fine and good, but I can&#8217;t actually render that into, say, a caption without at least knowing&#8230;<\/p>\n<pre style=\"text-align: left\">&lt;http:\/\/dbpedia.org\/resource\/Andrew_Eldritch&gt; foaf:name \"Andrew Eldritch\" .<\/pre>\n<p>Resolving secondary URIs from a document is expensive, if done on-the-fly. Any reduction is very helpful, so if I&#8217;m trying to, say, index-by-Person the photos described in your photo collection RDF then knowing&#8230;<\/p>\n<pre style=\"text-align: left\">&lt;http:\/\/dbpedia.org\/resource\/Andrew_Eldritch&gt; rdf:type foaf:Person .<\/pre>\n<p>&#8230;would also help a hacker out.<\/p>\n<p>The new version of the <a href=\"http:\/\/graphite.ecs.soton.ac.uk\/browser\/\">Graphite RDF Browser<\/a> and <a href=\"http:\/\/graphite.ecs.soton.ac.uk\/sparqlbrowser\/\">SPARQL Browser<\/a> both show this information if it&#8217;s available, and it makes things much easier to work with, for example, <a href=\"http:\/\/graphite.ecs.soton.ac.uk\/browser\/?uri=http:\/\/education.data.gov.uk\/id\/school\/118217\">the Data.gov.uk schools data is pretty good for give a label to everything and a type to most things<\/a>.<\/p>\n<p>The SPARQL Browser attempts to get labels, using the following ugly but surprisingly fast query:<\/p>\n<pre style=\"font-size:60%;line-height:80%\">SELECT DISTINCT ?s ?p ?o WHERE {\r\n{ &lt;http:\/\/id.ecs.soton.ac.uk\/person\/1248&gt; ?x ?s . ?s ?p ?o . ?s &lt;http:\/\/www.w3.org\/2000\/01\/rdf-schema#label&gt; ?o .\u00a0 }\u00a0 UNION\r\n{ &lt;http:\/\/id.ecs.soton.ac.uk\/person\/1248&gt; ?x ?s . ?s ?p ?o . ?s &lt;http:\/\/purl.org\/dc\/terms\/title&gt; ?o .\u00a0 }\u00a0 UNION\r\n{ &lt;http:\/\/id.ecs.soton.ac.uk\/person\/1248&gt; ?x ?s . ?s ?p ?o . ?s &lt;http:\/\/purl.org\/dc\/elements\/1.1\/title&gt; ?o .\u00a0 }\u00a0 UNION\r\n{ &lt;http:\/\/id.ecs.soton.ac.uk\/person\/1248&gt; ?x ?s . ?s ?p ?o . ?s &lt;http:\/\/xmlns.com\/foaf\/0.1\/name&gt; ?o .\u00a0 }\u00a0 UNION\r\n{ ?s ?x &lt;http:\/\/id.ecs.soton.ac.uk\/person\/1248&gt; . ?s ?p ?o . ?s &lt;http:\/\/www.w3.org\/2000\/01\/rdf-schema#label&gt; ?o .\u00a0 }\u00a0 UNION\r\n{ ?s ?x &lt;http:\/\/id.ecs.soton.ac.uk\/person\/1248&gt; . ?s ?p ?o . ?s &lt;http:\/\/purl.org\/dc\/terms\/title&gt; ?o .\u00a0 }\u00a0 UNION\r\n{ ?s ?x &lt;http:\/\/id.ecs.soton.ac.uk\/person\/1248&gt; . ?s ?p ?o . ?s &lt;http:\/\/purl.org\/dc\/elements\/1.1\/title&gt; ?o .\u00a0 }\u00a0 UNION\r\n{ ?s ?x &lt;http:\/\/id.ecs.soton.ac.uk\/person\/1248&gt; . ?s ?p ?o . ?s &lt;http:\/\/xmlns.com\/foaf\/0.1\/name&gt; ?o .\u00a0 }\u00a0 UNION\r\n}<\/pre>\n<p>And then a similar one for rdf:type. These are both, of couse, subject to the max-results of the SPARQL endpoint. As in the past I was an SQL programmer, this limit bites me again and again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some RDF documents are very large and not intended for immediate consumption, but rather loading into an endpoint or complex analysis. However, others are intended for more-or-less stand alone use. Examples would include a FOAF profile or the RDF event programme that we&#8217;ve been working on. Having worked with a few of these as a [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[198,281,136,411],"tags":[],"class_list":["post-408","post","type-post","status-publish","format-standard","hentry","category-best-practice","category-graphite","category-rdf","category-sparql"],"_links":{"self":[{"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/posts\/408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/comments?post=408"}],"version-history":[{"count":9,"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/posts\/408\/revisions"}],"predecessor-version":[{"id":410,"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/posts\/408\/revisions\/410"}],"wp:attachment":[{"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/media?parent=408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/categories?post=408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/tags?post=408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}