无法在 Stardog 中定义 类 和属性

Can't definine classes and properties in Stardog

我开始使用 Stardog 数据库,一开始我遇到了无法解决的问题。

我创建了 database 然后输入:

我将现有的 ontology 导入到这个 database 中。我可以在 Stardog 中看到那些 triples

然而,当我想浏览此数据库以查看 propertiesclasses 时,我只能看到 Thing,而当我尝试使用 classproperty 我看到“No matches fount”信息:

任何人都可以给我提示我怎样才能将一些 类 添加到我的模型中?

Stardog(以及 Web 控制台)默认限制它从数据库的哪些部分获取架构信息。

Stardog documentation 数据库有一个 reasoning.schema.graphs 选项,描述如下:

Determines which, if any, named graph or graphs contains the "tbox", i.e., the schema part of the data.

如果我们查看 属性 的关联 Javadoc,我们可以看到它的默认值:

Option to specify the location where the schema should be extracted from. Expected to be a list of the graph URIs which are the context names schema axioms should be extracted from. The default value is the default (no context) graph

所以 Stardog 默认情况下在提取数据库模式时只考虑默认的未命名图。

但是在您的示例中,您明确地将 ontology 加载到命名图中,因此 Stardog 不会自动从中提取模式。要解决此问题,您可以执行以下两项操作之一:

  1. 将您的ontology加载到默认图表
  2. 为您的数据库编辑 reasoning.schema.graphs 选项以指向包含命名图表的 ontology

请参阅上述 Stardog 文档,了解如何更改数据库的配置选项。

Stardog 目前仅从默认图形中提取 Web 控制台中的架构,因此如果您想使用 Web 控制台,或者坚持使用 CLI 或编程访问,则必须将其移动到那里。此外,正如@RobV 指出的那样,如果您已将架构加载到默认图形以外的其他位置,则必须告诉它您将架构放在哪里。