|
Blogs
Social Network Analyzer - an Innovation Center ProjectClients occasionally ask me what's new and cool in Business Intelligence from SAP BusinessObjects, and I always direct them to the SAP BusinessObjects Innovation Center site. It's where the thinkers and tinkerers in the Labs put out their great ideas for public comment. You can see from their successes that they've got the right stuff! Explorer (formerly Polestar), BI Desktop, MobI, QaaWS - all now used by customers to get a competitive edge on the competition when it comes to BI. Alexis Naibo - one of the Labs guys - sent me an email a few weeks back about a new and exiting Innovation Center première: the Social Network Analyzer (SNA). If you think of Google Maps as an geographical roadmap, showing you how to get from point A to point B and then find out what's near point C (such as hotels, restaurants, etc), then you can think of SNA as an organizational/social roadmap, showing you how to get from person A to person B and to committee C, and find out who's associated with A, B, and C. Check out the on-line SNA demo here: http://sna-demo.ondemand.com/. The Flash client enables navigation around the SNA - and it's pretty slick and awesome. But don't let the pretty face fool you - there's a lot more going on behind the screen. What really intrigued me about Alexis' email was an attachment for the SNA RESTful Web Services API (it's now available publicly here)! A new API for a cool new product - I had to try it out and see what it could do. Now that I've worked with it a bit, I can say that the API is fully-featured (anything you see done on the Flash demo you can do yourself via code using the API) but easy to code against - I was able to quickly bring up the two sample codes I present below in a few days of intermittent work (between Customer Support engagements). So have no worries if you've looked at the demo, but was wondering if it's possible to integrate the SNA server into your existing applications and portals - the API makes it quite easy to do so. One note: the Web Services is still evolving and yet to be finalized - there may be changes to the API by the time SNA is finally productized. I think of that as a benefit - you still have the opportunity to test it out and provide feedback before it becomes an official product. Relationship Analysis Server RESTful Web ServicesTimo gives a clear and insightful overview of the SNA Web Services in his blog. The hit points for the API framework are: a RESTful Web Services with ATOM 1.0 Syndication influenced by the OpenSocial API. Use of the ATOM Syndication Format in particular widens the accessibility and utility of this API. Most general-purpose programming languages out there have supporting libraries ATOM, for example Project ROME for Java, System.ServiceModel.Syndication for .NET, and as3syndicationlib for Adobe Flex/Flash. These libraries encapsulate both ATOM Feed Documents and ATOM Entry Documents via classes, and expose any custom extensions to the format via the underlying XML parser. I'll give two code examples below that highlight how you would integrate the SNA server into your own application and how you may use the information provided by the SNA to make your process workflow more efficient. Both examples are desktop apps - one using Java, integrating Google Maps into the SNA data feed, and the other using C# (.NET), sorting email addresses in a intuitive way using data from the SNA. Java Desktop App Integrating SNA with Google MapsHere's a screenshot of a quick and not-so-pretty POC that links data from SNA to Google Maps:
When you enter a search phrase into the text box and click "Search", the list shows photos and names of the matching people. Clicking on a person on the list updates the Google Map to center on their work location. This app uses Apache HttpClient 4.0 for the HTTP client, ROME 1.0 (slighly modified to implement parsing for <atom:icon> elements within <atom:entry> elements) for the ATOM parser, and JDICplus 0.2.2 for the desktop Google Maps integration. Java JDK 1.6+ is required for the libraries. The sample connects to the http://sna-demo.ondemand.com and uses the (City, Country) information from the user profiles stored within the SNA database. The SNA demo only provides (City, Country) geographical data, but the actual SNA product you can download and install on your own servers implement support for more detailed location data: both geocoding info - latitude and longitude - as well as full addresses. One can easily customize the sample code it utilize the additiona information fields, if you have your own SNA deployment. Here's the Java code: SNAMap.java - desktop app displaying SNA user on Google Maps Note that the RESTful Web Service bits are quite short, simple and staighforward: HTTP POST/GET and ATOM Syndication parsing. .NET Desktop App Sorting Email Address Based on RelationshipsA little background on why I wrote this POC. A few months ago, I emailed David W. who sits a few desks away from me (and who happens to be a true Ace when it comes to fixing broken Web Intelligence deployments), only to have a reply immediately come back saying "Sorry, wrong David W." There's always a risk that an email you send using Outlook auto-complete ends up in an unexpected inbox - say a Director half a continent away rather than an Engineer a few feet away. Particularly so if your fairly large company had recently joined forces with an even larger company - chances of an email faux pas rises exponentially with the number of people involved... So I learned I better double-check before I let Outlook do the thinking for me. But here's a puzzler: given people with identical names, or similar names, how do you find the one who's most relevant to you? One way is to rank the people by how "close" they are to you. For example, given two David W.'s, one two steps up then two steps down the organizational chart, and the other in an entirely separate division, it's more likely I'd be sending email to the first David than the second. Four people separate me from David in a social relationship map, and more than eight people separate me from the other David (we're talking strict organizational charts here - I'm assuming if I input everybody in North America into the SNA and their relationships, then the Six Degrees of Separation rule will come into play). So here's where the SNA comes in. Given all people matching "David" in the SNA server, I can query for the "relationship path" between me and each "David", then rank them by how far they are from me, i.e. how many "hops" in people it takes to reach them. Where the SNA shines is that relationships aren't restricted to just between people. You can define Groups and Committees as well, and relate them to people who belong. So if I'm searching for someone to email, those people who belong to the same committee as I would be ranked higher. Now that's a good heuristic - that I'd be more likely to email someone on the same committee. Here's a screenshot of the app:
I enter a search string and click "Search", the app queries SNA for all people matching the query, retrieves the relationship path between me and each person, then sorts them according to increasing path length. By selecting people on the list and clicking "Email", an email client with the selected email addresses in the "To:" field is brought up. Here's the C# codes: SNAEmailSearchForm.cs - list SNA user emails ranked by relationship distance SNAEmailSearchForm.Designer.cs - definition of UI components for SNAEmailSearchForm.cs Again, the parts that handle communication with the SNA are relatively simple and straightforward. SummaryI've presented two samples that illustrate possible ways to integrate the SNA server with your app. The SNA is still a SAP BusinessObjects Labs project and not yet productized, and the API may change before it becomes an official product. I do encourage you, if you think the SNA would fill a role within your organization, to try it out, check out its Web Services API, and provide feedback! We're always looking to improve our products, and any comments, suggestions, enhancement request you may have would be more than welcome. Ted Ueda
|