如何显示数据的属性标签?我在为dbpedia本体工作,
我想做一个sparql查询,下面是我的示例查询.这个结果混淆了数据类型或对象类型,我想数据类型属性名称.
SELECT ?p ?pLabel ?domain ?range
{
?p rdfs:domain http://dbpedia.org/ontology/Person> .
}
ex:以下是数据类型示例,但我不能只选择数据类型,我想显示类型名称.
"chat"
'chat'@fr with language tag "fr"
"xyz"^^<http://example.org/ns/userDatatype>
"abc"^^appNS:appDataType
'''The librarian said, "Perhaps you would enjoy 'War and Peace'."'''
1, which is the same as "1"^^xsd:integer
1.3, which is the same as "1.3"^^xsd:decimal
1.300, which is the same as "1.300"^^xsd:decimal
1.0e6, which is the same as "1.0e6"^^xsd:double
true, which is the same as "true"^^xsd:boolean
false, which is the same as "false"^^xsd:boolean
expect to result
Run Code Online (Sandbox Code Playgroud)
期望结果(仅数据类型)
typename <- field name
string <- type name
int
boolean
int
double
boolean
Run Code Online (Sandbox Code Playgroud)
如何进行sparql查询?
为此目的使用函数datatype().例如:
select distinct ?y datatype(?z)
{
?x a <http://dbpedia.org/class/yago/JeskolaBuzzUsers>.
?x ?y ?z.
filter (datatype(?z) != '')
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6326 次 |
| 最近记录: |