Cross Reference: hets_helper.rb
xref
: /
ontohub
/
spec
/
hets_helper.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
hets_helper.rb revision 4e4dd16617d60a2293b37431ebc21d94aeea80dc
1516
N/A
# In this file, 'ontology_fixture' is always the path to the ontology file
581
N/A
# relative to
Rails.root.join
('
spec
/
fixtures
/
ontologies
/')
581
N/A
581
N/A
def
hets_vcr_file
(
subdir
,
ontology_fixture
)
581
N/A
# Replace last occurence of '.' by '_' in the filepath (VCR convention).
581
N/A
portions
=
ontology_fixture.split
(
'.'
)
581
N/A
path
=
portions
[
0
..-
2
].
join
(
'.'
)
581
N/A
extension
=
portions
[-
1
]
581
N/A
581
N/A
fixture_file
(
File.join
(
'vcr'
,
'hets-out'
,
subdir
,
"#{path}_#{extension}.yml"
)
)
581
N/A
end
581
N/A
581
N/A
def
hets_ontology_vcr_file
(
ontology_fixture
)
581
N/A
hets_vcr_file
(
'dg'
,
ontology_fixture
)
581
N/A
end
581
N/A
581
N/A
def
hets_proof_vcr_file
(
ontology_fixture
)
581
N/A
hets_vcr_file
(
'proof'
,
ontology_fixture
)
581
N/A
end
581
N/A
581
N/A
def
hets_provers_vcr_file
(
ontology_fixture
)
581
N/A
hets_vcr_file
(
'provers'
,
ontology_fixture
)
1899
N/A
end
2859
N/A
1899
N/A
581
N/A
def
hets_out_body
(
subdir
,
ontology_fixture
)
581
N/A
yaml
=
YAML.load
(
File.open
(
hets_vcr_file
(
subdir
,
ontology_fixture
)
)
)
581
N/A
yaml
[
'http_interactions'
].
first
[
'response'
][
'body'
][
'string'
]
817
N/A
end
1715
N/A
581
N/A
def
hets_out_body_ontology
(
ontology_fixture
)
742
N/A
hets_out_body
(
'dg'
,
ontology_fixture
)
581
N/A
end
581
N/A
817
N/A
def
hets_out_body_proof
(
ontology_fixture
)
1020
N/A
hets_out_body
(
'proof'
,
ontology_fixture
)
1117
N/A
end
738
N/A
742
N/A
def
hets_out_body_provers
(
ontology_fixture
)
1117
N/A
hets_out_body
(
'provers'
,
ontology_fixture
)
581
N/A
end
2028
N/A
1507
N/A
1507
N/A
def
parse_ontology_hets_out
(
user
,
ontology
,
io
)
1507
N/A
evaluator
=
Hets
::
DG
::
Evaluator.new
(
user
,
ontology
,
io
:
io
)
1968
N/A
evaluator.import
1507
N/A
io.close
unless
io.closed
?
581
N/A
end
1715
N/A
581
N/A
def
parse_ontology
(
user
,
ontology
,
ontology_fixture
)
1715
N/A
io
=
StringIO.new
(
hets_out_body_ontology
(
ontology_fixture
)
)
581
N/A
parse_ontology_hets_out
(
user
,
ontology
,
io
)
1151
N/A
end
1151
N/A