Fixed many bugs to publishing/unpublishing and improved the RDF output