BackgroundThe Managed Metadata Service is in my opinion one of the better improvements in SharePoint 2010. It can be used across Sites, Site Collections and Web Apps for a centralized Taxonomy. Term sets can be open to allow end users to enter their own terms. The term set manager allows terms to be merged, reused, deprecated and moved. A term set can be configured to allow tagging so that end users can socially tag any page with a term.
Working for Puzzlepart I’ve seen lots of potential use for Managed Metadata and especially using it to push related content based on context. On the latest Pzl.Friday I finally got the chance to complete the research and complete a simple prototype.
estimated to as much as 10% of the working time. Although Search Engines such as the built-in search in SharePoint 2010 can reduce the amount of time spent looking it still requires an active act by users. It’s all about what you didn’t know that you didn’t know, and how to make you aware of that information in the context that you’re in. This is a huge value proposition for information workers.
Although there has been some investment in Social Tagging in SharePoint 2010 the tag profile pages are limited to Social Tags and will not leverage the even stronger term usage when an explicit term is used in a MetaData context.
Personally I would appreciate a lot more a solution where I based on the context (page) I’m watching also see other related pages or documents based on metadata relevance, which I will prove possible below.
Example: looking into the Enterprise Wiki Page for SharePoint Development I also get information about SharePoint Projects, a document about licensing and other SharePoint related wiki pages.
SolutionI won’t go into details of how the Taxonomy fields are actually handled in SharePoint 2010, for that I recommend reading Wictor Wilén’s Dissecting the SharePoint 2010 Taxonomy fields. I found very little information about how to find contents related by taxonomy fields but this forum post helped me a lot in understanding how it all fits together How do I get SharePoint items tagged with a term from the term store.
To achieve the goal the following tasks need to be done:
- Identify the taxonomy fields and retrieve term ids
- Getting WSSIds for each term in each field
- Querying for related information based on WSSId s
- Optionally qualify the relevance further
- Render the result
Identify the taxonomy fields and retrieve term idsThe code below will pick the standard taxonomy field based on a static Display Name. The field(s) could however be picked based on the Context of the File.
Getting WSSIds for each term in each fieldWSS Id’s are the actual lookup Id’s which can be used in a SiteDataQuery to get related conent. The code below will get the Wss Id’s using the Taxonomy Session.
Querying for related information based on WSSIdsQueries both custom list and document libraries and build up XML content. I chose building it as an XML string so that It will be easier to customize the visual appearance using XSL later on.
Putting it all togetherOnce the basic methods are in place it’s all a matter of calling the methods and transform XML to Html using XSL. All this is available in the SourceCode which you can download from Puzzlepart at the download link below.
The end result is shown here as a WebPart embedded in the page, but it could easily be moved to a layout page or master page and be displayed in every site.
Download the full SourceCode
PotentialWhile I’ve proven how to get related contents based on the current context some algorithm should be applied to tune relevance. This could be done based on rating, modified date or even testing if similar social tags exist on the same result.
One can also use social tagging as a source and mix the result based on both social tagging and Managed taxonomy fields.