Database Reference
In-Depth Information
The Cypher in the delete method begins by finding the user and content that will be used in the rest of the query.
In the first
MATCH
, you can determine if this status update is the
CURRENTPOST
by checking to see if it is related to a
NEXTPOST
. If this relationship pattern matches, make the
NEXTPOST
into the CURRENTPOST with
CREATE UNIQUE
.
Next, the query will ask if the status update is somewhere the middle of the list, which is performed by
determining if the status update has incoming and outgoing
NEXTPOST
relationships. If the pattern is matched, then
connect the
before
and
after
status updates via
NEXTPOST
.
Regardless of the status update's location in the linked list, retrieve it and its relationships and then delete the
node along with all of its relationships.
To recap, if one of the relationship patterns matches, replace that pattern with the nodes on either side of the status
update in question. Once that has been performed, the node and its relationships can be removed from the graph.
Interest Graph Model
This section looks at the interest graph and examines some basic ways it can be used to explicitly define a degree of
interest. The following topics are covered:
•
Adding filters for owned content
•
Adding filters for connected content
•
Analyzing connected content (count tags)
Interest in Aggregate
Using the
/interest
route, we retrieve all of the user's tags and their friends' tags by calling, respectively, the
user_tags
and
tags_in_network
methods, which can be found in the
Tag
service class. This is displayed in
Figure
10-12
in the left-hand column.
Figure 10-12.
Filtering the current user's content