我想使用这个端点查询 DBLP 数据库:
http://dblp.l3s.de/d2r/snorql/
我的代码片段:
String st = "";
String qry = "";
String uri_V;
String dguri_V;
uri_V = "http://dbpedia.org/sparql";
dguri_V = "http://dbpedia.org";
// Modify if need......
//String ns = "\""+TextBox1.Text.ToString()+"\"";
// String qry = "SELECT DISTINCT ?name WHERE { ?person foaf:name ?name.FILTER regex(str(?name),"+ns+").}";
if (radiosrch.SelectedIndex == 0)
{
qry = "SELECT ?title WHERE {?game <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category:First-person_shooters> .?game foaf:name ?title .}ORDER by ?title";
}
else// if (radiosrch.SelectedIndex == 1)
{
// qry= "query for publisher."
qry = "SELECT DISTINCT ?Concept WHERE {[] a ?Concept} LIMIT 10";
}
//Common
SparqlRemoteEndpoint endpoint = new SparqlRemoteEndpoint(new Uri(uri_V), dguri_V);
SparqlResultSet results = endpoint.QueryWithResultSet(qry);
foreach (SparqlResult result in results)
{
Console.WriteLine(result.ToString());
st = st + result.ToString() + "\n";
}
TextBox3.Text = st.ToString();
它适用于 dbpedia,但我找不到uri_v
,dguri_v
来使用端点查询 DBLP 数据库。