此查询:
PREFIX pizza: <http://www.data.gov/semantic/data/alpha/1458/dataset-1458.rdf#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dgtwc: <http://data-gov.tw.rpi.edu/2009/data-gov-twc.rdf#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?chem
FROM <http://ontomatica.com/public/ontologies/dataset-1458.rdf>
WHERE {
?s dgtwc:uses_property ?chem .
FILTER (regex(STR(?chem), '.*sel.*')) .
}
生成此result
此查询:
PREFIX pizza: <http://www.data.gov/semantic/data/alpha/1458/dataset-1458.rdf#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?method
FROM <http://ontomatica.com/public/ontologies/dataset-1458.rdf>
WHERE {
?s rdfs:label ?method
FILTER regex(?method, 'selenium', 'i')
}
生成此result
对于<rdf:Description rdf:about="#entry6483">
,如何编写会产生此结果的查询?
------------------------------------------------------
| chem | method | selenium |
======================================================
| pizza:selenium | "Selenium (mcg/100 g)" | 9 |
------------------------------------------------------
答案 0 :(得分:2)
说明你有entryno“entry6483”
怎么样
PREFIX pizza: <http://www.data.gov/semantic/data/alpha/1458/dataset-1458.rdf#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dgtwc: <http://data-gov.tw.rpi.edu/2009/data-gov-twc.rdf#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?chem ?method ?selenium
FROM <http://ontomatica.com/public/ontologies/dataset-1458.rdf>
WHERE {
pizza:entry6483 ?chem ?selenium .
?chem rdfs:label ?method .
FILTER regex(?method, 'selenium', 'i')
}
不确定这是否是您要找的!