2012-03-09 75 views
4

本頁面中的代碼:http://thedatahub.org/dataset/dbpedia我可以找到有關dbpedia的信息,例如sparql endpoint等。我應該在哪裏以及如何要求提供所有rdf文件以提及有關柏林的情況?如何從dbpedia中獲取關於berlin的所有rdf文件

+1

的重複不足關於answers.semanticweb.com的問題:http://answers.semanticweb.com/questions/15095/is-possible-to-get-all-rdf-file-where-is-metion-something-about-berlin。那裏有幾條相關的評論和答案。 – 2012-03-11 20:58:43

回答

2

爲了得到一切與柏林RDF你可能得寫,包括regexs自己SPARQL(構建)查詢,但讓所有的三元組直接爲特色的資源:

http://dbpedia.org/resource/Berlin

你可以去那個網址(它會將你重定向到http://dbpedia.org/page/Berlin這是柏林),並在頁面的底部是各種格式的數據鏈接。

PS。 OK,下面是抓住一個選擇版本的文字提到了「柏林」:

SELECT DISTINCT ?s ?p ?o WHERE { 
    ?s ?p ?o . 
    FILTER regex(?o, 'berlin', 'i') 
} 

這可能會產生太多結果/超時,所以你可能要與已知屬性,以取代P(像抽象的,不是?確定dbPedia術語是什麼)。爲了讓輸出RDF你調整它的東西這種形狀:

CONSTRUCT { ?s ?p ?o } WHERE { 
    ?s ?p ?o . 
    FILTER regex(?o, 'berlin', 'i') 
} 
+0

好吧,當我在尋找柏林抽象?我可以構建這個選擇嗎? – hudi 2012-03-12 00:45:48

+0

我不建議使用那個帶有正則表達式的查詢,你會對dbpedia中的每一個字面值執行一個正則表達式,這可能非常昂貴。 – Michael 2012-04-06 16:54:29

0

您可以查看DBPedia文檔的examples section

+0

我看過這個,但我沒有在這裏找到答案在我的問題 – hudi 2012-03-09 21:32:40

1

你最好要麼做什麼丹哈建議瓦特/下載數據關閉的頁面,或者試圖

describe <http://dbpedia.org/resource/Berlin> 

construct { 
    <http://dbpedia.org/resource/Berlin> ?p ?o . 
    ?s ?p2 <http://dbpedia.org/resource/Berlin>. 
} 
where { 
    { <http://dbpedia.org/resource/Berlin> ?p ?o } 
    union 
    { ?s ?p2 <http://dbpedia.org/resource/Berlin> } 
} 

後者查詢就足夠了,如果從描述的結果是

相關問題