JeroenW
JeroenW

Reputation: 763

How can I get strongly typed data/poco from a triple store/RDF graph database using C#?

Currently I am using an RDF graph database (Ontotext GraphDB), which I query using a SPARQL query via dotnetRDF and C#.

Via the SparqlResultSet I can access the data and create a typed object/poco, but I am looking for some magic like Dapper, but then for RDF databases. Create a query, execute it and get typed data as a result.

Is there something like that, or functionality to build poco's from a result? I am not tied to dotnetRDF, an alternative is also an option.

Upvotes: 1

Views: 349

Answers (2)

Giacomo Citi
Giacomo Citi

Reputation: 308

You may also have a look at Iride. It is an F# library but can be used from C# via a thin F# project which does not require any knowledge of the F# language, just a series of type declarations like:

type Q = SparqlQueryProvider<"SELECT * WHERE { ?s ?IRI_p $INT }">

So you can write SPARQL queries and the type provider will create a method (Q.GetText) to pass input parameters and a POCO wrapper (Q.Result) for the result variables.

Upvotes: 1

Kal
Kal

Reputation: 1932

RomanticWeb might do what you need. Unfortunately the project site appears to be down at the moment, but the packages are all available via NuGet.

Upvotes: 2

Related Questions