Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Configuration sesame存储库配置_Configuration_Sesame - Fatal编程技术网

Configuration sesame存储库配置

Configuration sesame存储库配置,configuration,sesame,Configuration,Sesame,我使用sesame http存储库,因为我有一个大的模式,所以支持推断的存储库太慢(特别是在添加三元组时)。因此,我使用了一个简单的内存存储库(在工作台上设置),并在运行时对其进行配置,以支持推理,在我想要的页面中,使用以下行进行推理 ForwardChainingRDFSInferencerConfig inferMemStoreConfig = new ForwardChainingRDFSInferencerConfig(new MemoryStoreConfig(true)); Sail

我使用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();

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

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

即使你能改变它,它也帮不了你。我不确定您到底想要实现什么,但向存储添加数据时使用推断速度较慢,因为它必须进行推断。在加载过程中禁用推断,但在查询过程中启用推断是毫无意义的,因为所有推断工作都是在加载过程中完成的,因此在这种情况下不会推断任何内容

您有几种选择:一种选择是使用一个完全非推断的存储库,只需执行更智能的查询即可获得所需的内容—大多数RDFS继承推断可以通过使用查询来替代

例如,要获取类
a
的所有子类:

SELECT ?x
WHERE { ?x rdfs:subClassOf+ ex:A }
SELECT ?i
WHERE { ?i a [ rdfs:subClassOf* ex:A ] }
A
的所有(继承的)实例:

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

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