Sha256: 6cbd904c9f72c5b054081b326b8c4ab8c14ab962bc3d41dcbcab80bb1409f5ae

Contents?: true

Size: 1.26 KB

Versions: 7

Compression:

Stored size: 1.26 KB

Contents

#
# Author:  Karsten Huneycutt
# Copyright 2007 Valkeir Corporation
# License:  LGPL
#
require 'java'

module Jena

  module Ontology
    include_package('com.hp.hpl.jena.ontology')
  end

  module Model
    include_package('com.hp.hpl.jena.rdf.model')
  end

  module DB
    include_package('com.hp.hpl.jena.db')
    
    # this maps downcased Jena database types into drivers
    DRIVER_MAP = {
      'oracle' => 'oracle.jdbc.Driver',
      'mysql' => 'com.mysql.jdbc.Driver',
      'derby' => 'org.apache.derby.jdbc.EmbeddedDriver',
      'postgresql' => 'org.postgresql.Driver',
      'hsql' => 'org.hsqldb.jdbcDriver',
      'mssql' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
    }
    
    DRIVER_MAP.each do |name, driver| 
      av = "#{name}_available"
      (class << self ; self ; end).send(:bool_accessor, av.to_sym)
      begin
        java.lang.Class.forName driver
        Jena::DB.send("#{av}=", true)
      rescue
        Jena::DB.send("#{av}=", false)
      end
    end
  end
  
  module Query
    include_package('com.hp.hpl.jena.query')
  end

  module Reasoner
    include_package('com.hp.hpl.jena.reasoner')
  end

  module Datatypes
    include_package('com.hp.hpl.jena.datatypes')
  end

  module Graph
    include_package('com.hp.hpl.jena.graph')
  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
activerdf_net7-1.6.16 activerdf-jena/lib/activerdf_jena/jena.rb
activerdf_net7-1.6.15 activerdf-jena/lib/activerdf_jena/jena.rb
activerdf_net7-1.6.14 activerdf-jena/lib/activerdf_jena/jena.rb
activerdf_net7-1.6.13 activerdf-jena/lib/activerdf_jena/jena.rb
activerdf_net7-1.6.12 activerdf-jena/lib/activerdf_jena/jena.rb
activerdf_net7-1.6.11 activerdf-jena/lib/activerdf_jena/jena.rb
activerdf_jena-0.1 lib/activerdf_jena/jena.rb