Skip to content

Commit

Permalink
add agent extraction unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Aug 9, 2024
1 parent 2602532 commit b956c9c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions test/data/ontology_files/agrooeMappings-05-05-2016.owl
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
<doap:maintainer>Huguette Doap</doap:maintainer>

<omv:hasContributor rdf:resource="http://lirmm.fr/2015/resource/vincent"/>
<omv:hasCreator rdf:resource="http://lirmm.fr/2015/resource/vincent"/>
<omv:hasContributor rdf:resource="http://lirmm.fr/2015/resource/anne"/>
<dc:contributor>Benjamine Dessay</dc:contributor>
<dcterms:contributor>Léontine Dessaiterm</dcterms:contributor>
Expand Down
17 changes: 12 additions & 5 deletions test/models/test_ontology_submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1108,26 +1108,33 @@ def test_submission_metrics
def test_submission_extract_metadata
2.times.each do |i|
submission_parse("AGROOE", "AGROOE Test extract metadata ontology",
"./test/data/ontology_files/agrooeMappings-05-05-2016.owl", i+1,
"./test/data/ontology_files/agrooeMappings-05-05-2016.owl", i + 1,
process_rdf: true, extract_metadata: true, generate_missing_labels: false)
ont = LinkedData::Models::Ontology.find("AGROOE").first
ont = LinkedData::Models::Ontology.find("AGROOE").first
sub = ont.latest_submission
refute_nil sub

sub.bring_remaining
assert_equal false, sub.deprecated
assert_equal '2015-09-28', sub.creationDate.to_date.to_s
assert_equal '2015-10-01', sub.modificationDate.to_date.to_s
assert_equal "description example, AGROOE is an ontology used to test the metadata extraction, AGROOE is an ontology to illustrate how to describe their ontologies", sub.description
#assert_equal " LIRMM (default name) ", sub.publisher
assert_equal "description example, AGROOE is an ontology used to test the metadata extraction, AGROOE is an ontology to illustrate how to describe their ontologies", sub.description
assert_equal [RDF::URI.new('http://agroportal.lirmm.fr')], sub.identifier
assert_equal ["http://lexvo.org/id/iso639-3/fra", "http://lexvo.org/id/iso639-3/eng"].sort, sub.naturalLanguage.sort
#assert_equal ["Léontine Dessaiterm", "Anne Toulet", "Benjamine Dessay", "Augustine Doap", "Vincent Emonet"].sort, sub.hasContributor.sort
assert_equal [RDF::URI.new("http://lirmm.fr/2015/ontology/door-relation.owl"), RDF::URI.new("http://lirmm.fr/2015/ontology/dc-relation.owl"),
RDF::URI.new("http://lirmm.fr/2015/ontology/dcterms-relation.owl"),
RDF::URI.new("http://lirmm.fr/2015/ontology/voaf-relation.owl"),
RDF::URI.new("http://lirmm.fr/2015/ontology/void-import.owl")
].sort, sub.ontologyRelatedTo.sort




assert_equal ["Agence 007", "Éditions \"La Science en Marche\"", " LIRMM (default name) "].sort, sub.publisher.map { |x| x.bring_remaining.name }.sort
assert_equal ["Alfred DC", "Clement Jonquet", "Gaston Dcterms", "Huguette Doap", "Mirabelle Prov", "Paul Foaf", "Vincent Emonet"].sort, sub.hasCreator.map { |x| x.bring_remaining.name }.sort
assert_equal ["Léontine Dessaiterm", "Anne Toulet", "Benjamine Dessay", "Augustine Doap", "Vincent Emonet"].sort, sub.hasContributor.map { |x| x.bring_remaining.name }.sort
assert_equal 1, LinkedData::Models::Agent.where(name: "Vincent Emonet").count

sub.description = "test changed value"
sub.save
end
Expand Down

0 comments on commit b956c9c

Please sign in to comment.