We try to virtually map JSON data from Cosmos to Stardog using the CDATA JDBC Driver. The following script works:
PREFIX : <http://api.stardog.com/>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX stardog: <tag:stardog:api:>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
MAPPING
FROM SQL {
SELECT *
FROM [myDB].[myFile]
}
TO {
?subject <http://api.stardog.com/tenantconfig#prop1> ?value_1 .
?subject <http://api.stardog.com/tenantconfig#prop2> ?value_2 .
} WHERE {
BIND(template("http://api.stardog.com/my_namespace/{value_1}") AS ?subject)
}
However, the JSON data is nested. E.g., the example structure looks like the following:
{
"prop1" : "value_1",
"prop2" : {[
"prop2_1" : "value_2_1",
"prop2_2" : "value_2_2",
]}
}
Is there a way to apply the "FROM JSON" mapper techniques together with the "FROM SQL"? The goal would be to have resulting RDF like the following:
?subject <http://api.stardog.com/tenantconfig#prop1> ?value_1 .
?subject <http://api.stardog.com/tenantconfig#prop2_1> ?value_2_1 .
?subject <http://api.stardog.com/tenantconfig#prop2_2> ?value_2_2 .
Is this possible using the JDBC Driver? Or would we have to use a Mongo one?