Database Reference
In-Depth Information
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:
Interest in Aggregate
Filtering managed content
Filtering connected content
Tag Entity
Listing 11-39 displays the Tag entity, which will be used to determine a user's interest and network of interest
based on users she follows. The tag entity also has incoming relationships with Users and Products, but the
relationship is defined using the other entities. It is not necessary to explicitly annotate the relationships on both
entities, because one implies the other.
Listing 11-39. The Tag Entity
@NodeEntity
@TypeAlias("Tag")
public class Tag {
public Tag() {
}
public Tag(String wordPhrase) {
this.setWordPhrase(wordPhrase);
}
@GraphId
private Long nodeId;
@Indexed(unique = true)
private String wordPhrase;
@Transient
private Integer tagCount;
// getters and setters
}
Interest in Aggregate
Inside the view method of the InterestController , you will retrieve all of the use tags connected to a user and their
friends using the tagsInMyNetwork method found in the TagImpl class. This is displayed in Figure 11-12 in the left-hand
column. The display code is located in {PROJECTROOT}/WebContent/mustache/html/graphs/interest/index.html .
 
Search WWH ::




Custom Search