Changeset 261

Show
Ignore:
Timestamp:
01/29/09 14:22:25 (10 years ago)
Author:
samuraraujo
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Explorator/trunk/lib/dataload.rb

    r255 r261  
    1313#$activerdflog.level = Logger::DEBUG 
    1414#Keep track of all repositories registered in the pool 
    15   
    16 dir = File.dirname(File.expand_path(__FILE__)) 
    1715 
     16#dir = File.dirname(File.expand_path(__FILE__)) 
     17dbdir = Dir.pwd +  File::SEPARATOR + 'db' 
    1818 
    1919#ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://localhost:8087/openrdf-sesame/repositories/TESTE", :results => :sparql_xml 
     
    2424#adapter.title='NEPOMUK_SPARQL' 
    2525 
    26  
    27 adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'EXPLORATOR' 
    28 adapter.title='EXPLORATOR_DEFAULT' 
    29 adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'PRESIDENT' 
    30 adapter.title='PRESIDENT_PARALLAX_DEFAULT' 
    31  
    32 adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'NOKIA' 
    33 adapter.title='NOKIA_DEFAULT' 
    34  
    35 adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'MONDIAL' 
    36 adapter.title='MONDIAL_DEFAULT' 
    37  
    38 adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'CIA' 
    39 adapter.title='CIA_DEFAULT' 
    40  
    41 adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'METAMODEL' 
    42 adapter.title='METAMODEL_SPARQL' 
    43  
    44 adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => 'FACETO' 
    45 adapter.title='FACETO_DEFAULT' 
    46  
     26sesamedir = Dir.new(dbdir + File::SEPARATOR + 'Sesame' + File::SEPARATOR + "repositories") 
     27sesamedir.each  do |x|  
     28   
     29  if x.rindex('.') == nil && x!= ('SYSTEM')  
     30     
     31    adapter =ConnectionPool.add_data_source :type => :sparql_sesame_api ,  :caching =>true, :repository => x, :dir => sesamedir.path 
     32    adapter.title=x + '_DEFAULT'     
     33  end 
     34end 
    4735 
    4836#adapter =ConnectionPool.add_data_source :type => :sparql,:engine => :sesame2, :url => "http://localhost:8080/openrdf-sesame/repositories/PRESIDENT", :results => :sparql_xml, :caching =>true 
     
    153141 
    154142Namespace.register(:imdb2, 'http://wwwis.win.tue.nl/~ppartout/Blu-IS/Ontologies/IMDB/') 
    155   
     143 
    156144Namespace.register(:oddlinker, "http://data.linkedmdb.org/resource/oddlinker/") 
    157145Namespace.register(:map, "file:/C:/d2r-server-0.4/mapping.n3#") 
     
    167155# construct the necessary Ruby Modules and Classes to use the Namespace 
    168156ObjectManager.construct_classes 
    169