【问题标题】:sesame repository configuration芝麻仓库配置
【发布时间】:2013-01-22 19:48:20
【问题描述】:

我使用 sesame http 存储库,因为我有一个大架构,所以支持推理的存储库太慢(尤其是在添加三元组时)。结果,我使用了一个简单的内存存储库(在工作台上设置它)并在运行时对其进行配置,以支持在我想要的页面中使用以下行进行推理。

ForwardChainingRDFSInferencerConfig inferMemStoreConfig = new ForwardChainingRDFSInferencerConfig(new MemoryStoreConfig(true));
SailRepositoryConfig repositoryTypeSpec = new SailRepositoryConfig(inferMemStoreConfig);
RepositoryConfig repConfig = new RepositoryConfig(repositoryID, repositoryTypeSpec);
RemoteRepositoryManager manager = new RemoteRepositoryManager(sesameServer);
manager.initialize();
Repository myRepository = manager.getRepository(repositoryID);

manager.addRepositoryConfig(repConfig);

那么在我添加三元组的页面中,我该如何禁用它呢?

这是我尝试过的:

MemoryStoreConfig memStoreConfig = new MemoryStoreConfig(true);
SailRepositoryConfig repositoryTypeSpec = new SailRepositoryConfig(memStoreConfig);
RepositoryConfig repConfig = new RepositoryConfig(repositoryID, repositoryTypeSpec);
RemoteRepositoryManager manager = new RemoteRepositoryManager(sesameServer);
manager.initialize();

Repository myRepository = manager.getRepository(repositoryID);

manager.addRepositoryConfig(repConfig);

myRepository.initialize();

有什么帮助吗?也许是更好的方法?

【问题讨论】:

    标签: configuration sesame


    【解决方案1】:

    您不能像这样在运行时更改默认 Sesame 存储库的推理策略。使用特定配置创建存储库后,该配置将被修复。不能将同一存储配置为推理和非推理。

    即使您可以更改它,它也无济于事。我不确定您到底想达到什么目的,但是通过推理将数据添加到存储中速度较慢,因为它必须进行推理。在加载期间禁用推理但在查询期间启用它是没有意义的,因为所有推理工作都是在加载期间完成的,因此在这种情况下不会推断任何内容。

    您有多种选择:一种选择是使用完全非推理的存储库,只需进行更智能的查询即可获得所需的信息 - 大多数 RDFS 继承推理可以通过使用查询来替换。

    例如,获取一个类A的所有子类:

    SELECT ?x
    WHERE { ?x rdfs:subClassOf+ ex:A }
    

    A 的所有(继承的)实例:

    SELECT ?i
    WHERE { ?i a [ rdfs:subClassOf* ex:A ] }
    

    等等等等。

    另一种选择是研究 Sesame 第三方后端之一,例如 OWLIM,它具有更复杂的推理支持和更好的性能。

    【讨论】:

      猜你喜欢
      • 2016-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-30
      • 2012-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多