root/Explorator/trunk/lib/dataload.rb @ 255

Revision 255, 8.2 KB (checked in by samuraraujo, 10 years ago)
Line 
1require "date"
2require "logger"
3#This module loads the adapters.
4#Each adapter has a connection with a repository.
5#See the ActiveRDF documentation for further references.
6#Author: Samur Araujo
7#Date: 25 jun 2008.
8
9require 'active_rdf' 
10def createdir(dir)
11  Dir.mkdir("db/" + dir) unless File.directory?("db/" + dir)
12end
13#$activerdflog.level = Logger::DEBUG
14#Keep track of all repositories registered in the pool
15 
16dir = File.dirname(File.expand_path(__FILE__))
17
18
19#ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://localhost:8087/openrdf-sesame/repositories/TESTE", :results => :sparql_xml
20#ConnectionPool.add_data_source :type => :sesame, :name=>:teste
21#
22
23#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://localhost:8181/org.semanticdesktop.services.rdfrepository/repositories/main", :results => :sparql_xml, :caching =>true
24#adapter.title='NEPOMUK_SPARQL'
25
26
27adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'EXPLORATOR'
28adapter.title='EXPLORATOR_DEFAULT'
29adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'PRESIDENT'
30adapter.title='PRESIDENT_PARALLAX_DEFAULT'
31
32adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'NOKIA'
33adapter.title='NOKIA_DEFAULT'
34
35adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'MONDIAL'
36adapter.title='MONDIAL_DEFAULT'
37
38adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'CIA'
39adapter.title='CIA_DEFAULT'
40
41adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'METAMODEL'
42adapter.title='METAMODEL_SPARQL'
43
44adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'FACETO'
45adapter.title='FACETO_DEFAULT'
46
47
48#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://localhost:8080/openrdf-sesame/repositories/PRESIDENT", :results => :sparql_xml, :caching =>true
49#adapter.title='PRESIDENT_PARALLAX_DEFAULT'
50#
51#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://localhost:8080/openrdf-sesame/repositories/NOKIA", :results => :sparql_xml, :caching =>true
52#adapter.title='NOKIA_DEFAULT'
53#
54#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://localhost:8080/openrdf-sesame/repositories/MONDIAL", :results => :sparql_xml, :caching =>true
55#adapter.title='MONDIAL_DEFAULT'
56#
57#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://localhost:8080/openrdf-sesame/repositories/CIA", :results => :sparql_xml, :caching =>true
58#adapter.title='CIA_DEFAULT'
59#
60#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://localhost:8080/openrdf-sesame/repositories/METAMODEL", :results => :sparql_xml, :caching =>true
61#adapter.title='METAMODEL_SPARQL'
62#
63#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://localhost:8080/openrdf-sesame/repositories/FACETO", :results => :sparql_xml, :caching =>true
64#adapter.title='FACETO_DEFAULT'
65#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://data.linkedmdb.org/sparql", :results => :sparql_xml, :caching =>true
66#adapter.title='IMDB_SPARQL'
67
68
69#
70#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :virtuoso, :url => "http://www.w3c.es/Prensa/sparql/", :results => :sparql_xml, :caching =>true
71#adapter.title='REVYU'
72
73
74#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://dbtune.org:2105/sparql/", :results => :sparql_xml
75#adapter.title='BDTune'
76#
77#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://spade.lbl.gov:2020/sparql", :results => :sparql_xml
78#adapter.title='Spade'
79
80#adapter = ConnectionPool.add(:type => :rdflite, :location => 'db/semanticweb/semanticweb.db', :reasoning => false,:keyword => true)
81#adapter.title='SEMANTICWEB'
82#adapter.load('lib/semanticweb.nt')
83#createdir("cia")
84#adapter = ConnectionPool.add( :type => :rdflite, :location => 'db/cia/cia.db', :reasoning => false,:keyword => false)
85#adapter.title='CIA'
86#
87#
88##adapter.load('lib/cia.nt')
89#createdir("terrorist")
90#adapter = ConnectionPool.add(:type => :rdflite, :location => 'db/terrorist/terrorist.db', :reasoning => false,:keyword => true)
91#adapter.title='TERRORIST'
92#
93#
94#createdir("mondial")
95#adapter = ConnectionPool.add(:type => :rdflite, :location => 'db/mondial/mondial.db', :reasoning => false,:keyword => true)
96#adapter.title='MONDIAL'
97#
98##adapter.load('lib/mondial.nt')
99#
100#createdir("portinari")
101#adapter = ConnectionPool.add(:type => :rdflite, :location => 'db/portinari/portinari.db', :reasoning => false,:keyword => true)
102#adapter.title='PORTINARI'
103#
104#
105#adapter = ConnectionPool.add(:type => :rdflite, :location => 'db/rdfexplot.db', :reasoning => false,:keyword => true)
106#adapter.title='DBLP 500MB'
107#
108#createdir("nokia")
109#adapter = ConnectionPool.add(:type => :rdflite, :location => 'db/nokia/nokia.db', :reasoning => false,:keyword => true)
110#adapter.title='Nokia'
111##adapter.load('public/data/nokia.nt')
112#
113#
114#createdir("wn")
115#adapter = ConnectionPool.add(:type => :rdflite, :location => 'db/wn/wn.db', :reasoning => false,:keyword => false)
116#adapter.title='WordNet'
117##adapter.load('public/data/wn.nt.001')
118#
119#createdir("www2008")
120#adapter = ConnectionPool.add(:type => :rdflite, :location => 'db/www2008/www.db', :reasoning => false,:keyword => true)
121#adapter.title='WWW 2008'
122##adapter.load('lib/www2008.nt')
123#
124#createdir("eswc")
125#adapter = ConnectionPool.add(:type => :rdflite, :location => 'db/eswc/eswc.db', :reasoning => false,:keyword => true)
126#adapter.title='ESWC 2008'
127##adapter.load('lib/eswc2008.nt')
128#createdir("explorator")
129#adapter = ConnectionPool.add(:type => :rdflite, :location => 'db/metamodel/metamodel.db', :reasoning => false,:keyword => true)
130#adapter.title='METAMODEL'
131#adapter.load('public/data/metamodel.nt')
132
133#You should insert here a line for each namespace that you want to use in your application.
134#The namespace must be unique. If you have doubt please see the ActiveRDF documentation.
135Namespace.register(:dp1, 'http://sw.nokia.com/DP-1/')
136Namespace.register(:fn1, 'http://sw.nokia.com/FN-1/')
137Namespace.register(:mars, 'http://sw.nokia.com/MARS-3/')
138Namespace.register(:voc1, 'http://sw.nokia.com/VOC-1/')
139Namespace.register(:fntype, 'http://sw.nokia.com/FN-1/Type/')
140Namespace.register(:sesame, 'http://www.openrdf.org/schema/sesame#')
141Namespace.register(:dc, 'http://purl.org/dc/elements/1.1/')
142Namespace.register(:dcterms, 'http://purl.org/dc/terms/')
143Namespace.register(:editor, 'http://sw.nokia.com/Editor-1/')
144Namespace.register(:webarch, 'http://sw.nokia.com/WebArch-1/')
145Namespace.register(:faceto, 'http://www.semanticnavigation.org/2008/faceto#')
146Namespace.register(:explorator, 'http://www.explorator.org/2008/explorator#')
147Namespace.register(:foaf, 'http://xmlns.com/foaf/0.1/')
148Namespace.register(:dbpedia, 'http://dbpedia.org/resource/')
149Namespace.register(:imdb, 'http://www.imdb.org/')
150Namespace.register(:wn, 'http://www.w3.org/2006/03/wn/wn20/schema/')
151
152Namespace.register(:explorator, 'http://www.tecweb.inf.puc-rio.br/ontologies/2008/explorator/01/core#')
153
154Namespace.register(:imdb2, 'http://wwwis.win.tue.nl/~ppartout/Blu-IS/Ontologies/IMDB/')
155 
156Namespace.register(:oddlinker, "http://data.linkedmdb.org/resource/oddlinker/")
157Namespace.register(:map, "file:/C:/d2r-server-0.4/mapping.n3#")
158Namespace.register(:db, "http://data.linkedmdb.org/resource/")
159Namespace.register(:skos,"http://www.w3.org/2004/02/skos/core#")
160Namespace.register(:moviedmdb,"http://data.linkedmdb.org/resource/movie/")
161Namespace.register(:omdb,"http://triplify.org/vocabulary/omdb#")
162Namespace.register(:movie,"http://triplify.org/vocabulary/movie#")
163Namespace.register(:mondial,"http://www.semwebtech.org/mondial/10/meta#")
164
165RDFS::Resource.find_all_predicates
166
167# construct the necessary Ruby Modules and Classes to use the Namespace
168ObjectManager.construct_classes
169 
Note: See TracBrowser for help on using the browser.