This tells us that for each row of the "books" table in the database, generate a subject URI using the template http://example.net/id/book/{book_id}. Note that column names appearing in curly braces get substituted for the relevent values.

Generating blank nodes is easy: either use a template along the lines of _:book{book_id} or simply omit the "about" line altogether.

This says to map the "title" column of the table to rdfs:label and dc:title. These will be literals, with language tag "en".

turtle => [{parse => 'Turtle'}],
},

This last bit is somewhat weird and experimental. If you have a varchar/text column in your database that includes chunks of Turtle, these can be parsed into the model too. They are parsed using the current namespace map, with a base URI corresponding to the URI from "about".

In addition to the "about", "typeof" and "columns" options there are also "select" and "from" options allowing you to fine tune exactly what data the mapping is processing. And indeed, there is an "sql" option which overrides both. An example of "select" is shown in the authors mapping above.

Note that within:

{property => $dc->title, lang=>'en'}

there is a whole lot of interesting stuff going on. The object of the triple here is a literal. If it were a URI, we'd do this:

{rel => $dc->title}

Note that these correspond with the meanings of "property" and "rel" in RDFa. Like RDFa, there is also "rev" which reverses the subject and object of the triple. An example can be seen in the "book_authors" mapping above for foaf:made.

For literals "lang" and "datatype" further qualify them.

Usually, the contents of the database field are used. For example:

columns => {
book_id => [{ property => $dc->identifier }],
},

However, sometimes you might want to slot the data from the database into a template:

When "rel" or "rev" are used (i.e. not "property"), then "resource" should be used (i.e. not "content").

Pretty much anywhere where a URI or literal value is expected, you can either give a string, or an RDF::Trine::Node. In cases of strngs, they will be interpolated as templates. RDF::Trine::Nodes are not interpolated.