{"id":347,"date":"2010-07-29T17:00:10","date_gmt":"2010-07-29T17:00:10","guid":{"rendered":"http:\/\/blog.soton.ac.uk\/webteam\/?p=347"},"modified":"2010-07-29T17:08:45","modified_gmt":"2010-07-29T17:08:45","slug":"graphite-1-4","status":"publish","type":"post","link":"https:\/\/blog.soton.ac.uk\/webteam\/2010\/07\/29\/graphite-1-4\/","title":{"rendered":"Graphite 1.4"},"content":{"rendered":"<p>I&#8217;ve just released <a href=\"http:\/\/graphite.ecs.soton.ac.uk\/\">Graphite 1.4<\/a><\/p>\n<p>Graphite is a PHP library to allow quick scripting with RDF, designed to work on one, or a small number of linked RDF documents and produce a page.<\/p>\n<p>Most of the 1.4 features were added to facilitate Les Carr who was trying to use it to solve a problem. It now has a bunch more methods you can call on a list of resources; append,union,except,intersection and sort.<\/p>\n<p>This means you can now do:<\/p>\n<p><tt><br \/>\ninclude_once(\"arc\/ARC2.php\");<br \/>\ninclude_once(\"Graphite.php\");<\/tt><\/p>\n<p><tt><br \/>\n$graph = new Graphite();<br \/>\n$graph-&gt;ns( \"ecs\",\"http:\/\/rdf.ecs.soton.ac.uk\/ontology\/ecs#\" );<\/tt><\/p>\n<p><tt>$base_interest_uri = \"http:\/\/id.ecs.soton.ac.uk\/interest\/\";<br \/>\n$graph-&gt;load( $base_interest_uri.\"rdf\" );<br \/>\n$graph-&gt;load( $base_interest_uri.\"web_science\" );<\/tt><\/p>\n<p><tt>$rdf_people = $people = $graph-&gt;resource( $base_interest_uri.\"rdf\" )-&gt;all( \"-ecs:hasInterest\" );<\/tt><\/p>\n<p><tt>$wsc_people = $people = $graph-&gt;resource( $base_interest_uri.\"web_science\" )-&gt;all( \"-ecs:hasInterest\" );<\/tt><\/p>\n<p><tt>print \"<\/tt><tt>&lt;div&gt;Either RDF or Web Science: \".$rdf_people-&gt;union( $wsc_people )-&gt;sort( \"foaf:name\")-&gt;label()-&gt;join( \", \" ).\"&lt;\/div&gt;\";<\/tt><\/p>\n<p><tt>print \"<\/tt><tt>&lt;div&gt;Both RDF and Web Science: \".$rdf_people-&gt;intersection( $wsc_people )-&gt;sort( \"foaf:name\")-&gt;label()-&gt;join( \", \" ).\".&lt;\/div&gt;;<br \/>\n<\/tt><\/p>\n<p>Which I think is beginning to get quite powerful, and remains reasonably easy to read.<\/p>\n<p>It also can now cache the RDF locally so you can save repeated HTTP requests when doing your linked-data thing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve just released Graphite 1.4 Graphite is a PHP library to allow quick scripting with RDF, designed to work on one, or a small number of linked RDF documents and produce a page. Most of the 1.4 features were added to facilitate Les Carr who was trying to use it to solve a problem. It [&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":[281,138,1],"tags":[],"class_list":["post-347","post","type-post","status-publish","format-standard","hentry","category-graphite","category-php","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/posts\/347","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=347"}],"version-history":[{"count":3,"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/posts\/347\/revisions"}],"predecessor-version":[{"id":349,"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/posts\/347\/revisions\/349"}],"wp:attachment":[{"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/media?parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/categories?post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/webteam\/wp-json\/wp\/v2\/tags?post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}