Skip to content

Instantly share code, notes, and snippets.

@rvesse
Last active December 26, 2015 23:28
Show Gist options
  • Save rvesse/7230407 to your computer and use it in GitHub Desktop.
Save rvesse/7230407 to your computer and use it in GitHub Desktop.
Issuing a parameterised SPARQL query to Stardog
// Assume we have a StardogConnector in the variable stardog
// Create the query
SparqlParameterizedString queryString = new SparqlParameterizedString();
queryString.CommandText = @"SELECT * WHERE
{
?s a @type .
}";
// Set the parameter
queryString.SetUri("type", new Uri("http://example.org/myType"));
// Issue the query
SparqlResultSet results = stardog.Query(queryString.ToString()) as SparqlResultSet;
// Now work with the results as desired...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment