Announcing LinqToRdf v0.7

I’m proud to say that I’ve finally uploaded version 0.7 of LinqToRdf. This is by far the best release of LinqToRdf (so far), and it now contains full support for relationship navigation out of the box. Relationship support has always been possible (provided you were intimately familiar with various undocumented parts of LINQ:), but with the automated support for instance URIs that came in version 0.6, it’s now automatic.

The high points of the release are:

  • LinqToRdf and all its prerequisites are now installed to the Global Assembly Cache (GAC).
  • The code generator creates EntitySet and EntityRef properties for the parent and child ends of class relationships. This provide a lazily loaded collection and instance management system – the same as is used in LINQ to SQL.
  • All generated code makes use of partial classes to allow code to be extended cleanly with standard queries. This allows you to marry standard queries with the DataContext to allow easy relationship navigation while the DataContext is in scope.
  • DataContext classes are automatically generated using a LINQ to SQL idiom that makes the code MUCH more readable. See below for an example of how clean LinqToRdf code looks these days.
  • New meta-model query operators allow you to query by subject URI and Instance URI. This was to support relationship navigation, but it can be used anywhere. This is the first step in providing reification via LinqToRdf.
  • Support for commonly used LINQ Standard Query Operators like Count, First, and FirstOrDefault.

I’ve been meaning to do all of this for quite a while now, but it took some prompting by Carl Blakeley of OpenLink (back at the beginning of May) to force me to get my act together. My apologies to Carl for taking so long to come up with the goods – I’m sure you used EntitySets in the end, but now you have Instance URIs that you can plug into them to make the code cleaner. Enjoy.

The following is now actively supported by designer-generated code.

public void Foo()
    var ctx = new MusicDataContext(@"Some SPARQL Endpoint");
    var track = (from t in ctx.Tracks
                 where t.HasInstanceUri("Some Instance URI")
                 select t).First();

    Debug.WriteLine("Track was " + track.Title);
    Debug.WriteLine("Album was " + track.Album.Name);

    foreach (var t in track.Album.Tracks)
        Debug.WriteLine("Album Track was " + track.Title);

Please download it. Give it a try. Any and all feedback is much appreciated.


12 thoughts on “Announcing LinqToRdf v0.7

  1. Congrats on getting this out! I’m working on a LINQ provider myself and I know it’s hard. I’ll have to try your bits out for a spin.

  2. As someone who has been both a big fan of RDF and a .net developer for a good 8 years now, this all sounds great. Except for this supposed “high point”:

    “LinqToRdf and all its prerequisites are now installed to the Global Assembly Cache (GAC).”

    Not a high point.

    I, for one, find myself trending applications (and libraries) _away_ from the GAC whenever possible, preferring clean XCOPY deployment (even if wrapped with a simple installer to provide start menu entries, etc.) whenever possible. Further, I enforce this from development onwards, in that if a library can’t be pulled down from version control along with the source code and be usable in place and as is, the library gets replaced immediately.

    I hope that GAC installation is just a supported option, rather than a required one.

  3. We are planning to publish a White paper on LINQ to RDF based on it’s relevance to the re-emergence of data interaction at the “Conceptual Level” .

    This project is bringing Microsoft Technology into the Linked Data realm is a very constructive way!

  4. Hi Mark,

    Good luck with your QP. I’m sure you’ve seen Matt Warren’s series. If not, that’s a good source of inspiration. I just wish he’s written it a year or so earlier…


  5. Hi Jeremy,

    I’m moving the components into the GAC so that the project templates will compile and run without new users having to know what assembly references they require to get the system compiling.

    I’m open to suggestions…


  6. Hi Kingsley,

    That’s great! If you need any help or information, just drop me a line. Timezones can be a pain (I’m in GMT+10) but if you let me know when you’re planning to write it, I’ll endevour to make sure that all emails get answered quickly.

    There will also be a section on LinqToRdf in the upcoming “LINQ for Dummies” book being authored by John Mueller and due for release in August this year. I hope that the increased attention that LinqToRdf is getting will raise the profile of semantic web technologies within the .NET development community generally. The idea is that a framework based on LINQ will ease the passage of semantic web technologies into the mainstream of .NET development. Sadly microsoft dripfeeds technology to their community, so we have to do it ourselves.


  7. Andrew,

    Thanks for the new release.

    I’m having trouble installing the LinqToRdfDesigner. After installing LinqToRdf v0.7, I used the LinqToRdfDesigner.msi installer in c:\Program Files\LinqToRdf. The designer appears to install cleanly but I cannot see LinqToRdf item template.
    After clicking ‘Add New Item’ on the Visual Studio toolbar, it is not shown in the list of installed templates. Are there any manual setup steps/workarounds needed?
    After installing the designer, my LinqToRdf folder contains LinqToRdf.Designer.Dsl.dll and LinqToRdf.Designer.DslPackage.dll. Where should these DLLs go?

    I’m using a clean installation of VS2008 Professional Edition (v9.0.21022.8 RTM).


Comments are closed.

Create a website or blog at

Up ↑

%d bloggers like this: