以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 Semantic Web(语义Web)/描述逻辑/本体 』  (http://bbs.xml.org.cn/list.asp?boardid=2)
----  请教:Ask,Describe,construct,select各表示怎样的查询?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=2&rootid=&id=27416)


--  作者:tigerabbit
--  发布时间:2/18/2006 10:30:00 PM

--  请教:Ask,Describe,construct,select各表示怎样的查询?
小弟在学习sparql时,遇到题目所示的四种查询,不知道它们的确切含义是怎样,网上也没有搜到相关的介绍资料,请高手指点迷津,谢谢!
--  作者:jpz6311whu
--  发布时间:2/18/2006 10:34:00 PM

--  
SPARQL has 4 result forms:

SELECT – Return a table of results.
CONSTRUCT – Return an RDF graph, based on a template in the query.
DESCRIBE – Return an RDF graph, based on what the query processor is configured to return.
ASK – Ask a boolean query.
The SELECT form directly returns a table of solutions as a result set, while DESCRIBE and CONSTRUCT use the outcome of matching to build RDF graphs.


--  作者:jpz6311whu
--  发布时间:2/18/2006 10:34:00 PM

--  
SELECT
The SELECT result form is a projection, with DISTINCT applied, of the solution set. SELECT identifies which named variables are in the result set.  This may be "*" meaning "all named variables" (blank nodes in the query act like variables for matching but are never returned).

CONSTRUCT
CONSTRUCT builds an RDF based on a graph template.  The graph template can have variables which are bound by a WHERE clause.  The effect is to calculate the graph fragment, given the template, for each solution from the WHERE clause, after taking into account any solution modifiers. The graph fragments, one per solution, are merged into a single RDF graph which is the result.

Any blank nodes explicitly mentioned in the graph template are created afresh for each time the template is used for a solution.

DESCRIBE
The CONSTRUCT form, takes an application template for the graph results. The DESCRIBE form also creates a graph but the form of that graph is provided the query processor, not the application. For each URI found, or explicitly mentioned in the DESCRIBE clause, the query processor should provide a useful fragment of RDF, such as all the known details of a book. ARQ allows domain-specific description handlers to be written.

ASK
The ASK result form returns a boolean, true of the pattern matched otherwise false.


--  作者:tigerabbit
--  发布时间:2/18/2006 10:48:00 PM

--  
谢谢jpz6311whu的提示,我找到了教程中的相关章节。教程中该部分写的真简洁阿,也没有相关例子,不知道具体查询形式是怎样的,不知道W3C有没有出过更详细的用法说明?
--  作者:tigerabbit
--  发布时间:2/18/2006 10:59:00 PM

--  
察看了一下W3C的文档,总算找到相关的说明,贴在这里,与同道中人分享
http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/#ask
http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/#construct
http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/#select
http://www.w3.org/TR/2005/WD-rdf-sparql-query-20051123/#describe


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
39.063ms