Patent ID: 8782080

Claim:
A method comprising, by one or more computing devices: accessing a social graph comprising a plurality of nodes and a plurality of edges connecting the nodes, each of the edges between two of the nodes representing a single degree of separation between them, the nodes comprising: a first-user node corresponding to a first user associated with an online social network; and a plurality of second nodes that each correspond to a concept or a second user associated with the online social network; receiving from the first user a substantially unstructured text query; parsing the text query to identify one or more n-grams; determining a score for each n-gram that the n-gram corresponds to an edge or a second node; identifying one or more edges having a score greater than an edge-threshold score, each of the identified edges corresponding to at least one of the n-grams; identifying one or more second nodes having a score greater than a node-threshold score, each of the identified second nodes being connected to at least one of the identified edges, each of the identified second nodes corresponding to at least one of the n-grams; and generating one or more structured queries that each comprise references to one or more of the identified edges and one or more of the identified second nodes.