Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 56 lines (44 sloc) 1.134 kb
159053dd »
2011-03-07 first commit
1 require 'rubygems'
2 require 'rake'
3 require 'rake/clean'
4
5 CACHE_DIR="data/cache"
6 RDF_DIR="data/nt"
7
8 CLEAN.include ["#{RDF_DIR}/*.nt", "#{RDF_DIR}/*.gz"]
9
10 #Helper function to create data dirs
11 def mkdirs()
12 if !File.exists?("data")
13 Dir.mkdir("data")
14 end
15 if !File.exists?(CACHE_DIR)
16 Dir.mkdir(CACHE_DIR)
17 end
18 if !File.exists?(RDF_DIR)
19 Dir.mkdir(RDF_DIR)
20 end
21 end
22
23 task :init do
24 mkdirs()
25 end
26
27 #cache manifest
28 task :download => [:init] do
29 sh %{ ruby bin/cache.rb #{CACHE_DIR} }
30 end
31
32 task :convert_static do
33 Dir.glob("etc/static/*.ttl").each do |src|
34 sh %{rapper -i turtle -o ntriples #{src} >#{RDF_DIR}/#{File.basename(src, ".ttl")}.nt}
35 end
36 end
37
38 task :convert_films do
39 sh %{ruby bin/convert_films.rb #{CACHE_DIR} #{RDF_DIR}}
40 end
41
42 task :convert_files do
43 sh %{ruby bin/convert_files.rb #{CACHE_DIR} #{RDF_DIR}}
44 end
45
46 task :convert_reviews do
47 sh %{ruby bin/convert_reviews.rb #{CACHE_DIR} #{RDF_DIR}}
48 end
49
50 task :convert => [:init, :convert_static, :convert_films, :convert_files, :convert_reviews]
51
52 task :package do
53 sh %{gzip #{RDF_DIR}/*}
54 end
55
56 task :publish => [:download, :convert, :package]
Something went wrong with that request. Please try again.