You can buy this project and download/modify it how often you want.
@prefix sql: template { ?e } where { ?in rdf:rest*/rdf:first ?e }