talia_core 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/lib/talia_core/initializer.rb +3 -3
- data/lib/talia_core/rdf_import.rb +1 -1
- data/lib/talia_util/util.rb +2 -2
- metadata +1 -1
data/VERSION.yml
CHANGED
@@ -354,11 +354,11 @@ module TaliaCore
|
|
354
354
|
onto_dir = File.join(TALIA_ROOT, @config['auto_ontologies'])
|
355
355
|
raise(SystemInitializationError, "Cannot find configured ontology dir #{onto_dir}") unless(File.directory?(onto_dir))
|
356
356
|
adapter = ActiveRDF::ConnectionPool.write_adapter
|
357
|
-
raise(SystemInitializationError, "Ontology autoloading without a context-aware adapter deletes all RDF data. This is only allowed in testing, please load the ontology manually.") unless(adapter.contexts || (@environment == 'testing'))
|
357
|
+
raise(SystemInitializationError, "Ontology autoloading without a context-aware adapter deletes all RDF data. This is only allowed in testing, please load the ontology manually.") unless(adapter.contexts? || (@environment == 'testing'))
|
358
358
|
raise(SystemInitializationError, "Ontology autoloading requires 'load' capability on the adapter.") unless(adapter.respond_to?(:load))
|
359
359
|
|
360
360
|
# Clear out the RDF
|
361
|
-
if(adapter.contexts)
|
361
|
+
if(adapter.contexts?)
|
362
362
|
TaliaCore::RdfImport.clear_file_contexts
|
363
363
|
else
|
364
364
|
adapter.respond_to?(:clear) ? adapter.clear : TaliaUtil::Util::flush_rdf
|
@@ -369,7 +369,7 @@ module TaliaCore
|
|
369
369
|
Dir.foreach(onto_dir) do |file|
|
370
370
|
if(file =~ /\.owl$|\.rdf$|\.rdfs$/)
|
371
371
|
file = File.expand_path(File.join(onto_dir, file))
|
372
|
-
adapter.contexts ? TaliaCore::RdfImport.import_file(file, 'rdfxml', :auto) : TaliaCore::RdfImport.import_file(file, 'rdfxml')
|
372
|
+
adapter.contexts? ? TaliaCore::RdfImport.import_file(file, 'rdfxml', :auto) : TaliaCore::RdfImport.import_file(file, 'rdfxml')
|
373
373
|
loaded_ontos << File.basename(file)
|
374
374
|
end
|
375
375
|
end
|
@@ -14,7 +14,7 @@ module TaliaCore
|
|
14
14
|
def import(rdf_syntax, files, context=nil)
|
15
15
|
puts "Importing #{files.size} files into the triple store."
|
16
16
|
|
17
|
-
raise(ArgumentError, "Cannot use context, adapter doesn't support it.") if(context && !adapter.contexts)
|
17
|
+
raise(ArgumentError, "Cannot use context, adapter doesn't support it.") if(context && !adapter.contexts?)
|
18
18
|
|
19
19
|
# check if the connection to te triplestore is ok...otherwise exit the script
|
20
20
|
if !adapter
|
data/lib/talia_util/util.rb
CHANGED
@@ -26,7 +26,7 @@ module TaliaUtil
|
|
26
26
|
def setup_ontologies
|
27
27
|
# Clear the ontologies from RDF, if possible
|
28
28
|
adapter = ActiveRDF::ConnectionPool.write_adapter
|
29
|
-
if(adapter.contexts)
|
29
|
+
if(adapter.contexts?)
|
30
30
|
TaliaCore::RdfImport.clear_file_contexts
|
31
31
|
else
|
32
32
|
puts "WARNING: Cannot remove old ontologies, adapter doesn't support contexts."
|
@@ -36,7 +36,7 @@ module TaliaUtil
|
|
36
36
|
files = Dir[File.join(ontology_folder, '*.{rdf*,owl}')]
|
37
37
|
ENV['rdf_syntax'] ||= 'rdfxml'
|
38
38
|
params = [ENV['rdf_syntax'], files]
|
39
|
-
params << :auto if(adapter.contexts)
|
39
|
+
params << :auto if(adapter.contexts?)
|
40
40
|
TaliaCore::RdfImport::import(*params)
|
41
41
|
RdfUpdate::owl_to_rdfs
|
42
42
|
end
|