Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get started with Sparql as a .NET Developer?

Tags:

.net

sparql

I'm trying to parse Project Gutenberg's large RDF file. Another member of my team is pretty stuck, having tried Semweb and a python library.

Being a little naive about rdf, I tried to write a plain ol' xml parsing script in Ruby. I soon realized it was too complex to really work.

I've downloaded Intellidimension's tool and am thinking of using it.

I guess I don't understand how to use SPARQL. It seems there is a parser in Java called Jena. Is there something like that in .NET?

Sorry for the obvious question....I'm just not sure where to write the SPARQL queries. Is there a library that would allow me to build a query using strings, similar to Data.SQlClient and then execute against some Sparql processor?

What do you execute Sparql against?

like image 674
rsteckly Avatar asked Dec 05 '10 01:12

rsteckly


3 Answers

Another option in .Net is dotNetRDF (disclaimer - I am the lead developer on this project)

It has the advantage over SemWeb that is is currently maintained and has active ongoing development plus it includes support for many of the newer Semantic Web technologies such as RDFa and SPARQL 1.1

Versus Intellidimension it has the advantage of being totally free (pick your own license from GPL, LGPL or MIT depending on your needs)

Re: SPARQL

Both SemWeb and dotNetRDF include SPARQL parsers and engines for executing queries. SemWeb's is based on an IKVM port of an old Java based SPARQL engine which has long since by superceded by the much superior ARQ engine in the Jena framework. dotNetRDF has the Leviathan engine which has close feature parity to ARQ (though not necessarily as performant for some kinds of queries).

Both ARQ (Jena) and Leviathan (dotNetRDF) support the majority of the emerging SPARQL 1.1 specification. If you have existing knowledge of SQL then you most likely want to use an engine which supports this as this adds many of the familiar features of SQL into the SPARQL language e.g. Aggregates (COUNT, MAX etc), GROUP BY, HAVING, Project Expressions (fn:concat(?x, ?y) AS ?z)

like image 66
RobV Avatar answered Nov 08 '22 23:11

RobV


The way to go is using the SemWeb Library to parse the RDF File into memory and then into a database. You may also import the associated ontologies.

Semweb has an embedded SPARQL library, so you can run SPARQL Queries on the database. If you are not familiar with SPARQL, you can use LINQ.

If you are new to Semantic Web Technologies, I recommend first to read the Semantic Web Primer (available as book and PowerPoint files). There is also a nice SPARQL Tutorial on the Jena Website

like image 37
MovGP0 Avatar answered Nov 08 '22 23:11

MovGP0


Yet another option is the dotSesame library. This is an IKVM port of the Java RDF framework Sesame. It includes RDF parsers, writers, a SPARQL query engine, and reasoners.

like image 2
Jeen Broekstra Avatar answered Nov 08 '22 22:11

Jeen Broekstra