Hi All,
I'm new to stardog. Getting irrelevant error of "SMS2 mappings for rel databases must use sql sources(Bad request)" when tried to create a virtual graph with azure cosmos db mongo api.
Tried creating a virtual graph with MySQL and mongo db and able to create it .
the same mapping i have used for virtualizing mongodb and it worked.
Trying to create a virtual graph by connecting with Azure CosmosDB Mongo API through stardog studio.
In Data Sources , the connection is created.
Populated the same sample movie json data provided for mongo db virtual graphs from documentation into the azure cosmos db mongo api .
Given a sms mapping file provided in documentation (Mapping Data Sources | Stardog Documentation Latest) - but while creating a virtual graph from stardog studio.
Receiving the below error :
Used configs :
Database name : movies
Collection name : movies
Data source config :
jdbc.url = jdbc:cosmosdb:AccountEndpoint=host.cosmos.azure.com:10255;AccountKey=******
sms mapping :
PREFIX : http://stardog.com/movies/
MAPPING urn:movies
FROM JSON {
"movies":{
"_id":"?movieId",
"name":"?name",
"datePublished":"?datePublished",
"genre":["?genre"],
"boxOffice":"?boxOffice",
"description":"?description",
"director":[ {
"director":"?directorId",
"name":"?directorName"
}
],
"actor":[ {
"actor":"?actorId",
"name":"?actorName"
}
]
}
}
TO {
?movie a :Movie ;
:name ?name ;
:datePublished ?xsdDatePublished ;
:genre ?genre ;
:boxOffice "?boxOffice"^^xsd:integer ;
:description ?description ;
:directed ?directedMovie ;
:actedIn ?actedInMovie .
?directedMovie a :DirectedMovie ;
:director ?director ;
:name ?directorName .
?director a :Person .
?actedInMovie a :ActedInMovie ;
:actor ?actor ;
:name ?actorName .
?actor a :Person .
}
WHERE {
//removed other bindings due to link constraint while creating a post //
BIND (xsd:date(?datePublished) AS ?xsdDatePublished)
}
data in cosmos db:
{
"_id":"unforgiven",
"name":"Unforgiven",
"datePublished":new Date("1992-08-07T00:00:00.000Z"),
"genre":["Drama", "Western"],
"boxOffice":101157447,
"description":"Retired gunslinger reluctantly takes on one last job.",
"director":[
{"director":"clintEastwood", "name":"Clint Eastwood"}
],
"actor":[
{"actor":"morganFreeman", "name":"Morgan Freeman"},
{"actor":"clintEastwood", "name":"Clint Eastwood"},
{"actor":"geneHackman", "name":"Gene Hackman"}
]
}
{
"_id":"noWayOut",
"name":"No Way Out",
"datePublished":new Date("1987-08-14T00:00:00.000Z"),
"genre":["Action", "Mystery", "Drama", "Thriller"],
"boxOffice":35509515,
"description":"A coverup and witchhunt occur after a politician accidentally kills his mistress.",
"director":[
{"director":"rogerDonaldson", "name":"Roger Donaldson"}
],
"actor":[
{"actor":"geneHackman", "name":"Gene Hackman"},
{"actor":"kevinCostner", "name":"Kevin Costner"}
]
}