2017-08-30 25 views
1

我想从British Museum database获取由烧制粘土(材料)制成的圆柱体(对象类型)的URI。 经过一段时间没有结果我自己测试程序后,我得到了两个同事的建议,但都没有成功。 有谁知道如何成功地把这样做的查询?通过基于2个过滤器的URI的SPARQL端点对象

PREFIX skos: <http://www.w3.org/2004/02/skos/core#> 
PREFIX crm: <http://erlangen-crm.org/current/> 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
SELECT ?object 
WHERE { 
    ?object crm:P2_has_type ?objecttype. 
    ?objecttype skos:prefLabel "cylinder".        
    ?object crm:P45_consists_of ?materialid.      
    ?materialid skos:prefLabel "fired clay". 
} 

PREFIX skos: <http://www.w3.org/2004/02/skos/core#> 
PREFIX thes: <http://collection.britishmuseum.org/id/thesauri/> 
PREFIX rso: <http://www.researchspace.org/ontology/> 
SELECT ?cylinder 
WHERE { 
?cylinder rso:PX_object_type thes:x5597. 
?fired_clay rso:PX_display_wrap thes:x41443. 
} 

回答

2

例如,

SELECT * 
WHERE { 
    ?object rso:Thing_has_type_Concept ?type . 
    ?type skos:prefLabel "cylinder" . 
    ?object rso:Thing_has_material_type_Concept ?material . 
    ?material skos:prefLabel "fired clay" . 
} LIMIT 100 

SELECT * 
WHERE { 
    ?object rso:Thing_has_type_Concept thes:x6329 . 
    ?object rso:Thing_has_material_type_Concept thes:x41443 . 
} LIMIT 100 

事实上,有许多瓦特ays做你想做的事,因为存在许多同义特性。
试试这个 “metaquery”:

SELECT ?object 
WHERE { 
    ?object rso:PX_display_wrap "Object type :: cylinder ::" . 
    ?object rso:PX_display_wrap "Consists of :: fired clay ::" . 
} 

SELECT DISTINCT ?type_property ?material_property 
WHERE { 
    VALUES (?object) {(<http://collection.britishmuseum.org/id/object/WCT20849>)} 
    ?object ?type_property ?type . 
    ?type skos:prefLabel "cylinder" . 
    ?object ?material_property ?material . 
    ?material skos:prefLabel "fired clay" . 
} 

对于rso:PX_display_wrap财产,它可以以这种方式使用