Last active
December 26, 2015 23:28
-
-
Save rvesse/7230407 to your computer and use it in GitHub Desktop.
Issuing a parameterised SPARQL query to Stardog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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