We want to show related annotations and forum posts in the first tab of the object (Object Details). Related annotations/posts for an object are the ones that mention it or its fields.
Annotation's content is stored as text and we need to parse it and find out if any links to objects are present. We will do that when saving annotation/post.
If any linked objects are present in text, we need to refresh a list of related objects for the annotation/post in OWLIM. That is, each time annotation/post is edited we need to parse and recreate the list per annotation/post.
Annotations are identified by their URIs. Forum posts have numeric IDs. Forum posts are not currently stored in OWLIM. We need to generate URIs for them, for example: http://researchspace.com/jforum/123 where '123' isthe post's ID.
1. When annotation or forum post are saved, we need to parse the text. We search for links like:
<a class="rslink linkMO" href="http://collection.britishmuseum.org/id/object/RFI41407">RFI41407 Chromolithograph pictorial label used for...</a>
<a class="rslink linkStatement" href="http://www.researchspace.org/st/2">amulet YCA70788 Glass two-finger amulet: this moulded funerary...: dimension</a>