Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB and RDF

Tags:

mongodb

rdf

rdfs

I have to use our production database MongoDB to store RDF triples and one related RDFs Schema.

1) MongoDB is only key-valued, so how I can create one collection which fit with one RDF Schema?

2) How I can represent triples in JSON ?

3) Is there any way to execute SPARQL Query with MongoDB ?

like image 448
user3676228 Avatar asked Oct 15 '25 10:10

user3676228


1 Answers

to your second Question: This is one JSON Object with three values:

{
 "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.

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.

like image 150
Simulant Avatar answered Oct 18 '25 05:10

Simulant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!