FOAF Parsing And Crawling In C#

Thursday, May 1, 2008 by Mistlee


Can't see any images? -!


C Programming Tutorials and advice
CProgrammingTrends News Archives About Us Feedback

Recent Articles

Working With Gravatar Images
Gravatar is a service that associates your e-mail addresses with a picture of you for use on blog comments, forums and bulletin boards. I've been a happy user for years. A cool thing about Gravatar...

ZoomInfo API - ASP.NET C#
Over the last couple of days I have been digging into the ZoomInfo API (using C# - ASP.Net) to first of all better understand the API and secondly to leverage the...

OpenID Implementation In C# & ASP.NET
Over the weekend I began looking more deeply into OpenID than I have before. I've always been intrigued by OpenID, but the information about it in terms...

IDataRecord Fields To Dictionary Extension Method
I have never been a fan of directly passing IDataRecords, or IDataReaders for that matter, about the place to get simple field values out. herefore, with the introduction...

ECMAScript, The New C++?
Everything but a call for a kitchen sink subroutine has been tossed into ECMAScript 4, leaving a couple of bloggers wondering why. ECMAScript has appeal...

Responses To Microsoft Releasing .NET 3.5 Source
So far the views from Dave, whurley, Matt and others have been negative to handle with caution. After I heard that Microsoft was releasing the .NET 3.5 source...

Resolve & Shorten URLs In C#
Recently I've needed a method that would look at some text and automatically discover all URLs and turn them into hyperlinks. I've done that before so it was...

Yahoo SiteExplorer API With C#
If you are interested in using Yahoo's SiteExplorer API and are coding in the ASP.NET environment using C# (web pages) then the following method might be of...



05.01.08

FOAF Parsing And Crawling In C#


By Mads Kristensen

I've been looking deeply into FOAF lately and last week I worked on a parser that could wrap a FOAF document into a strongly typed class for easy consumption by C#.

Now I want to share it with anyone interested. It appears there are no FOAF parsers available in C# yet. I wasn't able to find any.

The parser
The class FoafParser has two public methods, Parse and ParseFriendsAsync, which handles two different approaches in fetching FOAF documents.

The Parse method
This method takes a URL as a parameter which must point to an online FOAF document. It then parses the foaf:Person element which contains fields such as name, birth date, photo, homepage etc. It then looks for people in the FOAF document that are described as someone you know, parses the information available and adds it to a public collection property. The following example parses a FOAF document and binds it to an ASP.NET Repeater.



The ParseFriendsAsync method
When you list people you know in a FOAF document, it is common to only provide very little information such as the full name. When that is the case it is also common to provide a link to that persons FOAF document using the rdfs:seeAlso tag. We can then use that link to retrieve all your friend's FOAF documents and parse them as well.


It can take a long time to retrieve all those documents one at a time, but if we do it asynchronously then we can speed things up substantially. When you have called the Parse method on the FoafParser class, you can then call ParseFriendsAsync. It loops through all the friends that the Parse method found in search for the rdfs.seeAlso tag. When it finds it, a web request is made to retrieve the FOAF document of that friend and then parse it for information.

When the ParseFriendsAsync method is finished, it triggers an event you can listen to. All the friends with FOAF documents have now been updated in the collection.



Download
In the zip file below you'll find the FoafParser.cs class as well as an example .aspx page and code-behind file.

FoafTester.zip (3,77 kb)

Comments

About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/
About CProgrammingTrends
A collection of articles and tutorials designed to help C and C variant programmers in their programming work. C Programming Tutorials and advice





CProgrammingTrends is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com ITmanagmentNews.com





-- CProgrammingTrends is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2008 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal


archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


Unsubscribe from CProgrammingTrends.
To unsubscribe from CProgrammingTrends or any other iEntry publication, simply send an email request to: support@ientry.com
CProgrammingTrends Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact

Supply Chains Need P2P Plumbing

by Mistlee


Can't see any images? - !


SCMnews News Archives About Us Feedback


Click to Play

Unleashed: Wayne Small
Wayne Small, of SBSfaq.com, traveled all the way from Australia to attend Small Business Marketing Unleashed in Texas. In an interview with WebProNews Reporter...

Recent Articles

The On-Line Solution For Demanding Customers
Where is my stuff? Isn't it all to often the question? If you have a small business shipping what it sells, or if you buy from one, this is happening all the time: once a shipment has left your premises, it is most of the...

End-to-end Supply Chain Services
CEVA Logistics said it has appointed Bill Aldridge as executive vice president for its newly created business unit, International Logistics Solutions. ILS aims to provide end-to-end supply chain services from purchase order to point of sale, focusing in the Asian...

Retail Container Traffic Falling...
As discussed previously, within this blog...we have plenty of big ships...but the market will not have the space/container demands matching the the past few years... Traffic at U.S. ports that handle most...

Looking Back On The CHaINA Awards
A few weeks ago, the China Supply Chain Council presented its CHaINA Awards for the third times to celebrate superior achievements that are enabled by supply chain management in China. Over 150 supply...


05.01.08

Supply Chains Need P2P Plumbing

By James Cherkoff

Supply chain management is not a term to get the blood rushing but it is a vital corporate function that describes taking raw materials from the field to the shelf.

I spent a few years at a large consultancy and saw first hand quite how complex the planning of such supply chains can become. Armies of smart consultants would spend months mapping out the passage of exotic supplies through global megacorps, before turning the whole process into bits and bytes.

To date, supply chains have been just like company plumbing. When blockages appeared they were quickly flushed out to keep the pipes to retailers and customers flowing freely. However, these days, there are some new pipes that are changing the nature of markets - and supply chains. They are the P2P pipes that customers have set up themselves. And these P2P and networked media environments have created blockages that can't just be flushed out with a corporate enema.

Think of the effect that Shawn Fanning's Napster had on the music industry. By linking together all the customers in the market he stuck a spanner in the companies' supply chains and they've never recovered. But all he did was recognise that the marketplace was demanding something different and used the tools at hand to meet it.


What if the music industry had extended their supply chains to include some of these new P2P pipes? By focusing on rebuilding the marketplace, rather than protecting their industry, they could have trousered the revenues that their customers wanted to give them - rather than suing them for the ones that they didn't. Instead they despatched a million writs, let Apple hijack the entire marketplace and joined the DRM-free party when it was too late and their reputations were dirt. But that's all hindsight right? Well yes, but it's also a warning for companies who still that think their supply chains stop at the corporate walls. Compare the experience of the music labels to Lego who have extended their own supply chains into the 'grey' market where their customers are busy innovating - and plumbed them right back into the business. The company's vision in this area has transformed its fortunes.

So where do you start? The first step is to understand which P2P pipes are relevant - and remember they may 'just' be small discussions about problems or innovations. There are many ways to do this. Dell's IdeaStorm and MyStarBucksIdea should help both companies stay on top of any new plumbing appearing beyond their firewalls and allow them to act. Alternatively, you can ignore the whole thing and hope that the next Shawn Fanning isn't doing some P2P plumbing on your supply chains as we speak.

Comments


About the Author:
James Cherkoff is a Director of Collaborate Marketing, a consultancy in London which helps companies in Europe and the US operate in networked media environments. He is editor of the blog Modern Marketing and contributes articles to the FT, BBC, Independent, and the Guardian. James speaks at conferences and events around Europe and the US, including MIT MediaLab and Reboot in Denmark. You can here him here. When he isn't knee deep in the blog-world he is likely to be discussing Arsenal FC or playing peek-a-boo.
About SCMnews
SCMnews is a collection of news and commentary covering the latest developments and solutions available for supply chain managment. Supply Chain Management News and Commentary.





SCMnews is brought to you by:

WebProNews.com Jayde.com
MarketingNewz.com SalesNewz.com
CareerNewz.com ManagerNewz.com
eCommNewz.com WebsiteNotes.com
AdvertisingDay.com ActivePro.com
SoHoDay.com CRMNewz.com





-- SCMnews is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2008 iEntry, Inc.  All Rights Reserved   Privacy Policy   Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article

Unsubscribe from SCMnews.
To unsubscribe from SCMnews or any other iEntry publication, simply send an email request to: support@ientry.com

SCMnews Home Page About Article Archive News Downloads WebProWorld Forums iEntry Advertise Contact Jayde Supply Chain Managment News and Commentary WebProWorld Forum