asp.net-mvcpowershellvirtuosodotnetrdf

Run virtuoso ISQL commands in .Net application for importing data


I'd like to import (or automate the import function in Virtuoso) some RDF files on a .Net application to my local Virtuoso by using some commands in ISQL workspace.

The commands in PowerShell are:

>ISQL 
    >ld_dir_all('PATH', '*.rdf', 'ONTOLOGY'); 
    >set isolation='uncommitted'; 
    >rdf_loader_run();

It means that, the isql command must finished and then I have to run the next.

I've tried to use PowerShellInstance in .net but when I combine all commands in this form : PowerShellInstance.AddScript("ISQL;ld_dir_all('PATH', '*.rdf', 'ONTOLOGY');set isolation='uncommitted';rdf_loader_run();"); there is an error.

So I need your help or ideas for automation import data to Virtuoso in .Net application. (Maybe there will a solution in dotNetRDF!)


Solution

  • Your combined command is telling PowerShell to execute 4 commands on the OS commandline. Instead, you need to tell PowerShell to run iSQL, which must then be told to execute 3 statements.

    Note that none of these statements is iSQL-specific; you're just executing them through iSQL. You can actually execute these statements through any data connection to Virtuoso, including ADO.NET (or ODBC, JDBC, etc.). I do not have specific advice for doing so with dotNetRDF.