ontology_spec.rb revision 23305f217b86a2ebf90a848af9036908e0070542
require 'spec_helper'
end
end
end
end
end
it { should strip_attribute :name }
it { should strip_attribute :iri }
end
end
[
'',
end
end
before { ontology.name = name }
end
end
before { ontology.name = nil }
end
end
end
let(:dgnode_name) { "https://raw.github.com/ontohub/OOR_Ontohub_API/master/Domain_Fields_Core.owl" }
end
end
before do
end
end
end
end
before do
end
end
params.each do |param|
end
end
end
before do
end
end
end
end
before do
end
create :import_link, target: importing, source: ontology
end
end
end
end
end
create :import_link, target: ontology, source: imported
end
end
create :import_link, target: imported_ontology, source: imported
end
end
end
end
before do
end
path,
'parsing a distributed ontology',
user)
end
end
end
before do
end
end
end
end
end
end
# context 'when parsing an ontology which is referenced by another ontology', :needs_hets do
# let(:repository) { create :repository }
# let(:presentation) do
# referenced_ontology = nil
# ontology = define_ontology('Foo') do
# this = prefix('ontohub')
# imports define('Bar', as: :referenced_ontology) do
# prefix('other_ontohub').class('SomeBar')
# end
# this.class('Bar').sub_class_of this.class('Foo')
# end
# end
# let(:referenced_presentation) { presentation.referenced_ontology }
# let(:version) { version_for_file(repository, presentation.file.path) }
# let(:ontology) { version.ontology.reload }
# before do
# ExternalRepository.stub(:download_iri) do |external_iri|
# absolute_path = external_iri.sub('file://', '')
# dir = Pathname.new('/tmp/reference_ontologies/').
# join(ExternalRepository.determine_path(external_iri, :dirpath))
# ExternalRepository.send(:ensure_path_existence, dir)
# filepath = dir.join(ExternalRepository.send(:determine_basename, external_iri))
# FileUtils.cp(absolute_path, filepath)
# filepath
# end
# version
# ExternalRepository.unstub(:download_iri)
# end
# let(:referenced_ontology) do
# name = File.basename(referenced_presentation.name, '.owl')
# Ontology.where("name LIKE '#{name}%'").first!
# end
# it 'should import an ontology with that name' do
# expect(ontology.direct_imported_ontologies).to include(referenced_ontology)
# end
# it 'should have an ontology-version' do
# expect(ontology.ontology_version).to_not be_nil
# end
# it 'should have a referenced ontology with an ontology-version' do
# expect(referenced_ontology.ontology_version).to_not be_nil
# end
# end
before do
end
end
end
end
end
end
end
end
end
before do
end
end
end
end
end
end
end
end
end
end
end
end
end
end
before do
end
end
end
end
end
end
before do
# Stub ontology_end because this is always run after the iri
# has been locked by the ConcurrencyBalancer.
end
end
end
end
end
end
before do
end
end
end
end
end
before do
Ontology::States::STATES.each do |state|
end
end
end
end
end
end
end
end
before do
end
end
end
end
end
before do
ontology.state = 'failed'
end
end
end
end
end
end
before do
ontology.state = 'failed'
end
'according to user' do
end
end
end
end
end
'according to user' do
end
end
end
end
end
end
end