Using inverse operators for queries on online social networks
First Claim
Patent Images
1. A method comprising:
- receiving, from a client device of a first user of an online social network, a structured query comprising references to one or more selected objects associated with the online social network;
parsing the structured query to identify a first query constraint and one or more second query constraints;
identifying an inverse constraint associated with the first query constraint, wherein the first query constraint has been previously flagged as identifying greater than a threshold number of objects; and
generating a query command based on the structured query, wherein the query command comprises the inverse constraint and the one or more second query constraints.
1 Assignment
0 Petitions
Accused Products
Abstract
In one embodiment, a method includes receiving, from a client device of a first user of an online social network, a structured query comprising references to one or more selected objects associated with the online social network, parsing the structured query to identify a first query constraint and one or more second query constraints, identifying an inverse constraint associated with the first query constraint, wherein the first query constraint has been previously flagged as identifying greater than a threshold number of objects, and generating a query command based on the structured query, wherein the query command comprises the inverse constraint and the one or more second query constraints.
-
Citations
20 Claims
-
1. A method comprising:
-
receiving, from a client device of a first user of an online social network, a structured query comprising references to one or more selected objects associated with the online social network; parsing the structured query to identify a first query constraint and one or more second query constraints; identifying an inverse constraint associated with the first query constraint, wherein the first query constraint has been previously flagged as identifying greater than a threshold number of objects; and generating a query command based on the structured query, wherein the query command comprises the inverse constraint and the one or more second query constraints.
-
-
2. The method of claim 1, further comprising:
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 node corresponding to the first user; and a plurality of second nodes corresponding to a plurality of objects associated with the online social network, respectively.
-
3. The method of claim 2, wherein the structured query comprises references to one or more selected nodes from the plurality of nodes and one or more selected edges from the plurality of edges.
-
4. The method of claim 3, wherein:
-
the first query constraint is for a first object-type corresponding to one or more nodes of a first node-type that are each connected by one of the selected edges referenced in the structured query to one or more nodes of a second node-type; and the inverse constraint is for a second object-type corresponding to one or more nodes of the second node-type that are connected by the one of the selected edges referenced in the structured query to one or more nodes of the first node-type.
-
-
5. The method of claim 1, wherein the first query constraint is for a first object-type and the inverse constraint is for a second object-type.
-
6. The method of claim 1, wherein the first query constraint is for a first object-type and the inverse constraint is for the first object-type.
-
7. The method of claim 1, wherein the inverse constraint is for a first object-type and one or more of the second query constraints are for one or more second object-types.
-
8. The method of claim 1, wherein:
-
the first query constraint comprises an inner constraint and an outer constraint; and the query command comprises an intersect of the inverse constraint and the inner constraint.
-
-
9. The method of claim 1, further:
-
the first query constraint is for a first object-type, the first query constraint corresponding to an inverted index mapping the first object-type to a second object-type; and the inverse constraint is for the second object-type, the inverse constraint corresponding to a forward index mapping the second object-type to the first object-type.
-
-
10. The method of claim 1, further comprising:
-
identifying a first set of objects matching the inverse constraint; identifying a second set of objects matching the one or more second query constraints; and generating one or more search results based on the first and second sets, wherein each search result corresponds to an object of a plurality of objects associated with the online social network.
-
-
11. The method of claim 10, wherein generating the one or more search results based on the first and second sets comprises generating a search result corresponding to each object identified in both of the first set of objects and the second set of objects.
-
12. The method of claim 10, wherein each search result corresponds to an object of the second set of objects that are connected to one or more of the objects of the first set of objects.
-
13. The method of claim 10, wherein each search result corresponds to an object of the first set of objects that are connected to one or more of the objects of the second set of objects.
-
14. The method of claim 10, wherein identifying the second set of objects matching the one or more second query constraints comprises identifying one or more objects of a plurality of objects associated with the online social network that are connected to one or more of the objects in the first set of objects.
-
15. The method of claim 1, further comprising:
determining a number of objects satisfying the first query constraint; and if the number of objects is greater than a threshold number of objects, then generating the query command with the inverse constraint; else generating the query command with the first query constraint.
-
16. The method of claim 1, further comprising:
-
generating a preliminary query command based on the structured query, wherein the preliminary query command comprises the first query constraint and the one or more second query constraints; generating a first set of search results based on the preliminary query command; and if the first set of search results is less than a threshold number of search results, then generating the query command with the inverse constraint and generating a second set of search results based on the query command with the inverse constraint.
-
-
17. The method of claim 1, further comprising:
-
generating a first set of search results, wherein each search result corresponds to an object of a plurality of objects associated with the online social network, by; identifying a first set of object matching the first query constraint; and identifying a second set of objects comprising one or more objects from the first set of objects that match one or more of the second query constraints; and if the second set of objects is less than a threshold number of objects, then generating a second set of search results by; identifying a third set of objects matching the inverse constraint; and identifying a fourth set of objects comprising one or more objects from the third set of objects that match one or more of the second query constraints.
-
-
18. The method of claim 1, further comprising:
-
flagging one or more query constraints, wherein each flagged query constraint has been identified as identifying greater than a threshold number of objects when executed; determining whether the first query constraint is one of the flagged query constraints; and generating a querying command comprising the inverse constraint if the first query constraint is a flagged query constraint.
-
-
19. One or more computer-readable non-transitory storage media embodying software that is operable when executed to:
-
receive, from a client device of a first user of an online social network, a structured query comprising references to one or more selected objects associated with the online social network; parse the structured query to identify a first query constraint and one or more second query constraints; identify an inverse constraint associated with the first query constraint, wherein the first query constraint has been previously flagged as identifying greater than a threshold number of objects; and generate a query command based on the structured query, wherein the query command comprises the inverse constraint and the one or more second query constraints.
-
-
20. A system comprising:
- one or more processors; and
a memory coupled to the processors comprising instructions executable by the processors, the processors operable when executing the instructions to;receive, from a client device of a first user of an online social network, a structured query comprising references to one or more selected objects associated with the online social network; parse the structured query to identify a first query constraint and one or more second query constraints; identify an inverse constraint associated with the first query constraint, wherein the first query constraint has been previously flagged as identifying greater than a threshold number of objects; and generate a query command based on the structured query, wherein the query command comprises the inverse constraint and the one or more second query constraints.
- one or more processors; and
Specification