简体   繁体   English

使用LUBM数据在Marklogic上进行SPARQL查询

[英]SPARQL query on Marklogic with LUBM data

I'm using MarkLogic as an RDF server and LUBM datasets to test some of my access control policy. 我正在使用MarkLogic作为RDF服务器和LUBM数据集来测试我的一些访问控制策略。 I have loaded some .owl files (created by LUBM generator) in MarkLogic. 我在MarkLogic中加载了一些.owl文件(由LUBM生成器创建)。 After that, when I explore database, it looks like this: 之后,当我探索数据库时,它看起来像这样:

截图

The problem is that when I try to query, it always returns "Your query returned an empty sequence". 问题是,当我尝试查询时,它总是返回“您的查询返回一个空序列”。 Here is some example query of LUBM data: http://swat.cse.lehigh.edu/projects/lubm/queries-sparql.txt 以下是LUBM数据的一些示例查询: http ://swat.cse.lehigh.edu/projects/lubm/queries-sparql.txt

I suspect that the problem is that you've loaded the .owl files directly as XML, but not gotten them into the triples index. 我怀疑问题是你已经将.owl文件直接加载为XML,但没有将它们加入到三元组索引中。 Given your OWL files, try using MLCP to load them . 给定您的OWL文件, 尝试使用MLCP加载它们

Once you've done that, take a look in Query Console again. 完成后,再次查看Query Console。 You should see documents with URIs like /triplestore/353b9c6d0ce5910f.xml . 您应该看到带有URI的文档,例如/triplestore/353b9c6d0ce5910f.xml These will hold your triples in the format that MarkLogic expects to work with internally . 这些将以MarkLogic希望在内部使用的格式保存您的三元组。 (Don't worry, you can still export them in other formats.) (别担心,您仍然可以以其他格式导出它们。)

Next, check that you've got the triples index turned on for the database you're using. 接下来,检查您是否已为正在使用的数据库启用了三元组索引。 You can turn it on using the Admin UI (port 8001) or the Management API. 您可以使用管理UI(端口8001)或Management API将其打开。

If all went well, you should be able to run a simple test using your browser: http://localhost:8060/v1/graphs/things . 如果一切顺利,您应该能够使用浏览器运行一个简单的测试: http://localhost:8060/v1/graphs/things Replace the port number with that of an app server that uses your content database. 将端口号替换为使用内容数据库的应用服务器的端口号。 If all went well, you should be shown some "things" represented by triples. 如果一切顺利,你应该看到一些由三元组代表的“事物”。 Then try your queries again. 然后再次尝试您的查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM