task default: [ "manifests.nt", "earl.ttl", "earl.html" ]
desc "Create concatenated test manifests"
file "manifests.nt" do
require 'rdf'
require 'json/ld'
require 'rdf/ntriples'
graph = RDF::Graph.new do |g|
%w( https://w3c.github.io/json-ld-api/tests/compact-manifest.jsonld
https://w3c.github.io/json-ld-api/tests/expand-manifest.jsonld
https://w3c.github.io/json-ld-api/tests/flatten-manifest.jsonld
https://w3c.github.io/json-ld-api/tests/fromRdf-manifest.jsonld
https://w3c.github.io/json-ld-api/tests/html-manifest.jsonld
https://w3c.github.io/json-ld-api/tests/remote-doc-manifest.jsonld
https://w3c.github.io/json-ld-api/tests/toRdf-manifest.jsonld
https://w3c.github.io/json-ld-framing/tests/frame-manifest.jsonld
).each do |man|
puts "load #{man}"
g.load(man, unique_bnodes: true)
end
end
puts "write"
RDF::NTriples::Writer.open("manifests.nt", unique_bnodes: true, validate: false) {|w| w << graph}
end