Skip to content

Commit

Permalink
add class date attributes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Dec 17, 2022
1 parent f4df352 commit 1e318a0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/data/ontology_files/BRO_v3.4.owl
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@
<core:prefLabel rdf:datatype="&xsd;string">Activity</core:prefLabel>
<desc:definition rdf:datatype="&xsd;string">Activity of interest that may be related to a BRO:Resource.</desc:definition>
<core:altLabel>activities</core:altLabel>
<dct:created rdf:datatype="xsd:dateTime">2015-06-29</dct:created>
<dct:modified rdf:datatype="xsd:dateTime">2015-10-01</dct:modified>
</owl:Class>


Expand Down
21 changes: 21 additions & 0 deletions test/models/test_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,25 @@ def test_xml_literal_serialization
assert_equal String, xml_comment.class
assert_equal comment, xml_comment
end

def test_fetch_date_attributes
acronym = 'BRO'
# Create a 1st version for BRO
submission_parse(acronym, "BRO",
"./test/data/ontology_files/BRO_v3.4.owl", 1,
process_rdf: true, index_search: false,
run_metrics: false, reasoning: false,
diff: true, delete: false)

os = LinkedData::Models::OntologySubmission.where(ontology: [ acronym: acronym ],
submissionId: 1).all
assert(os.length == 1)
os = os[0]

class_id = RDF::URI.new "http://bioontology.org/ontologies/Activity.owl#Activity"
cls = LinkedData::Models::Class.find(class_id).in(os).include(:created, :modified).first
assert_equal '2015-06-29', cls.created
assert_equal '2015-10-01', cls.modified

end
end

0 comments on commit 1e318a0

Please sign in to comment.