Hi there,
Could you please help in understanding the sms syntax and whether it supports generating graphs with blank nodes? E.g., consider the following mapping:
PREFIX : <http://example.com/>
MAPPING
FROM JSON {
{
"client_id" : "?client_id",
"transaction_id": "?transaction_id",
"sum": "?sum",
"time": "?time",
}
}
TO {
?client a :Client ;
:hasTransactionInfo [
:transaction ?transaction ;
:timestamp ?dateTime ;
:amount ?amount ;
] .
}
WHERE {
bind(template("http://example.com/client/{client_id}") as ?client)
bind(template("http://example.com/transaction/{transaction_id}") as ?transaction)
bind(xsd:dateTime(?time) as ?dateTime)
bind(xsd:integer(?sum) as ?amount)
}
with the input json document
{
"client_id": "12345",
"transaction_id": "abcdefg" ,
"sum": 2000,
"time": 1569266867591,
}
After executing the command
stardog-admin virtual import testDB transactions.sms transactions.json
the only triple that is created in the database is
<http://example.com/client/12345> a :Client .
The issue seems to be that the TO
clause does not allow generating blank nodes. Is that intentional? The documentation only says that it is analogous to the CONSTRUCT
portion of the SPARQL CONSTRUCT
query, but with CONSTRUCT
one can generate such graphs.
Could anyone clarify that? Thanks!