简体   繁体   English

MongoDB和RDF

[英]MongoDB and RDF

I have to use our production database MongoDB to store RDF triples and one related RDFs Schema. 我必须使用生产数据库MongoDB来存储RDF三元组和一个相关的RDF模式。

1) MongoDB is only key-valued, so how I can create one collection which fit with one RDF Schema? 1)MongoDB只是键值,所以如何创建一个适合一个RDF架构的集合?

2) How I can represent triples in JSON ? 2)我怎么能表示JSON中的三元组?

3) Is there any way to execute SPARQL Query with MongoDB ? 3)有什么方法可以用MongoDB执行SPARQL查询?

to your second Question: This is one JSON Object with three values: 第二个问题:这是一个具有三个值的JSON对象:

{
 "tagFirstValue" : "first value here",
 "tagSecondValue" : "second value",
 "tagthirdVale" : "third value"
}

Instead you could also use an array: 相反,您也可以使用数组:

{"tag": [ "firstVale", "secondValue", "thirdValue"]}

Or use nested Objects: 或使用嵌套对象:

{
 "tagFirstObject" : {"firstObjectTag":"first value here"},
 "tagSecondObjec" : {"secondObjectTag":"second value here"},
 "tagthirdObjec" : {"thirdObjectTag":"third value here"},
}

Its up to you how you define your schema. 由您决定如何定义架构。

In the same way you should create a collection that fit to your RDF Schema, so this is to Question one. 同样,您应该创建一个适合您的RDF模式的集合,因此这是第一个问题。

to Question three: I think the best will be to use a mongodb-driver for the programming language of your choise and transform the SPARQL Query into a MongoDB query. 问题三:我认为最好的方法是使用mongodb-driver作为选择语言,并将SPARQL查询转换为MongoDB查询。

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

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