Show Revyu Reviews on Your Site: Part I
One reason for developing Revyu.com was to help unlock reviews from proprietary backend databases, and make them available to the world in a structured, machine-readable form. So far there are at least 2 ways of doing this: by requesting and parsing the RDF/XML version of reviews (that looks like this), or by querying the SPARQL endpoint. The SPARQL endpoint really is the jewel in the crown of reusing data from Revyu.com on other sites, and drewp is the first to do this. Nice one Drew.
On his homepage at bigasterisk.com, he now displays his 10 most recent reviews from Revyu.com, retrieved from the SPARQL endpoint using a chunk of Python code. We’ll have a look at getting the Python code packaged up and released into the wild asap. In the meantime there are other mechanism about to be released that will allow you to show your reviews on your site, without having to do more than copy and paste. I’ll talk more about that in Part II of this series.
For the record, if you’re interested in the query drewp is using it looks something like this:
PREFIX rev:
PREFIX rdfs:
SELECT ?thing ?name ?review ?createdOn
WHERE
{
?thing rdfs:label ?name .
?thing rev:hasReview ?review .
?review rev:reviewer .
?review rev:createdOn ?createdOn
}
ORDER BY DESC(?createdOn)
LIMIT 10
And if you want to get some background on SPARQL, have a look at the resources listed under What is SPARQL? on the Semantic Web FAQ.