Mapping using SMS

I found an example of mapping csv file from following Github repo:

My question is can anyone explain how was the final output file (cars.ttl) generated?

The example only showed that virtual import command could be used to import car.csv file into Stardog database using cars_mappings.sms file as template.


The generated RDF was stored in Stardog and exported to a TTL file.


Thanks, Jess.

In the same example, another way of importing CSV without mapping is demonstrated using file.

I am wondering 1) why the output turtle file (cars_autogenerate.ttl) is so different with the previous one (cars.ttl)? 2) whether the resulted databases are the same through two different approaches?

Using an explicit mapping allows finer grained control over the selection, structure and property names in the generated RDF. Without an explicit mapping, each row is given a unique subject and each field in the row is associated with that subject using a generated property name.

OK, so the resulted RDFs are different with or without mapping.
In this case, we will definitely need mapping as we have a specific model for data ingestion.
Where can we learn more about SMS? Can you point to me resources, like supporting materials, or tutorials? Thanks!

You can either create a mapping which will generate RDF using the described structure and property names, or you can use reasoning to map the default property names into your schema. The docs for SMS2 are available at The source specification should be FROM CSV as shown in the example.


@jess the example says, "Use an empty FROM CSV clause to indicate this is a delimited input". Is there something that you can put in there or is this the only option for now?

I think it's ignored? :slight_smile: The curly braces are optional. The variables are named corresponding to the field names in the CSV header.

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