#  CBDB Linked Open Data 

 



 ##  

  expand\_more  

 
  

 

### CBDB 關聯數據由上海圖書館開發並長期維護

鏈接: <https://cbdb.library.sh.cn/sparqled>

WebVOWL: <http://www.usources.cn/webvowl/#opts=editorMode=true;#iri=http://www.usources.cn/ont/ontology/visont?g=http://ont.library.sh.cn/graph/cbdb>

以下是 SPARQL 查詢的例子，您可以在 CBDB 關聯數據查詢頁面中嘗試，或將其修改成符合您需要的查詢條件：

### **CBDB 人物卒年**

PREFIX foaf: &lt;[http://xmlns.com/foaf/0.1/&amp;gt](http://xmlns.com/foaf/0.1/&gt);  
PREFIX xsd: &lt;[http://www.w3.org/2001/XMLSchema#&amp;gt](http://www.w3.org/2001/XMLSchema#&gt);  
PREFIX rdfs: &lt;[http://www.w3.org/2000/01/rdf-schema#&amp;gt](http://www.w3.org/2000/01/rdf-schema#&gt);  
PREFIX shlib: &lt;[http://www.library.sh.cn/ontology/&amp;gt](http://www.library.sh.cn/ontology/&gt);  
SELECT ?age  
FROM &lt;[http://lod.library.sh.cn/graph/cbdb&amp;gt](http://lod.library.sh.cn/graph/cbdb&gt);  
WHERE {  
 ?s shlib:deathAge ?age.  
 filter (?age != '490' &amp;&amp; ?age != '0').  
} order by asc(xsd:int(?age))

### **CBDB 女性人物卒年**

PREFIX foaf: &lt;[http://xmlns.com/foaf/0.1/&amp;gt](http://xmlns.com/foaf/0.1/&gt);  
PREFIX xsd: &lt;[http://www.w3.org/2001/XMLSchema#&amp;gt](http://www.w3.org/2001/XMLSchema#&gt);  
PREFIX rdfs: &lt;[http://www.w3.org/2000/01/rdf-schema#&amp;gt](http://www.w3.org/2000/01/rdf-schema#&gt);  
PREFIX shlib: &lt;[http://www.library.sh.cn/ontology/&amp;gt](http://www.library.sh.cn/ontology/&gt);  
SELECT ?age   
FROM &lt;[http://lod.library.sh.cn/graph/cbdb&gt;&amp;nbsp](http://lod.library.sh.cn/graph/cbdb>&nbsp);  
WHERE {  
 ?s shlib:deathAge ?age ; foaf:gender '女' .  
 filter (?age != '0')  
} order by asc(xsd:int(?age))

### **唐代最常見的前十種姓氏**

PREFIX bf: &lt;[http://id.loc.gov/ontologies/bibframe/&amp;gt](http://id.loc.gov/ontologies/bibframe/&gt);  
PREFIX shlib: &lt;[http://www.library.sh.cn/ontology/&amp;gt](http://www.library.sh.cn/ontology/&gt);  
PREFIX foaf: &lt;[http://xmlns.com/foaf/0.1/&amp;gt](http://xmlns.com/foaf/0.1/&gt);  
PREFIX dc: &lt;[http://purl.org/dc/elements/1.1/&amp;gt](http://purl.org/dc/elements/1.1/&gt);  
PREFIX owl: &lt;[http://www.w3.org/2002/07/owl#&amp;gt](http://www.w3.org/2002/07/owl#&gt);  
SELECT DISTINCT ?surname (COUNT(DISTINCT ?sub) AS ?count)  
FROM &lt;[http://lod.library.sh.cn/graph/cbdb&gt;&amp;nbsp](http://lod.library.sh.cn/graph/cbdb>&nbsp);  
WHERE {  
 ?sub shlib:temporal/shlib:dynasty '唐'@cht ;  
 shlib:familyName/bf:label ?surname.  
 filter (lang(?surname) = 'chs')  
} group by ?surname order by desc(2) limit 10

### **唐代傳記地址為劍南道人物的社會網絡關係**

PREFIX bf: &lt;[http://id.loc.gov/ontologies/bibframe/&amp;gt](http://id.loc.gov/ontologies/bibframe/&gt);  
PREFIX rdfs: &lt;[http://www.w3.org/2000/01/rdf-schema#&amp;gt](http://www.w3.org/2000/01/rdf-schema#&gt);  
PREFIX dct: &lt;[http://purl.org/dc/terms/&amp;gt](http://purl.org/dc/terms/&gt);  
PREFIX shl: &lt;[http://www.library.sh.cn/ontology/&amp;gt](http://www.library.sh.cn/ontology/&gt);  
PREFIX foaf: &lt;[http://xmlns.com/foaf/0.1/&amp;gt](http://xmlns.com/foaf/0.1/&gt);  
PREFIX dc: &lt;[http://purl.org/dc/elements/1.1/&amp;gt](http://purl.org/dc/elements/1.1/&gt);  
PREFIX owl: &lt;[http://www.w3.org/2002/07/owl#&amp;gt](http://www.w3.org/2002/07/owl#&gt);  
select ?personUri ?personId ?personName ?personAddr ?assoUri ?assoId ?assoName ?assoAddr ?relation   
from &lt;[http://lod.library.sh.cn/graph/cbdb&gt;&amp;nbsp](http://lod.library.sh.cn/graph/cbdb>&nbsp);  
from &lt;[http://lod.library.sh.cn/graph/place&gt;&amp;nbsp](http://lod.library.sh.cn/graph/place>&nbsp);  
where {  
?rel shl:relationSubject ?personUri ; shl:relationObject ?assoUri; shl:relationType ?relation ; shl:specialRelationType "社会关系".  
?personUri a shl:Person ; foaf:name ?personName ; shl:place ?uri ; shl:identifiedBy ?id. ?uri owl:sameAs ?place . ?id dc:source 'CBDB'; rdfs:label ?personId .   
?place a shl:Place; bf:label ?personAddr ; dct:isPartOf\* ?part. ?part bf:label ?label .  
filter (bif:contains(?label, '"劍南道"') || bif:contains(?personAddr, '"劍南道"'))  
filter (lang(?personAddr) = "cht")  
filter (lang(?personName) = "cht")  
?assoUri a shl:Person; foaf:name ?assoName ; shl:place ?uri1; shl:identifiedBy ?id1. ?id1 dc:source 'CBDB'; rdfs:label ?assoId . ?uri1 owl:sameAs/bf:label ?assoAddr .   
filter (lang(?assoAddr) = "cht")  
filter (lang(?assoName) = "cht")  
}