improve class-searching using the Graph API triples() call
this helps with the issue of apparently random namespace choices when two or more types are applied to a single rdfa object
since prior to this, the code was always picking the "first" one it saw, rather than the unambiguously correct one

fix a syntax error