Here is a PHP API for RDF I found in my travels:
A picture being worth a load of postings, this demo will allow one to input a blob of RDF and to try various queries on it. Very handy for experimenting with models.
There are some useful tutorials here:
The code is displayed and it's rather easy to see how everything fits together.
There is another tutorial on RDQL here:
I haven't gotten as far as to look for Perl APIs, since I largely use PHP as an interface into the UV DB (strictly as a matter of convenience). Those would be well worth a post as well, as well as anyone's experiences with them.