2017-08-30 59 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財產,它可以以這種方式使用