本文整理汇总了C#中IBrightstarService.ExecuteQuery方法的典型用法代码示例。如果您正苦于以下问题:C# IBrightstarService.ExecuteQuery方法的具体用法?C# IBrightstarService.ExecuteQuery怎么用?C# IBrightstarService.ExecuteQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IBrightstarService
的用法示例。
在下文中一共展示了IBrightstarService.ExecuteQuery方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssertTriplePatternInGraph
public static void AssertTriplePatternInGraph(IBrightstarService client, string storeName, string triplePattern,
string graphUri)
{
var sparql = "ASK { GRAPH <" + graphUri + "> {" + triplePattern + "}}";
var resultsDoc = XDocument.Load(client.ExecuteQuery(storeName, sparql));
Assert.IsTrue(resultsDoc.SparqlBooleanResult());
}
示例2: AssertTriplePatternNotInDefaultGraph
public static void AssertTriplePatternNotInDefaultGraph(IBrightstarService client, string storeName,
string triplePattern)
{
var sparql = "ASK {{" + triplePattern + "}}";
var resultsDoc = XDocument.Load(client.ExecuteQuery(storeName, sparql));
Assert.IsFalse(resultsDoc.SparqlBooleanResult());
}
示例3: QueryCommitPoint
private static void QueryCommitPoint(IBrightstarService client, ICommitPointInfo commitPointInfo)
{
const string sparqlQuery =
"SELECT ?l WHERE { ?s <http://www.w3.org/2000/01/rdf-schema#label> ?l } ORDER BY ?l";
var resultsStream = client.ExecuteQuery(commitPointInfo, sparqlQuery);
var resultsDoc = XDocument.Load(resultsStream);
var labels = new List<string>();
foreach(var row in resultsDoc.SparqlResultRows())
{
labels.Add(row.GetColumnValue("l").ToString());
}
Console.WriteLine("Query returns: {0}", string.Join(", ",labels));
}