我想查询我的本体论基础上使用float和字符串的数据类型注释。 比如我有一个具有float类型和String类型的注释“标签”的注释“EBC_value”的个人。
我该怎么做呢? 我曾尝试用正则表达式,像这样的,但它doesn't工作。 我不得到任何错误,只是没有结果。
PREFIX ont: <http://vestbrygg.no/ontologies/beer.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?title
WHERE { ?x ont:title ?title
FILTER regex(?title, "Sack")
}
希望你们可以帮忙。 Thanks.And是啊,除非你想看到和测试整个本体,为注释代码是这样的:
<NamedIndividual rdf:about="&beer;Base_malt_-_Best_Malz">
<rdf:type rdf:resource="&beer;Light"/>
<beer:EBC_value rdf:datatype="&xsd;float"></beer:EBC_value>
<beer:Label rdf:datatype="&xsd;string">Sack</beer:Label>
</NamedIndividual>