Graphs have been widely used due to its expressive power to model complicated relationships. However, given a graph database DG = {g1, g2, · · · , gn}, it is challenging to process graph queries since a basic graph query usually involves costly graph operations such as maximum common subgraph and graph edit distance computation, which are NP-hard. In this paper, we study a novel DSpreserved mapping which maps graphs in a graph database DG onto a multidimensional space MG under a structural dimension M using a mapping function φ(). The DS-preserved mapping preserves two things: distance and structure. By the distance-preserving, it means that any two graphs gi and gj in DG must map to two data objects φ(gi) and φ(gj) in MG, such that the distance, d(φ(gi), φ(gj)), between φ(gi) and φ(gj) in MG approximates the graph dissimilarity δ(gi, gj) in DG. By the structure-preserving, it further means that for a given unseen query graph q, the distance between q and any graph gi in DG needs to be preserved such that δ(q, gi) ≈ d(φ(q), φ(gi)). We discuss the rationality of using graph dimension M for online graph processing, and show how to identify a small set of subgraphs to form M efficiently. We propose an iterative algorithm DSPM to compute the graph dimension, and discuss its optimization techniques. We also give an approximate algorithm DSPMap in order to handle a large graph database. We conduct extensive performance studies on both real and synthetic datasets to evaluate the top-k similarity query which is to find top-k similar graphs from DG for a query graph, and show the effectiveness and efficiency of our approaches.