Virtual Graph: Map from JSON column in SQL

I'm wondering if it's possible to map JSON column data with the virtual graph. My thinking at first was that a mapping query like the following could let me map key-value pairs in the JSON column:

MAPPING
FROM SQL {
  SELECT *
  FROM "SCHEMA"."TABLE"
}
TO {
  ?t a :table;
      :Id ?id ;
     :JsonData ?jsonData .
  ?jsonData a :JsonData ;
            :key1 ?key1 ;
            :key2 ?key2 
} WHERE {
  BIND(StrDt(?ID, xsd:integer) AS ?id)
  BIND(StrDt(?JSON_DATA, xsd:string) AS ?jsonData)
  BIND(StrDt(?JSON_DATA.key1, xsd:string) AS ?key1)
  BIND(StrDt(?JSON_DATA.key2, xsd:string) AS ?key2)
  BIND(template("http://api.stardog.com/TABLE/ID={ID}") AS ?table)
}

However, the variable names can't have dots in them, so this doesn't work. I've also tried replacing the dots with both one and two underscores, but this doesn't work either. Is this functionality available at all, or do I have to fiddle around with the SQL query instead?

The column-name-with-dots issue is known and will be fixed in an upcoming release.

The only workaround for now is to using a different mapping syntax (like R2RML), or create a view on your database that renames the columns.

What tech are you using to map JSON to relational?

Regards,
-Paul

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.