Using F # for a semantic network implementing in triple memory stores

What is an effective means of implementing semantic network storage in memory using the .NET collection base classes using F #?

Are there any other examples or projects of F #?

+3
source share
5 answers

There is also SemWeb, which is a C # library that provides its own SQL-based Triple Store - http://razor.occams.info/code/semweb/

I am working on a new C # library for RDF called dotNetRDF and have just released the latest Alpha http://www.dotnetrdf.org .

16 :

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

SQL, AllegroGraph, 4store, Joseki, Sesame, Talis Virtuoso .

+4

LinqToRdf, , , VS.NET, LINQ round- :

var ctx = new MusicDataContext(@"http://localhost/linqtordf/SparqlQuery.aspx");
var q = (from t in ctx.Tracks
     where t.Year == "2006" &&
           t.GenreName == "History 5 | Fall 2006 | UC Berkeley"
     orderby t.FileLocation
     select new {t.Title, t.FileLocation}).Skip(10).Take(5);

foreach (var track in q)
{
   Console.WriteLine(track.Title + ": " + track.FileLocation);
} 
+2

Intellidimension .NET Semantics SDK. /, .

# PowerShell, .

//disclaimer: really the first time I have used F# so this may not be any good...
//but it does work

open Intellidimension.Rdf
open System.IO

let rdfXml = File.ReadAllText(@"C:\ontology.owl")
let gds = new GraphDataSource()
gds.Read(rdfXml) |> ignore
let tbl = gds.Query("select ?s ?p ?o where {?s ?p ?o} limit 10")

System.Console.Write(tbl.RowCount)
System.Console.ReadLine() |> ignore
+1

Source: https://habr.com/ru/post/1717021/


All Articles