基于2个过滤器的URI的SPARQL端点对象

时间:2017-08-30 10:42:29

标签: sparql

我正在尝试从British Museum database获取由烧制粘土(材料)制成的圆柱体(对象类型)的URI。 在我自己测试了一段时间没有结果的程序之后,我得到了同事的两条建议,但是都不起作用。 有谁知道如何成功地放入执行此操作的查询?

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.
}

1 个答案:

答案 0 :(得分: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

事实上,有很多方法可以做你想要的,因为有很多同义属性 试试这个&#34; metaquery&#34;:

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属性,可以这样使用:

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