大师 rdfs 规则集

发布于 2024-12-21 22:47:26 字数 2742 浏览 2 评论 0原文

我正在尝试以下示例 http://docs.openlinksw.com/virtuoso/rdfsparqlrule.html< /a>.
将数据加载到图中:

ttlp ('<http://localhost:8890/dataspace> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/ns#Space> . 
<http://localhost:8890/dataspace/test2/weblog/test2tWeblog> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/types#Weblog> . 
<http://localhost:8890/dataspace/discussion/oWiki-test1Wiki> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/types#MessageBoard> . 
<http://localhost:8890/dataspace> <http://rdfs.org/sioc/ns#link> <http://localhost:8890/ods> . 
<http://localhost:8890/dataspace/test2/weblog/test2tWeblog> <http://rdfs.org/sioc/ns#link> <http://localhost:8890/dataspace/test2/weblog/test2tWeblog> . 
<http://localhost:8890/dataspace/discussion/oWiki-test1Wiki> <http://rdfs.org/sioc/ns#link> <http://localhost:8890/dataspace/discussion/oWiki-test1Wiki> .
', '', 'http://localhost:8890/test');

有关子类和子属性的断言:

ttlp (' @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . 
<http://rdfs.org/sioc/ns#Space> rdfs:subClassOf <http://www.w3.org/2000/01/rdf-schema#Resource> . 
<http://rdfs.org/sioc/ns#Container> rdfs:subClassOf <http://rdfs.org/sioc/ns#Space> . 
<http://rdfs.org/sioc/ns#Forum> rdfs:subClassOf <http://rdfs.org/sioc/ns#Container> . 
<http://rdfs.org/sioc/types#Weblog> rdfs:subClassOf <http://rdfs.org/sioc/ns#Forum> . 
<http://rdfs.org/sioc/types#MessageBoard> rdfs:subClassOf <http://rdfs.org/sioc/ns#Forum> . 
<http://rdfs.org/sioc/ns#link> rdfs:subPropertyOf <http://rdfs.org/sioc/ns> . ', 
'', 'http://localhost:8890/schema/test');

定义规则:

rdfs_rule_set ('http://localhost:8890/schema/property_rules1', 'http://localhost:8890/schema/test');

执行查询:

define input:inference "http://localhost:8890/schema/property_rules1" 
SELECT ?s FROM <http://localhost:8890/test> 
WHERE {?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>  <http://rdfs.org/sioc/ns#Space> };

这仅给我 1 个结果行 - http://localhost:8890/dataspace
虽然我应该得到 3 行:

  • http://localhost:8890/dataspace/test2/weblog/test2tWeblog
  • http://localhost:8890/dataspace/discussion/oWiki-test1Wiki
  • http://localhost:8890/dataspace

谁能告诉我我在这里做错了什么。 dba 是否需要授予 rdfs_rule_set 任何权限? 多谢。

I was trying the following example from http://docs.openlinksw.com/virtuoso/rdfsparqlrule.html.
Loaded data into the graph:

ttlp ('<http://localhost:8890/dataspace> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/ns#Space> . 
<http://localhost:8890/dataspace/test2/weblog/test2tWeblog> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/types#Weblog> . 
<http://localhost:8890/dataspace/discussion/oWiki-test1Wiki> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://rdfs.org/sioc/types#MessageBoard> . 
<http://localhost:8890/dataspace> <http://rdfs.org/sioc/ns#link> <http://localhost:8890/ods> . 
<http://localhost:8890/dataspace/test2/weblog/test2tWeblog> <http://rdfs.org/sioc/ns#link> <http://localhost:8890/dataspace/test2/weblog/test2tWeblog> . 
<http://localhost:8890/dataspace/discussion/oWiki-test1Wiki> <http://rdfs.org/sioc/ns#link> <http://localhost:8890/dataspace/discussion/oWiki-test1Wiki> .
', '', 'http://localhost:8890/test');

Assertions about subclasses and subproperties:

ttlp (' @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . 
<http://rdfs.org/sioc/ns#Space> rdfs:subClassOf <http://www.w3.org/2000/01/rdf-schema#Resource> . 
<http://rdfs.org/sioc/ns#Container> rdfs:subClassOf <http://rdfs.org/sioc/ns#Space> . 
<http://rdfs.org/sioc/ns#Forum> rdfs:subClassOf <http://rdfs.org/sioc/ns#Container> . 
<http://rdfs.org/sioc/types#Weblog> rdfs:subClassOf <http://rdfs.org/sioc/ns#Forum> . 
<http://rdfs.org/sioc/types#MessageBoard> rdfs:subClassOf <http://rdfs.org/sioc/ns#Forum> . 
<http://rdfs.org/sioc/ns#link> rdfs:subPropertyOf <http://rdfs.org/sioc/ns> . ', 
'', 'http://localhost:8890/schema/test');

Define the rule:

rdfs_rule_set ('http://localhost:8890/schema/property_rules1', 'http://localhost:8890/schema/test');

Execute query:

define input:inference "http://localhost:8890/schema/property_rules1" 
SELECT ?s FROM <http://localhost:8890/test> 
WHERE {?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>  <http://rdfs.org/sioc/ns#Space> };

This gives me only 1 result row - http://localhost:8890/dataspace.
While I'm suppose to get 3 rows:

  • http://localhost:8890/dataspace/test2/weblog/test2tWeblog
  • http://localhost:8890/dataspace/discussion/oWiki-test1Wiki
  • http://localhost:8890/dataspace

Can anyone please tell me what I'm doing wrong here. Does the dba needs to be granted any permission to rdfs_rule_set?
Thanks a lot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

下壹個目標 2024-12-28 22:47:26

这是 Virtuoso 的一些旧版本中的一个已知问题...

那么,您能详细说明您正在使用什么版本的 Virtuoso 以及在什么操作系统上吗?

(我相信这个问题已在 Virtuoso Open Source 6.1.4 和 Commercial 6.3 中得到解决...)

This was a known issue in some older builds of Virtuoso...

So, can you detail what build of Virtuoso you are using and on what operating system?

( I believe this issue was fixed in Virtuoso Open Source 6.1.4 and Commercial 6.3...)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文