注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

阿弥陀佛

街树飘影未见尘 潭月潜水了无声 般若观照心空静...

 
 
 

日志

 
 
关于我

一直从事气象预报、服务建模实践应用。 注重气象物理场、实况场、地理信息、本体知识库、分布式气象内容管理系统建立。 对Barnes客观分析, 小波,计算神经网络、信任传播、贝叶斯推理、专家系统、网络本体语言有一定体会。 一直使用Java、Delphi、Prolog、SQL编程。

网易考拉推荐

SPARQL-DL 学习参考  

2012-03-21 22:20:33|  分类: OWL |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
SPARQL Query website
SPARQL

SparQL with OWL API 3

SparQL-DL是W3C的SparQL的子集。以OWL-DL为基础的特征,使其命名为SparQL-DL


SPARQL-DL Examples

This page provides some examples of queries supported by our SPARQL-DL implementation. More examples can be found in the distribution package.

Get all classes:

   SELECT ?c WHERE { Class(?c) }

Ask whether class A is a direct subclass of B:

   PREFIX ex: <http://example.com#>
ASK { DirectSubClassOf(ex:A, ex:B) }

Get all fillers of transitive properties of a given individual:

   SELECT ?x
WHERE { Transitive(?p),
PropertyValue(<http://example.com#myClass>, ?p, ?x) }

Get the complete class hierarchy by means of direct class/sub-class pairs:

   SELECT ?a ?b
WHERE { DirectSubClassOf(?a, ?b) }

Get union of individuals of two separate classes:

   PREFIX wine: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>
SELECT ?i
WHERE { Type(?i, wine:PinotBlanc) }
OR WHERE { Type(?i, wine:DryRedWine) }

----------------------------------------------------------------------------------------------------------------------------------------------

SPARQL-DL Syntax

Our variant of the SPARQL-DL language is fully aligned to OWL 2.

Query Types

SPARQL-DL supports two different types of queries: ASK and SELECT. An ASK-query returns a Boolean result whereas a SELECT-query returns all possible bindings of the provided variables.

ASK-queries:

   ASK { [comma-separated list of atoms] }

SELECT-queries:

   SELECT [DISTINCT] [space-separated list of variables]
[WHERE] { [comma-separated list of atoms] }
[OR WHERE { [comma-separated list of atoms] }]*

As within SPARQL, the DISTINCT keyword removes automatically all redundant bindings within the result set.

Primitives

In SPARQL-DL there are 3 different primitives for usage within query atoms: variables, URIs and literals. They have to follow the following syntax rules:

  • Variable: ?[a-zA-Z]+ (for example ?a, ?myVar)
  • Full IRI: <http://example.com>
  • Prefixed IRI: [the prefix]:[the suffix]
  • Literal: "this is a literal" (escape the character " inside a literal with \")

Prefixes

SPARQL-DL supports prefixes simmilar to those defined in SPARQL. Put the PREFIX definitions at the beginning of your SPARQL-DL-query:

   PREFIX [some prefix]: <[some URI]>
PREFIX ...
...

OR WHERE

SPARQL-DL supports union-like statements called "OR WHERE". The results of the different where clauses are concatenated to one result.

   ...
WHERE { ... }
OR WHERE { ... }
OR WHERE { ... }
...
  评论这张
 
阅读(990)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017