Recently, many tools have emerged to manage sensor web data using Semantic Web technologies for effective heterogeneous data integration. However, a remaining challenge is how to manage the massive volumes of sensor data in their semantic form, i.e., Resource Description Framework (RDF) triples. Our survey revealed that most semantic tools either do not have geospatial support, or have severe limitations on providing full GeoSPARQL support and good performance for complex queries. In this paper, we present an open source Semantic Spatiotemporal Data Engine (SSTDE), which incorporates both semantic tools and Geographic Information System (GIS) systems under a hybrid architecture. Our main contribution includes 1) introducing the sub-graph index to substitute the single node index, which results in significant performance gain for a spatiotemporal query; 2) developing a query optimization algorithm based on graph matching; 3) proposing a benchmark test for spatiotemporal query over triple stores. The spatiotemporal SPARQL query is intelligently decomposed and executed on different systems, which significantly improves the query performance by more than a hundred times comparing to other solutions.