What is an effective means of implementing an in memory semantic web triple store using the basic .NET collection classes using F#?
Are there any F# examples or projects already doing this?
There is also SemWeb which is a C# library which provides it's own SQL based Triple Store - http://razor.occams.info/code/semweb/
I'm working on a new C# library for RDF called dotNetRDF and have just released the latest Alpha http://www.dotnetrdf.org.
Here's an equivalent program to the one spoon16 showed:
open System
open VDS.RDF
open VDS.RDF.Parsing
open VDS.RDF.Query
//Get a Graph and fill it from a file
let g = new Graph()
let parser = new TurtleParser()
parser.Load(g, "test.ttl")
//Place into a Triple Store and query
let store = new TripleStore()
store.Load(g)
let results = store.ExecuteQuery("SELECT ?s ?p ?o WHERE {?s ?p ?o} LIMIT 10") :?> SparqlResultSet
//Output the results
Console.WriteLine(results.Count.ToString() ^ " Results")
for result in results.Results do
Console.WriteLine(result.ToString())
done
//Wait for user to hit enter so they can see the results
Console.ReadLine() |> ignore
My library currently supports my own SQL databases, AllegroGraph, 4store, Joseki, Sesame, Talis and Virtuoso as backing stores
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With