2012-10-12 2 views
0

변형 된 DBPEdia를 사용하여 Person의 이름을 추출해야합니다. 내 SPARQL 요청 :DBPedia Person 데이터 세트

select distinct ?o where { 
    { ?instance <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>; 
    <http://xmlns.com/foaf/0.1/name> ?o } 
    union 
     { 
     ?instance <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>; 
     rdfs:label 
     } 
    FILTER (langMatches(lang(?o),"en"))} 

DBPedia이 SRARQL 요청을 통해 50 000의 이름을 반환합니다.

모든 이름 변형을 가진 사람의 데이터 세트가 존재할 수 있습니까?

기존의 persons.en.nt 데이터 세트에는 foaf : 이름 만 포함되어 있지만 다른 이름의 변형이 필요합니다. 때로는 rdfs : label에 나열되는 경우도 있습니다 (예 : Maria Sharapova의 경우).

답변

0

다른 게시물의 답변을 찾았습니다. 자바 프로그램에 있으며이 프로그램

SELECT ?o WHERE { 
{ 
    select distinct ?o 
    where { 
      ?instance <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person>; 
      rdfs:label ?o 
      FILTER (langMatches(lang(?o),"en")) 
      } 
    ORDER BY ASC(?o) 
    } 
} OFFSET 800000 LIMIT 50000 

:

Query query = QueryFactory.create(queryString); 
    QueryExecution qexec = QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql", query); 
다음 SPARQL을 실행