{"id":706,"date":"2004-10-01T08:44:54","date_gmt":"2004-10-01T08:44:54","guid":{"rendered":"http:\/\/beta.robertprice.co.uk\/robblog\/2004\/10\/what_is_an_rdf_triple_-shtml\/"},"modified":"2004-10-01T08:44:54","modified_gmt":"2004-10-01T08:44:54","slug":"what_is_an_rdf_triple_-shtml","status":"publish","type":"post","link":"http:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/","title":{"rendered":"What Is An RDF Triple?"},"content":{"rendered":"<p>\nAn <acronym title=\"Resource Description Framework\">RDF<\/acronym> file should parse down to a list of triples.\n<\/p>\n<p>\nA triple consists of a <em>subject<\/em>, a <em>predicate<\/em>, and an <em>object<\/em>. But what do these actually mean?\n<\/p>\n<p>\nThe <em>subject<\/em> is, well, the subject. It identifies what object the triple is describing.\n<\/p>\n<p>\nThe <em>predicate<\/em> defines the piece of data in the object we are giving a value to.\n<\/p>\n<p>\nThe <em>object<\/em> is the actual value.\n<\/p>\n<p>\nLet&#8217;s take a quick look at <a href=\"http:\/\/www.robertprice.co.uk\/foaf.rdf\">my <acronym title=\"Friend of a Friend\">FOAF<\/acronym> file<\/a> to get an example triple.\n<\/p>\n<p>\nI know <a href=\"http:\/\/www.iamcal.com\/\">Cal Henderson<\/a>, and this is represented in my <acronym title=\"Friend of a Friend\">FOAF<\/acronym> file as&#8230;\n<\/p>\n<div class=\"code\"><code>&lt;foaf:knows&gt;<br \/>\n&lt;foaf:Person&gt;<br \/>\n&lt;foaf:nick&gt;Cal&lt;\/foaf:nick&gt;<br \/>\n&lt;foaf:name&gt;Cal Henderson&lt;\/foaf:name&gt;<br \/>\n&lt;foaf:mbox_sha1sum&gt;2971b1c2fd1d4f0e8f99c167cd85d522a614b07b&lt;\/foaf:mbox_sha1sum&gt;<br \/>\n&lt;rdfs:seeAlso rdf:resource=\"http:\/\/www.iamcal.com\/foaf.xml\"\/&gt;<br \/>\n&lt;\/foaf:Person&gt;<br \/>\n&lt;\/foaf:knows&gt;<br \/>\n<\/code><\/div>\n<p>\nUsing the RDF validator we can get a the list of triples represented in this piece of RDF.\n<\/p>\n<table>\n<tr>\n<td>Triple<\/th>\n<th>Subject<\/th>\n<th>Predicate<\/th>\n<th>Object<\/th>\n<tr>\n<!-- START of validator triples --><\/p>\n<tr>\n<td>1<\/td>\n<td>genid:ARP40722<\/td>\n<td><a href='http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type'>http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type<\/a><\/td>\n<td><a href='http:\/\/xmlns.com\/foaf\/0.1\/Person'>http:\/\/xmlns.com\/foaf\/0.1\/Person<\/a><\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>genid:ARP40722<\/td>\n<td><a href='http:\/\/xmlns.com\/foaf\/0.1\/nick'>http:\/\/xmlns.com\/foaf\/0.1\/nick<\/a><\/td>\n<td>\n&quot;Cal&quot;\n<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>genid:ARP40722<\/td>\n<td><a href='http:\/\/xmlns.com\/foaf\/0.1\/name'>http:\/\/xmlns.com\/foaf\/0.1\/name<\/a><\/td>\n<td>\n&quot;Cal Henderson&quot;\n<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>genid:ARP40722<\/td>\n<td><a href='http:\/\/xmlns.com\/foaf\/0.1\/mbox_sha1sum'>http:\/\/xmlns.com\/foaf\/0.1\/mbox_sha1sum<\/a><\/td>\n<td>\n&quot;2971b1c2fd1d4f0e8f99c167cd85d522a614b07b&quot;\n<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>genid:ARP40722<\/td>\n<td><a href='http:\/\/www.w3.org\/2000\/01\/rdf-schema#seeAlso'>http:\/\/www.w3.org\/2000\/01\/rdf-schema#seeAlso<\/a><\/td>\n<td><a href='http:\/\/www.iamcal.com\/foaf.xml'>http:\/\/www.iamcal.com\/foaf.xml<\/a><\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>genid:me<\/td>\n<td><a href='http:\/\/xmlns.com\/foaf\/0.1\/knows'>http:\/\/xmlns.com\/foaf\/0.1\/knows<\/a><\/td>\n<td>genid:ARP40722<\/td>\n<\/tr>\n<p><!-- END of validator triples --><br \/>\n<\/table>\n<\/p>\n<p>\nBut what does this actually mean? Lets go through it line by line.\n<\/p>\n<p>\nTriple 1 &#8211; This has a subject of <var>genid:ARP40722<\/var>. You would have noticed that this didn&#8217;t appear in our original RDF, so where did it come from? It&#8217;s actually a bnode, and the value is generated by the RDF Validator. It&#8217;s purpose is to make sure we can identify the subject where it hasn&#8217;t been specifically named. In this case, we look to triple 6 and see that it has been generated there as the value of that object. The predicate of line 1 is the <var>rdf:type<\/var>, and the object is <var>foaf:Person<\/var>. This all corresponds to the code in <code>&lt;foaf:Person&gt;<\/code> in our FOAF extract.\n<\/p>\n<p>\nTriple 2 &#8211; You&#8217;ll notice this has the same subject as triple 1. This isn&#8217;t a coincidence as the triple is part of the same <var>foaf:Person<\/var>. The predicate says we are defining the <var>foaf:nick<\/var> property, and the object is <var>Cal<\/var>. So we know that this <var>foaf:Person<\/var> has a nickname of Cal. This all corresponds to the line <code>&lt;foaf:nick&gt;Cal&lt;\/foaf:nick&gt;<\/code> in our FOAF extract.\n<\/p>\n<p>\nTriple 3 &#8211; Yet again the subject is the same as triple 1. The predicate is <var>foaf:name<\/var>, and the object is <var>Cal Henderson<\/var>. So we know the name of the person in this <var>foaf:Person<\/var> is Cal Henderson. This represents the line  <code>&lt;foaf:name&gt;Cal Henderson&lt;\/foaf:name&gt;<\/code>\n<\/p>\n<p>\nTriple 4 &#8211; Yet again the subject is the same as triple 1. The predicate is <var>foaf:mbox_sha1sum<\/var> and the object is the SHA1 sum relating to Cal&#8217;s email address. This represents the line <code>&lt;foaf:mbox_sha1sum&gt;2971b1c2fd1d4f0e8f99c167cd85d522a614b07b&lt;\/foaf:mbox_sha1sum&gt;<\/code>\n<\/p>\n<p>\nTriple 5 &#8211; Yet again the subject is the same. The predicate is <var>rdfs:seeAlso<\/var> and the object is <var>http:\/\/www.iamcal.com\/foaf.xml<\/var>. We now know that if we want more information on Cal, we can see his FOAF file at that URL. This represents the line <code>&lt;rdfs:seeAlso rdf:resource=\"http:\/\/www.iamcal.com\/foaf.xml\"\/&gt;<\/code>\n<\/p>\n<p>\nTriple 6 &#8211; Here the subject is <var>genid:me<\/var>. This is because at the start of my FOAF file, in an area not show above I defined the id as <var>me<\/var>. The predicate is <var>foaf:knows<\/var> and the object is <var>genid:ARP40722<\/var>. This is saying that I know the person defined by the subject <var>genid:ARP40722<\/var>. In this case, it&#8217;s Cal, and his details have been shown in the previous 5 triples. This relates to the &lt;foaf:knows&gt; block.\n<\/p>\n<p>\nHopefully this has shown how the RDF has been parsed into triples, and how they relate to each other.\n<\/p>\n<p>\n<a href=\"http:\/\/weblog.burningbird.net\/\">Shelley Powers<\/a>, in her excellent book <a href=\"http:\/\/www.oreilly.com\/catalog\/pracrdf\/\">Practical RDF<\/a>, helpfully describes triples as the following.\n<\/p>\n<p>\n<!-- can we include a cite tag in the ul? --><\/p>\n<ul>\n<li>Each RDF triple is made up of subject, predicate and object.<\/li>\n<li>Each RDF triple is a complete and unique fact.<\/li>\n<li>An RDF triple is a 3-tuple, which is made up of a subject, predicate and object &#8211; which are respectively a uriref or bnode; a uriref; and a uriref, bnode or literal.<\/li>\n<li>Each RDF triple can be joined with other RDF triples, but it still retains its own unique meaning, regardless of the complexity of the models in which it is included.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>An RDF file should parse down to a list of triples. A triple consists of a subject, a predicate, and an object. But what do these actually mean? The subject is, well, the subject. It identifies what object the triple is describing. The predicate defines the piece of data in the object we are giving &hellip; <a href=\"http:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;What Is An RDF Triple?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[2],"tags":[21,56],"class_list":["post-706","post","type-post","status-publish","format-standard","hentry","category-dev","tag-foaf","tag-rdf"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What Is An RDF Triple? - Robert Price<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Is An RDF Triple? - Robert Price\" \/>\n<meta property=\"og:description\" content=\"An RDF file should parse down to a list of triples. A triple consists of a subject, a predicate, and an object. But what do these actually mean? The subject is, well, the subject. It identifies what object the triple is describing. The predicate defines the piece of data in the object we are giving &hellip; Continue reading &quot;What Is An RDF Triple?&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/\" \/>\n<meta property=\"og:site_name\" content=\"Robert Price\" \/>\n<meta property=\"article:published_time\" content=\"2004-10-01T08:44:54+00:00\" \/>\n<meta name=\"author\" content=\"rob\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rob\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/\"},\"author\":{\"name\":\"rob\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5\"},\"headline\":\"What Is An RDF Triple?\",\"datePublished\":\"2004-10-01T08:44:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/\"},\"wordCount\":703,\"keywords\":[\"FOAF\",\"RDF\"],\"articleSection\":[\"Dev\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/\",\"url\":\"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/\",\"name\":\"What Is An RDF Triple? - Robert Price\",\"isPartOf\":{\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#website\"},\"datePublished\":\"2004-10-01T08:44:54+00:00\",\"author\":{\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/www.robertprice.co.uk\/robblog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What Is An RDF Triple?\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#website\",\"url\":\"http:\/\/www.robertprice.co.uk\/robblog\/\",\"name\":\"Robert Price\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.robertprice.co.uk\/robblog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5\",\"name\":\"rob\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g\",\"caption\":\"rob\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What Is An RDF Triple? - Robert Price","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/","og_locale":"en_GB","og_type":"article","og_title":"What Is An RDF Triple? - Robert Price","og_description":"An RDF file should parse down to a list of triples. A triple consists of a subject, a predicate, and an object. But what do these actually mean? The subject is, well, the subject. It identifies what object the triple is describing. The predicate defines the piece of data in the object we are giving &hellip; Continue reading \"What Is An RDF Triple?\"","og_url":"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/","og_site_name":"Robert Price","article_published_time":"2004-10-01T08:44:54+00:00","author":"rob","twitter_card":"summary_large_image","twitter_misc":{"Written by":"rob","Estimated reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/#article","isPartOf":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/"},"author":{"name":"rob","@id":"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5"},"headline":"What Is An RDF Triple?","datePublished":"2004-10-01T08:44:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/"},"wordCount":703,"keywords":["FOAF","RDF"],"articleSection":["Dev"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/","url":"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/","name":"What Is An RDF Triple? - Robert Price","isPartOf":{"@id":"http:\/\/www.robertprice.co.uk\/robblog\/#website"},"datePublished":"2004-10-01T08:44:54+00:00","author":{"@id":"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5"},"breadcrumb":{"@id":"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.robertprice.co.uk\/robblog\/what_is_an_rdf_triple_-shtml\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.robertprice.co.uk\/robblog\/"},{"@type":"ListItem","position":2,"name":"What Is An RDF Triple?"}]},{"@type":"WebSite","@id":"http:\/\/www.robertprice.co.uk\/robblog\/#website","url":"http:\/\/www.robertprice.co.uk\/robblog\/","name":"Robert Price","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.robertprice.co.uk\/robblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/fac6d5b076e0e14e1fb13e15b542a6c5","name":"rob","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"http:\/\/www.robertprice.co.uk\/robblog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6f0eb511179100a4e968abc70403e33686e6ab3e992e392bedd2ccac01da666c?s=96&d=mm&r=g","caption":"rob"}}]}},"_links":{"self":[{"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts\/706","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/comments?post=706"}],"version-history":[{"count":0,"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/posts\/706\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/media?parent=706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/categories?post=706"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.robertprice.co.uk\/robblog\/wp-json\/wp\/v2\/tags?post=706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}