TinyVirtuoso

Easily embed the powerful OpenLink Virtuoso database and deploy it with your .Net/Mono application.

  • Industrial strength database in a NuGet-package
  • Database supports logical inferencing
  • Package distributed under MIT License
  • Cross-platform for .NET 3.5 / Mono 2.6

Powerful Embedded Graph Database for C#

Graph Databases allow for high performance and extremly flexible querying. Due to the schema-less nature you are free to follow a highly dynamic modelling approach. With the support of the W3C Semantic Web Standards you can discover hidden relations in your existing data by using techniques like logical inferencing. To use these databases, you usually have to deploy, configure and maintain a fully fledged database server. With TinyVirtuoso you can run one of the most powerful graph databases embedded in your .Net/Mono application, without fuss or installation.

OpenLink Virtuoso is a scalable cross-platform server that combines Relational, Graph, and Document Data Management with Web Application Server and Web Services Platform functionality. For this package we deliver a compiled binary and configuration that runs the database with a small memory footprint. TinyVirtuoso delivers the instrumentation and lets you manage it natively in C# code. To utilize it's full potential as Graph Database, combine it with our Semantic Web platform Semiodesk Trinity.

Installing

Using TinyVirtuoso in your .NET project is as easy as pie. Depending on your preferred development environment and target platform, the following two steps are all you need to integrate TinyVirtuoso into your project and deploy it on multiple platforms:

1. Install the NuGet packages

The packages are available on from the official nuget.org gallery. You can use the built-in package manager in Visual Studio to add the packages to your project. Just search for 'TinyVirtuoso'. Alternatively you can use the package management console to install the following packages:

// For deployment on Windows:
Install-Package TinyVirtuoso.win

// For deployment on Mac OS X:
Install-Package TinyVirtuoso.osx

You can add both packages if you need to deploy on both platforms.

2. Copy database files to output directory

Finally, we need to make sure that the database executable and configuration files are put into the output directory of your project. To enable this, set the 'Copy to Output Directory ' property to 'Copy always' for the following files:

 
Windows
  • TinyVirtuoso/database/virtuoso.ini
  • TinyVirtuoso/virtuoso/win/isql.exe
  • TinyVirtuoso/virtuoso/win/virtuoso-t.exe
  • TinyVirtuoso/virtuoso/win/ControlCSender.exe
Mac OS X
  • TinyVirtuoso/database/virtuoso.ini
  • TinyVirtuoso/virtuoso/osx/isql.exe
  • TinyVirtuoso/virtuoso/osx/virtuoso-t.exe

Install the NuGet packages

The packages are available on from the official nuget.org gallery. You can use the built-in package manager in Xamarin Studio to add the packages to your project. Just search for 'TinyVirtuoso'. Alternatively you can use the package management console to install the following packages:

// For deployment on Windows:
Install-Package TinyVirtuoso.win

// For deployment on Mac OS X:
Install-Package TinyVirtuoso.osx

You can add both packages if you need to deploy on both platforms.

Copy database files to output directory

Finally, we need to make sure that the database executable and configuration files are put into the output directory of your project. To enable this, set the 'Copy to Output Directory ' property to 'Copy always' for the following files:

 
Windows
  • TinyVirtuoso/database/virtuoso.ini
  • TinyVirtuoso/virtuoso/win/isql.exe
  • TinyVirtuoso/virtuoso/win/virtuoso-t.exe
  • TinyVirtuoso/virtuoso/win/ControlCSender.exe
Mac OS X
  • TinyVirtuoso/database/virtuoso.ini
  • TinyVirtuoso/virtuoso/osx/isql.exe
  • TinyVirtuoso/virtuoso/osx/virtuoso-t.exe

Getting Started

With a few lines of code you can setup your database to work in embedded mode and persist your data in an application specific folder. The following example shows the code required to get you started. Please note that you can either access TinyVirtuoso using Semiodesk Trinity or with ADO.Net to use it as a relational database. Feel free to choose which methods better fits your requirements:

// Create a new Virtuoso store in a directory named 'Data', located in your app folder.
var virtuoso = new TinyVirtuoso("Data");

// You can have multiple separate database instances which contain different data.
// This will create a directory "Data/ExampleProject" in your app directory.
var instance = virtuoso.GetOrCreateInstance("ExampleProject");

// Start the embedded database server instance.
instance.Start();

// a) You can access the store using the Semiodesk Trinity graph database API.
// Please refer to our Trinity documentation and examples for more information.
IStore store = StoreFactory.CreateStore(instance.GetTrinityConnectionString());

// b) Alternatively, you can use it with plain ADO.Net to use the relational
// database features and SQL (make sure to install OpenLink.Data.Virtuoso).
var connection = new VirtuosoConnection();
connection.ConnectionString = instance.GetAdoNetConnectionString();
connection.Connect();

// When you are done, stop the embedded database server instance.
instance.Stop();
						

License

The library and tools in this repository are all released under the terms of the MIT license. This means you can use it for all kinds of projects – including commercial ones – as long as you keep the copyright header intact. The source code, documentation and issue tracking can be found at our Bitbucket project page. If you like what we are doing and want to support us, please consider donating.

The OpenLink Virtuoso database is released under the terms of the GPL. TinyVirtuoso does not link against OpenLink Virtuoso in any way. It just provides a way to start, stop and configure the software. To download the source code of this software, check out the git repository at https://github.com/openlink/virtuoso-opensource/.

Technical Support

If you encounter problems with Semiodesk TinyVirtuoso you can use our issue tracking system. If you are interested in priority support or need some technical expertise, you can contact us under hello@semiodesk.com or through the contact page.

Documentation

Please visit our Bitbucket project page for the complete API reference and example applications.