Hi Radu,
We don't yet provide a facility to map JSON data to RDF. Using MongoDB is a good intermediate solution as the mappings will be very similar.
The virtual import command is a porcelain command which does not have a single REST API counterpart. You can accomplish the same task by creating a temporary virtual graph using the REST API and then sending the SPARQL command COPY <virtual://your-dataset> TO <a-local-named-graph>.
We haven't yet published a virtual graph tutorial using MongoDB. Both the JSON and GraphQL syntax mappings can be used with MongoDB. In addition to the blog posts, you can find detailed documentation here. Please note that older blog entitled "STARDOG & MONGODB" includes examples based on the older syntax. The newer blog post and the documentation both give examples of the new syntax which starts with the MAPPING keyword. Let me know if you have any questions about it.
A formal tutorial on MongoDB virtual graph is so much needed. I wish we had one.
So instead let me try to piece together from the blog and manual a solution. So far I have the follwoing:
MongoDB 3.6.3 and 10 documents in a collection in a database
mongo-java-driver-3.11.0-rc0.jar uploaded to /server/dbms directory and server restarted
Writing my first sms2 mapping - see below
What is the command for creating mongodb virtual graph?
PREFIX : <http://stardog.com/movies/>
MAPPING <urn:movies>
FROM GraphQL {
movie {
movieId: _id
name
}
}
TO {
?movie a :Movie ;
:name ?name .
}
WHERE {
BIND (template("http://stardog.com/movies/Title_{movieId}") AS ?movie)
}
It looks like your movie entity in the source GraphQL is missing a terminating curly brace.
To create the virtual graph, you will need to create a properties file setting the mongodb.uri property containing a URL to connect to your MongoDB instance. You can then use the virtual add command with the --format sms2 argument to support your GraphQL mapping.