views:

1058

answers:

4

Hi,

I'm working on a project where i had been asked to do a semantic search. The scenario is a database with a table containing 3 pieces of information, Doctor Name, Patient Name, and Date of Visit. I had been asked to create a form that contains 3 fields: Doctor, Patient and Date. So when a user wants to search for a patient's corresponding doctor or doctors for corresponding patients or their dates, they can just enter any of the fields to retrieve information form the database. I had done the coding in C# using Regular Expressions for string manipulation and information retrieval. But the main task is that the search should work using RDF and URI.

Now that I had worked on most part of the coding can someone help me how to create the search using RDF and URI, is there any solution for this, how can I integrate RDF in C#, is there any documentation.

But as per my supervisor's requirements he had asked me to build a search that works with RDF, I mean the details of patients (e.g. Patient's Name), Doctor's Name and Date would be in a form of URI which locates the details of patients, doctors and date information in the database so if anyone is trying to search for any information like doctor or patient can just enter their name in the corresponding field and retrieve the information. I'm attaching 2 snapshots of my code for your understanding.

Image 1: http://img29.imageshack.us/i/15035706.jpg
Image 2: http://img31.imageshack.us/img31/1117/86105845.jpg

The first image is where I enter all the details to the database and the second image is the search.

This is the overall idea about my project, can you advice me how this can be done?

I would be really grateful to you if someone could help me on this as soon as possible.

+1  A: 

Doing an RDF and URI based search is going to be dependent on whether your data is in RDF in the first place. If it's not you've either got to convert it from its current form into RDF on the fly or permanently. To do it on the fly you could use a technology like D2R which maps relational databases to RDF http://www4.wiwiss.fu-berlin.de/bizer/d2r-server/

There's some other Semantic Web C# stuff about like Rowlex http://rowlex.nc3a.nato.int/ which is more OWL based or there's my own dotNetRDF library http://www.dotnetrdf.org but that's only just about to be a first Alpha release so I wouldn't recommend it for any production systems yet. SemWeb as Alex mentions is pretty good and scales particularly well - only disadvantage is that it's .Net 2.0 so you need a separate library if you want to do LINQ with it

A question about your question...

Your question is unclear about what you mean by semantic search, are you sure you're actually meaning to do an RDF search or did someone just specify "semantic search" in the spec and you googled it and got articles about RDF? Semantic search doesn't necessarily imply a need for RDF, it could be that you actually want to do natural language search.

By this I mean that it could be that you want the ability to search for things like "patients of Dr Smith" and that your search engine should be able to interpret this as a search for patients where the doctor field corresponds to Dr Smith.

Equally I could be wrong and you could indeed be attempting to build something that sounds very like TimBL's example from his 2001 Scientific American article on the Semantic Web.

Edit

So as you do want to do proper RDF search then I would advise that you put your data into a Triple Store rather than a database and preferably use a Triple Store that provides SPARQL query so you can convert the inputs on your query form into a SPARQL query and query the Triple store with that.

Maybe take a look at Talis http://www.talis.com or Virtuoso http://www.openlinksw.com/virtuoso/

If you decide to use SemWeb then you could just use the Triple Store that it provides.

RobV
A: 

Using semantic web technologies for the scenario you describe is overkill. However, if you are interested in a mature .NET library for working with Semantic Web standards in .NET and SQL definitely take a look at Intellidimension's offerings.

spoon16
At $1500 a license per PC or $5000 for enterprise licensing just for the SDK and that's before you get into the costs of their Triple store it seems pretty overpriced. I do agree with you that the use of SW tech for this scenario does seem overkill
RobV
RobV, SQL is what 20k an enterprise license? I don't think the price is an issue when you are working on business applications (their target market). If you are just working on a hobby project than... yeah it's a bit expensive :)
spoon16
Also it has been my experience that Intellidimension will hand out free licenses on a case by case basis for educational and research related projects.
spoon16
both good points, I work at a university so practically anything Microsoft we have licenses for and so I'm personally never really aware of the costs
RobV
A: 

A C# library for RDF which seems to be becoming quite popular in the community of LinqToRDF. The project was originated by Andrew Matthews and has been going since 2007b I think. The software is up on Google COde and can be found here:

LinkToRDF

Together with the library, there's also something called "LinqToRDF designer" which fits into Visual Studio and allows you model RDF graphically.

Nico Adams
A: 

You may be able to do what you need using LinqToRdf. LinqToRdf exposes two LINQ query providers (i.e. you will need .NET 3.5+) including one that produces standards compliant SPARQL queries.

Here's a typical LinqToRdf Query, which if you're familiar with LINQ to SQL, should be totally natural:

MusicDataContext ctx = new MusicDataContext(@"http://localhost/linqtordf/SparqlQuery.aspx");
var q = (from t in ctx.Tracks
     where t.Year == "2006" &&
           t.GenreName == "History 5 | Fall 2006 | UC Berkeley"
     orderby t.FileLocation
     select new {t.Title, t.FileLocation}).Skip(10).Take(5);

foreach (var track in q)
{
   Console.WriteLine(track.Title + ": " + track.FileLocation);
}
Andrew Matthews