Skip to content

Commit

Permalink
Merge branch 'development' into feature/disable-new-validators
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni authored Oct 12, 2023
2 parents dcf9c06 + 71a8414 commit f2e41eb
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 35 deletions.
57 changes: 28 additions & 29 deletions config/schemes/ontology_submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,6 @@ pullLocation:
"DOAP: Web page from which the project software can be downloaded" ]
metadataMappings: [ "doap:download-page" , "dcat:accessURL" , "omv:resourceLocator" ]
label: "Access URL"
enforcedValues: {
"https://www.w3.org/TR/rdf-schema/#ch_subclassof": "rdfs:subClassOf",
"http://www.sparna.fr/skos/SKOS-traduction-francais.html#broader": "skos:broader"
}
display: "links"

uriLookupEndpoint:
Expand Down Expand Up @@ -1034,9 +1030,10 @@ associatedMedia:


# object description properties

prefLabelProperty:
extractedMetadata: true
description: "MOD: Property used to specify objects preferred label"
description: "MOD: Property used to specify objects preferred label."
label: "Object preferred label property"
enforcedValues: {
"http://www.w3.org/2004/02/skos/core#prefLabel": "prefLabel",
Expand All @@ -1046,10 +1043,10 @@ prefLabelProperty:
"http://purl.org/dc/terms/title": "title"
}
display: "object description properties"

synonymProperty:
extractedMetadata: true
description: "MOD: Property used to specify objects synonyms"
description: "MOD: Property used to specify objects synonyms."
label: "Object synonym property"
enforcedValues: {
"http://www.w3.org/2004/02/skos/core#altLabel ": "altLabel",
Expand All @@ -1058,10 +1055,9 @@ synonymProperty:
}
display: "object description properties"


definitionProperty:
extractedMetadata: true
description: "MOD: Property used to specify objects' definition"
description: "MOD: Property used to specify objects definition."
label: "Object definition property"
enforcedValues: {
"http://www.w3.org/2004/02/skos/core#definition": "definition",
Expand All @@ -1071,10 +1067,9 @@ definitionProperty:
}
display: "object description properties"


authorProperty:
extractedMetadata: true
description: "MOD: Property used to specify object's author"
description: "MOD: Property used to specify object author."
label: "Object author property"
enforcedValues: {
"http://purl.org/dc/elements/1.1/creator": "creator",
Expand All @@ -1088,7 +1083,7 @@ authorProperty:

obsoleteProperty:
extractedMetadata: true
description: "MOD: Property used to specify obsolete objects"
description: "MOD: Property used to specify obsolete objects."
label: "Object obsolete property"
enforcedValues: {
"http://www.w3.org/2002/07/owl#owl:deprecated": "deprecated",
Expand All @@ -1101,15 +1096,14 @@ createdProperty:
description: "MOD: Property used to specify the date of creation of a class or another object in the ontology."
label: "Object creation date property"
enforcedValues: {
"http://purl.org/dc/terms/created ": "created",
"http://purl.org/dc/terms/issued ": "issued",
"http://purl.org/dc/terms/date": "date",
"http://purl.org/pav/authoredOn ": "authoredOn",
"http://purl.org/pav/contributedOn": "contributedOn",
"http://purl.org/pav/createdOn": "createdOn",
"http://www.isibang.ac.in/ns/mod/1.1/creationDate": "creationDate",
"http://schema.org/dateCreated ": "dateCreated",
"http://www.w3.org/ns/prov#generatedAtTime": "generatedAtTime"
"http://purl.org/dc/terms/created ": "dcterms:created",
"http://purl.org/dc/terms/issued ": "dcterms:issued",
"http://purl.org/dc/terms/date": "dcterms:date",
"http://purl.org/pav/authoredOn ": "pav:authoredOn",
"http://purl.org/pav/contributedOn": "pav:contributedOn",
"http://purl.org/pav/createdOn": "pav:createdOn",
"http://schema.org/dateCreated": "sdo:dateCreated",
"http://www.w3.org/ns/prov#generatedAtTime": "prov:generatedAtTime"
}
display: "object description properties"

Expand All @@ -1118,21 +1112,26 @@ modifiedProperty:
description: "MOD: Property used to specify the date of modification of a class or another object in the ontology."
label: "Object modification date property"
enforcedValues: {
"http://purl.org/dc/terms" ,
"http://schema.org" ,
"http://purl.org/pav" ,
"https://omv2.sourceforge.net"
"http://purl.org/dc/terms/modified ": "dc:modified",
"http://purl.org/dc/terms/issued ": "dcterms:issued",
"http://purl.org/dc/terms/date": "dcterms:date",
"http://purl.org/pav/authoredOn ": "pav:authoredOn",
"http://purl.org/pav/contributedOn": "pav:contributedOn",
"http://purl.org/pav/lastUpdateOn": "pav:lastUpdateOn",
"http://schema.org/dateModified": "sdo:dateModified"
}
display: "object description properties"

hierarchyProperty:
extractedMetadata: true
description: "MOD: A property that is used to specify the hierarchy"
description: "MOD: A property that is used to specify the hierarchy."
label: "Hierarchy property"
enforcedValues: {
"https://www.w3.org/TR/rdf-schema/#ch_subclassof": "rdfs:subClassOf",
"http://www.sparna.fr/skos/SKOS-traduction-francais.html#broader": "skos:broader"
"http://www.w3.org/2000/01/rdf-schema#subClassOf": "rdfs:subClassOf",
"http://www.w3.org/2004/02/skos/core#broader": "skos:broader"
}
display: "object description properties"




Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def generate_class_urns(classes)
def find_submission_by_ontology_id(ontology_id)
return nil if ontology_id.nil?

o = LinkedData::Models::Ontology.where(submissions: { URI: ontology_id })
o = LinkedData::Models::Ontology.where(submissions: { URI: RDF::URI.new(ontology_id) })
.include(submissions: %i[submissionId submissionStatus URI])
.first
o.nil? ? nil : o.latest_submission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def extract_ontology_iri
RDF::URI.new('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'),
RDF::URI.new('http://www.w3.org/2002/07/owl#Ontology')])
sol = query.each_solution.first || {}
sol[:uri]&.to_s
RDF::URI.new(sol[:uri]) if sol[:uri]
end

private
Expand Down
4 changes: 2 additions & 2 deletions lib/ontologies_linked_data/models/ontology_submission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class OntologySubmission < LinkedData::Models::Base

# Ontology metadata
# General metadata
attribute :URI, namespace: :omv, enforce: %i[existence distinct_of_identifier]
attribute :URI, namespace: :omv, type: :uri, enforce: %i[existence distinct_of_identifier]
attribute :versionIRI, namespace: :owl, type: :uri, enforce: [:distinct_of_URI]
attribute :version, namespace: :omv
attribute :status, namespace: :omv, enforce: %i[existence], default: ->(x) { 'production' }
Expand Down Expand Up @@ -1672,7 +1672,7 @@ def uri
end

def uri=(uri)
self.URI = uri
self.URI = RDF::URI.new(uri)
end

def roots_sorted(extra_include = nil, concept_schemes: [])
Expand Down
2 changes: 1 addition & 1 deletion test/mappings/test_mappings_bulk_load.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def mapping_load(mapping_hash, ontology_id)
LinkedData::Mappings.create_mapping_counts(Logger.new(TestLogFile.new))
ct = LinkedData::Models::MappingCount.where.all.length
assert ct > 2
o = LinkedData::Models::Ontology.where(submissions: { URI: ontology_id })
o = LinkedData::Models::Ontology.where(submissions: { URI: RDF::URI.new(ontology_id) })
.include(submissions: %i[submissionId submissionStatus])
.first
latest_sub = o.nil? ? nil : o.latest_submission
Expand Down
6 changes: 5 additions & 1 deletion test/models/test_ontology_submission_validators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def test_enforce_symmetric_ontologies
end

def test_lexvo_language_validator

submissions = sorted_submissions_init(1)

sub = submissions.first
Expand All @@ -31,6 +32,7 @@ def test_lexvo_language_validator
# Regroup all validity test related to a submission retired status (deprecated, valid date)
def test_submission_retired_validity
skip 'complex validators disabled'

sorted_submissions = sorted_submissions_init

latest = sorted_submissions.first
Expand Down Expand Up @@ -121,6 +123,7 @@ def test_has_prior_version_callback

def test_update_submissions_has_part
skip 'complex validators disabled'

ont_count, ont_acronyms, ontologies =
create_ontologies_and_submissions(ont_count: 3, submission_count: 1,
process_submission: false, acronym: 'NCBO-545')
Expand Down Expand Up @@ -193,7 +196,8 @@ def sorted_submissions_init(submission_count = 3)
end

def ontologies_properties_callbacks(attr, inverse_attr = nil)
inverse_attr = attr unless inverse_attr
skip('skip new callbacks tests until reimplemented')
inverse_attr = attr unless inverse_attr
ont_count, ont_acronyms, ontologies =
create_ontologies_and_submissions(ont_count: 3, submission_count: 1,
process_submission: false, acronym: 'NCBO-545')
Expand Down

0 comments on commit f2e41eb

Please sign in to comment.