Wednesday, December 2, 2015

Using dotnetrdf and SPARQL

I recently started working on a project that required use of the RDF standard and so I immediately started searching for any .NET libraries that would support this standard and I came across dotnetrdf which is available for download from here: http://dotnetrdf.org/ or also available as a NuGet package.

Well, one of the requirements for working with RDF on my project was to use SPARQL so I immediately began digging into the User Guide to figure out how to accomplish this.

Based on the dotnetrdf documentation, there are 2 main sections that you have to review to begin working with SPARQL:

Unlike using a query language such as T-SQL with SQL Server, SPARQL uses different processing engines for Select statements vs. Insert, Update and Delete statements.

Therefore, if you are using Select SPARQL queries, you will want to read the Querying with SPARQL section and you will be using the SparqlQueryParser and SparqlResultSet classes.

However, if you are using Insert, Update or Delete statements, you will want to read the Updating with SPARQL section and you will be using the SparqlUpdateParser and SparqlUpdateCommandSet classes.

When you finally need to execute your queries or updates against your SPARQL server (such as Apache Jena Fuseki https://jena.apache.org/download/index.cgi) you will most likely be using the
SparqlRemoteEndpoint or SparqlRemoteUpdateEndpoint classes.

That is pretty much all there is to using dotnetrdf with SPARQL!!

No comments:

Post a Comment