Rdf Study Budai Steliana Gorea Alexandra Diana

1,482 views

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,482
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
28
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Rdf Study Budai Steliana Gorea Alexandra Diana

  1. 1. Comparative Study Regarding RDF in .NET Framework<br />Budăi Steliana:steliana.budai@infoiasi.ro<br /> Gorea Diana Alexandra: alexandra.gorea@infoiasi.ro<br />This study will present (some of) the available implementation for working with RDF documents using the .Net framework's C# language. <br />Since the new release of Windows 7 received good reviews, this study will focus on the possibility of working with RDF documents on this new OS:Windows 7. <br />Before the study began the Microsoft Visual Studio 2008 Professional development environment was installed. For each found library a set of important information like author, features, license, etc. was gathered and then using the available documentation the quest was to get one of the examples available(were available) to compile and run on this Windows 7 machine, then using the available documentation describing the API, build a simple RDF document save it then read it again. The steps and actions needed for the quest to be resolved will be available in the " Installing and start using section" . <br />SemWeb<br />Short description: Semantic Web/RDF Library for C#/.NET <br />author: Joshua Tauberer :http://razor.occams.info/ <br />Project homepage:http://razor.occams.info/code/semweb/ <br />Description/Features: <br />SemWeb is a Semantic Web/RDF library written in C# for Mono or Microsoft's .Net 1.1/2.0.  <br />Some features:<br />Straightforward API that is easy to deploy and is completely cross-platform.<br />RDF/XML: Reading and writing RDF/XML (including XMP). The reader is streaming, which means the entire document doesn't ever need to be loaded into memory<br />Notation 3: Reading and writing NTriples, Turtle, and most of Notation 3<br />SQL DB-backed persistent storage for SQL Server, MySQL, Sqlite, and PostgreSQL.The MySQL store (if not the others) scales to at least a billion triples (see this).There is of course also an in-memory store. <br />querying using simple graph matching and SPARQL; <br />make SPARQL queries to remote endpoints; <br />has limited support for RDFS; <br />general purpose inferencing is possible; <br />storage of triples: Memory and relation databases like MySQL <br />support for SPARQL: Yes( using Ryan Levering's SPARQL java implementation http://sparql.sourceforge.net/ converted to .Net using the IKVM written by Jeroen Frijters) <br />support offered to programmers<br />documentation: there is basic documentation http://razor.occams.info/code/semweb/semweb-current/doc/index.html <br />API documentation http://razor.occams.info/code/semweb/semweb-current/apidocs/index.html and some examples: http://razor.occams.info/code/repo/?/semweb/examples <br /> installing and start using <br />Running a example: <br /> Download the source code http://razor.occams.info/code/semweb/semweb.zip and unzip it to a convenient location. <br /> In Visual Studio create a new console project and reference the semweb.dll library form the /bin sub folder of the downloaded files. <br /> Follow the steps from the hello world example http://razor.occams.info/code/semweb/semweb-current/doc/helloworld.html <br /> Build a RDF document saving it and the read it: <br />In Visual Studio create a new console application project and add the semweb.dll as a reference just like in the above example.<br />Fallow the steps from the previous example and from the reading a RDF file example http://razor.occams.info/code/semweb/semweb-current/doc/readingrdf.html and it is easy to write the code to generate a RDF file and load it's content <br />the code is: <br />using System; <br />using System.Collections.Generic; <br />using System.Linq; <br />using System.Text; <br />using System.IO; <br />using SemWeb; <br />namespace ConsoleApplication1{<br />class Test2RDF { <br /> const string RDF = " http://www.w3.org/1999/02/22-rdf-syntax-ns#" ; <br />     public static void Main() { <br />       MemoryStore store = new MemoryStore();             Entity w3sc = new Entity( " http://www.w3schools.com" ) ; <br />        Entity title = " http://www.w3schools.com/rdf/title" ; <br />        Entity author = " http://www.w3schools.com/rdf/author" ; <br />        store.Add(new Statement(w3sc, title, (Literal)" W3Schools.com" )); <br />        store.Add(new Statement(w3sc, author, (Literal)" Jan Egil Refsnes" )); <br />        //save to afile.xml <br />        using (RdfWriter writer = new RdfXmlWriter(new StreamWriter(" afile.txt" )))  {<br />                 writer.Namespaces.AddNamespace( " http://www.w3school s.com/rdf/" , " si" ); <br />      writer.Write(store); <br />      writer.Close(); <br />      } <br />      //now read RDF file and print it to the console <br />     MemoryStore readStore = new MemoryStore();   readStore.Import(new RdfXmlReader(" afile.xml" ));             using (RdfWriter writer = new <br /> RdfXmlWriter(Console.Out)){ <br />//this is still neccesary                  writer.Namespaces.AddNamespace(" http://www.w3schools.com/rdf/" , " si" );                writer.Write(readStore); <br />  } <br />            Console.WriteLine();<br />} <br />}    <br />} <br />Sadly though the afile.txt file has the content duplicated <br /><?xml version=" 1.0" ?> <br /><rdf:RDF xmlns:rdf=" http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:si=" http://www.w3schools.com/rdf/" > <br /><rdf:Description rdf:about=" http://www.w3schools.com" > <br /><si:title>W3Schools.com</si:title> <br /><si:author>Jan Egil Refsnes</si:author> <br /></rdf:Description> <br /></rdf:RDF> <br /><?xml version=" 1.0" ?> <br /><rdf:RDF xmlns:rdf=" http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:si=" http://www.w3schools.com/rdf/" > <br /><rdf:Description rdf:about=" http://www.w3schools.com" > <br /><si:title>W3Schools.com</si:title> <br /><si:author>Jan Egil Refsnes</si:author> <br /></rdf:Description> <br /></rdf:RDF> <br />The reading of the correct form of the RDF file works OK, but you still have to specify the name space when writing to the streamwriter to get the same result as the input file. That namespace should automatically be kept and used as in the original loaded model.  <br />afile.xml has the following content: <br /><?xml version=" 1.0" ?> <br /><rdf:RDF xmlns:rdf=" http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:si=" http://www.w3schools.com/rdf/" > <br /><rdf:Description rdf:about=" http://www.w3schools.com" > <br /><si:title>W3Schools.com</si:title> <br /><si:author>Jan Egil Refsnes</si:author> <br /></rdf:Description> <br /></rdf:RDF> <br />Conclusion: It is pretty simple to use this library, it has good examples that get you coding real fast. Trying to solve other specific problems needs a little bit more investigation of the API and mode documentation specially if you haven't got recent work experience in C#.   <br />Performance/Benchmarks: The author of this library run some fairly complex tests based on the LUBM benchmarks http://swat.cse.lehigh.edu/projects/lubm/  totaling 6.9 million statements spread accross 1,000 files totaling at 540MB. Also he tested using triple stores of over 1 billion statements. The performance seems pretty good for the amount of data involved.  <br />Portability: the library is completely cross-platform being developed for Mono. <br />license: SemWeb is licensed primarily under the terms of the GNU GPL (version 2 or later). The license for the components that this library is based on are as follows:  the SPARQL engine (sparql-core.dll) is licensed under the GNU LGPL;  the Euler proof mechanism (Euler.cs, which is a part of SemWeb.dll) is licensed under the W3C Software License; IKVM (IKVM*.dll) is GPL-compatible. <br />Comments/Current status:  This library is currently used in some open source projects mainly for linux ( ROWLEX, F-Spot-Gnome photo management, Beagle-Gnome desktop search ). There is an online RDF validation tool http://rdfabout.com/demo/validator/ that is based on this library.  The author worked on this library from  June 2005 to May 19, 2009 when he decided to stop for an indefinite period of time the development of SemWeb. This is because the author didn't notice enough interest for developing applications that use RDF.  On May 11, 2009 the current version 1.064 was released including mainly bug fixes. <br /> Greengrass <br />Author: Federico Di Gregorio and Pierluigi Di Nunzio <br />Short Description: Greengrass is a C# framework providing a high-level API for the Resource Description Framework (RDF), allowing RDF triples to be parsed, stored, and manipulated. Greengrass supports serialization and deserialization of CLR types to plain RDF, OWL, and other RDF vocabularies. Greengrass should work with any CLR-complied language, like C#, BOO, IronPython, Nemerle, IKVM Java, and VB.NET. <br />Project available from: http://freshmeat.net/projects/greengrass/ <br />support for SPARQL : No. Not supported <br />support offered to programmer <br />documentation: Could not find any documentation on the web and in the downloaded tar.gz file. Although in the downloaded archive there is an Example folder, it doesn't contain any useful example. there is a main class that prints a " hello world" string. No discussion forum available.      <br />learning curve: Starting to learn to work with this library is difficult because no documentation or example were available.  <br />Performance/Benchmarks: No publisher performance information available. <br />Portability : OS independent <br />license:GPLv3  LGPL  <br />Comments/ current status: The latest release was on on January 25, 2008, version 0.3 that included some improvements in performance, new features and a full Turtle parser that passes all W3C tests. <br /> linqtordf <br />Project home page:http://code.google.com/p/linqtordf/ <br /><ul><li>Project owner: matthews.andrew   http://code.google.com/u/matthews.andrew/ </li></ul>Short description:A Semantic Web framework for .NET <br />Features: <br />It provides an easy way to integrate Semantic Web queries into your software <br />You don't have to know that much SPARQL or RDF to be able to use it. <br />It also provides a UML-style design surface allowing you to create RDF files, and to generate compatible C# code to work with the RDF. <br />It will help those who don't have the time to ascend the semantic web learning curve to become productive quickly. <br />storage of triples: information not specified <br />support for SPARQL: Yes. <br />support offered to programmer: <br />  documentation: The project has a wiki page that is not very popular at: http://code.google.com/p/linqtordf/wiki/MainPage; and a forum that is pretty busy at:   http://groups.google.com/group/linqtordf-discuss/topics; Some user manuals for the library can be found http://code.google.com/p/linqtordf/w/list. No examples links could be found on the projects home page. <br />developing environment integration: it is specially created for Microsoft Visual Studio. It integrates with the developing environment allowing the user to view/edit RDF files like the usual UML editors.  <br />installing and start using  <br /> Run a simple example <br />download the msi setup file from the home project page<br />run the setup <br />locate the linqtoRDF.pdf manual.Observation: The readme.html file contains only the word " readme" . <br />in the manual you are asked to install the LinqToRdfDesigner: " Once LinqToRdf is installed, you should then install LinqToRdfDesigner, which will register the DSL (Domain Specific Language) add-in to Visual Studio. Note that LinqToRdf and LinqToRdfDesigner will only work with Visual Studio 2008 and above." <br />This operation couldn't be completed on Windows 7. An error message windows appears that doesn't explained what the problem really was or how to correct it. <br />Unfortunately the LinqToRdf manual doesn't have some startup example code. The page that suppose to have example only contains some code that is not commented in any way http://code.google.com/p/linqtordf/wiki/LinqToRdf. <br />Since this library is based on the SemWeb project's library you can easily run the examples from the base project and it will run just fine. <br />Build a RDF document saving it and the read it:<br />See SemWeb project for the example. <br />learning curve: it should be pretty easy to use, has a visual way to see and create RDF documents(that doesn't work for Windows 7). <br />Performance/Benchmarks: No performance/ benckmarks information available on the project home page.  <br />Portability: the library can be downloaded as an " msi" file (that is windows specific) and works with Microsoft's Visual Studio. In conclusion it is not developed to be used on other operating systems <br />license New BSD License <br />based on/uses: This library is base on SemWeb project. At the core of the system sits a LINQ query provider (like LINQ to SQL) that converts your queries into the SPARQL query language. <br />Comments/Current status: The project started in 2007 and is currently still maintained. The current release version is v0.8 that was released in August 2008. <br />ROWLEX <br />Author/owner: NATO C3 Agency  <br />Projects home page:http://rowlex.nc3a.nato.int/ <br />Short description: ROWLEX is a powerful open source toolkit for software developers. It has been built to simplify the use of fundamental semantic web technologies (RDF and OWL) under Microsoft’s .NET platform. ROWLEX stands for Relaxed OWL EXperience. That is exactly what it is. It allows programmers to create and browse RDF documents while keeping the focus on the business objects. It abstracts away the level of RDF triples and elevates the level of the programming work to (OWL) classes and properties. ROWLEX opens the way to experience the beauty of the open world assumptions within the reliable .NET environment. <br />Features: <br />serialize business objects into an RDF document <br />build an RDF document <br />browse an RDF document <br />storage of triples: no information available. <br />support for SPARQL: Not supported. <br />support offered to programmer <br />documentation There is a lot of documentation and examples on the project's " how to use" subpage  http://rowlex.nc3a.nato.int/HowToUse.aspx <br />license GNU LESSER GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 <br />Comments Current release is Version 2.0.1 - July 15, 2009 <br />Other libraries: <br />Drive <br />Supposed home page: http://www.driverdf.org/ - Not working <br />Description: It supposed to be an RDF parser written in C# for the .NET platform. <br />Comments: It seams that this project was abandoned. Some one else was interested in this project and could not find any more information about it http://lists.foaf-project.org/pipermail/foaf-dev/2008-July/009279.html <br />OwlDotNetApi <br />Project home page  http://users.skynet.be/bpellens/OwlDotNetApi/index.html <br />Short description:The OwlDotNetApi is an OWL (Web Ontology Language) API and parser written in C# for the .NET platform based on the Drive RDF parser. Its fully compliant with the W3C OWL syntax specification and can be used within any .NET language. <br />Features: <br />C# based RDF parser for the .NET platform <br />Compliant with the OWL Syntax Specification <br />Builds a directed linked graph <br />Can be used with any .NET language. <br />Merges Graphs from multiple sources <br />Simple generator using the visitor pattern <br /><ul><li>Since the parser is based on Drive, it shares many of the features of that parser as well. </li></ul>support offered to programmer <br />documentation: Some documentation and API description can be found (http://users.skynet.be/bpellens/OwlDotNetApi/documentation.html) in html format  http://mach.vub.ac.be/~bpellens/OwlDotNetApi/index.html. The pdf couldn't be downloaded and the chm didn't work on the Windows 7 machine I was testing.  <br />The sources, binaries and an example can be downloaded from http://users.skynet.be/bpellens/OwlDotNetApi/download.html. <br />license GNU LESSER GENERAL PUBLIC LICENSE  Version 2.1, February 1999 <br />based on/uses Uses DriveRDF project that can’t be accessed anymore. <br />Comments There is only one version released (version 1.0) in 2006. <br />Carp  <br />homepage: http://www.semanticplanet.com/library/Carp/HomePage <br />Spiral formerly Rdf Lib <br />homepage: http://www.semanticplanet.com/library/Spiral/HomePage <br />Comment:For this last two projects I could not access the source code and no other information about the project was available. A password is required to edit the project's wiki page; <br />Observation: On a page that lists tools available tools for RDF in C# http://esw.w3.org/topic/CSharpRDFTools only the links to ROWLEX and SemWeb projects work.<br />References<br />All the information about the RDF libraries were taken from the project’s home page and linked pages unless specified otherwise.<br />

×