Quantcast
Channel: C#タグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 8895

dbpediaの研究 その23

$
0
0

概要

dbpediaが難解なので、手出してみる。
c#で、取得してみた。

サンプルコード

public class Hello {
    public static void Main() {
        string url = "http://ja.dbpedia.org/sparql";
        System.Net.WebClient wc = new System.Net.WebClient();
        System.Collections.Specialized.NameValueCollection ps = new System.Collections.Specialized.NameValueCollection();
        ps.Add("query", "SELECT DISTINCT * WHERE { dbpedia-ja:デ・トマソ dbpedia-owl:abstract ?abstract .}");
        byte[] resData = wc.UploadValues(url, ps);
        wc.Dispose();
        string resText = System.Text.Encoding.UTF8.GetString(resData);
        System.Console.WriteLine(resText);
        System.Console.WriteLine("Hello C#");
    }
}

成果物

https://paiza.io/projects/CFao5m4qT2fueQcyYNhX4Q

以上。


Viewing all articles
Browse latest Browse all 8895

Trending Articles