The Stardog .NET examples show how you can use .NET code to connect to a Stardog server, manage Stardog databases and query them.
- C# development environment (e.g., Visual Studio Community, Visual Studio for Mac, Visual Studio Code, .NET Core SDK, etc.)
In Visual Studio, select the example project you want to run as the Startup Project. Build the project and run the resulting program. The program will connect to Stardog and run several queries and print the results to STDOUT.
This example project demonstrates how to connect to a Stardog server using Stardog's HTTP API and list, create, and drop databases.
This example project demonstrates how to connect to a Stardog server using dotNetRDF and list, create, and drop databases; how to insert triples into a graph and query a graph using SPARQL.
This example project demonstrates how to connect to a Stardog server using TrinityRDF and execute queries using SPARQL and LINQ.
TrinityRDF provides an object mapper layer similar to Entity Framework for RDF data. The ontologies the sample uses can be found in the solution's Ontologies/
folder. Trinity RDF discovers the ontologies in the solution's ontologies.config
file. TrinityRDF uses the ontologies to generate mapping code - Ontologies/Ontologies.g.cs
. A developer uses this generated code to create object models (see the files under the solution's ObjectModels/
folder) with annotations that connect the C# object to the RDF data. These object models then allow .NET developers to create powerful applications without the need to learn SPARQL!
- Stardog with a database named "music" populated the data from
./examples/dotnet/TrinityConsoleSample/Ontologies/music_schema.ttl
andmusic.ttl.gz
in a named graph calledhttp://stardog.com/tutorial