http://dbpedia.org/resource/Los_Angeles
您可以使用HTTP请求中的相应标头以多种格式以编程方式请求此数据.
例如,"Accept:application/json"将以JSON的形式获得结果.
1.我如何去检索JSON
2.因为我必须只过滤
一个类="uri"href ="http://www.w3.org/2000/01/rdf-schema#label"
大约100我页面上的链接.什么是最好的方式
Jos*_*lor 10
您可以检索JSON,而无需通过简单的请求创建特殊标头
如果您只对rdfs:label实体的s 感兴趣,可以使用模板请求URL查询端点:
http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=select*%7Bdbpedia%3ALos_Angeles+rdfs%3Alabel+%3Flabel%7D&format=json
Run Code Online (Sandbox Code Playgroud)
它对应于查询
select*{dbpedia:Los_Angeles rdfs:label ?label}
Run Code Online (Sandbox Code Playgroud)
它生成JSON:
{ "head": { "link": [], "vars": ["label"] },
"results": { "distinct": false, "ordered": true, "bindings": [
{ "label": { "type": "literal", "xml:lang": "uk", "value": "\u041B\u043E\u0441-\u0410\u043D\u0434\u0436\u0435\u043B\u0435\u0441" }},
{ "label": { "type": "literal", "xml:lang": "vi", "value": "Los Angeles" }},
{ "label": { "type": "literal", "xml:lang": "zh", "value": "\u6D1B\u6749\u77F6" }},
{ "label": { "type": "literal", "xml:lang": "ca", "value": "Los Angeles" }},
{ "label": { "type": "literal", "xml:lang": "cs", "value": "Los Angeles" }},
{ "label": { "type": "literal", "xml:lang": "de", "value": "Los Angeles" }},
{ "label": { "type": "literal", "xml:lang": "en", "value": "Los Angeles" }} ] } }
Run Code Online (Sandbox Code Playgroud)