Know your serialization tool. There are several flavors and recent RDF changes introduce at least one more.
Use keys and conditional logic in your templates to identify and correctly process nodes that are inline and nodes that are referenced.
In the general case, you need a choose statement for each node, one to test for @rdf:resource and one to test for @rdf:about.
Difficult and tedious.