123456789101112131415161718192021222324252627 |
- using System;
- using VDS.RDF.Query;
-
- namespace WebApiWebSem.DataAccess
- {
- public class DbPediaDataAccess
- {
- public void Query(string query)
- {
- var endpoint = new SparqlRemoteEndpoint(new Uri("http://dbpedia.org/sparql"), "http://dbpedia.org");
-
- //Make a SELECT query against the Endpoint
- var results = endpoint.QueryWithResultSet("SELECT DISTINCT ?Concept WHERE {[] a ?Concept} LIMIT 10");
- foreach (SparqlResult result in results)
- {
- Console.WriteLine(result.ToString());
- }
-
- //Make a DESCRIBE query against the Endpoint
- // var g = endpoint.QueryWithResultGraph("DESCRIBE ");
- // foreach (var t in g.Triples)
- // {
- // Console.WriteLine(t.ToString());
- // }
- }
- }
- }
|