Compiling Graph Substructures into Sentential Decision Diagrams