3

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 ?

user3676228
  • 49
  • 1
  • 4

1 Answers1

3

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.

Simulant
  • 19,190
  • 8
  • 63
  • 98