|
@@ -338,8 +338,16 @@ M.generate_res_idx = function(s, mconf)
|
|
|
end
|
|
|
|
|
|
|
|
|
-M.generate_ll = function(s)
|
|
|
+M.generate_rdf = function(s, format)
|
|
|
+ local res_gr = M.get_graph(s)
|
|
|
+ logger:debug("Serializing graph: ", s.data)
|
|
|
+
|
|
|
+ return res_gr:encode(format or "ttl")
|
|
|
+end
|
|
|
|
|
|
+
|
|
|
+M.generate_ll = function(s)
|
|
|
+ local res_gr = M.get_graph(s)
|
|
|
end
|
|
|
|
|
|
|
|
@@ -349,11 +357,9 @@ M.generate_resource = function(s)
|
|
|
local mconf = model.models[res_type.data]
|
|
|
|
|
|
-- Generate RDF/Turtle doc.
|
|
|
- local res_gr = M.get_graph(s)
|
|
|
- logger:debug("Serializing graph: ", s.data)
|
|
|
local res_path = pkar.gen_pairtree(M.res_dir, s.data, ".ttl")
|
|
|
local ofh = assert(io.open(res_path, "w"))
|
|
|
- ofh:write(res_gr:encode("ttl"))
|
|
|
+ ofh:write(M.generate_rdf(s, "ttl"))
|
|
|
ofh:close()
|
|
|
|
|
|
-- Generate HTML doc.
|