From 80a331d053ea04397a903452288c2186822c340c Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Tue, 5 Dec 2023 17:20:33 +0100 Subject: [PATCH] Merge to master - Release 2.4.4 (#81) * add request language to @context * add subscribed attribute to the user model (#68) Co-authored-by: Syphax bouazzouni * change name ( language -> lang ) * add @language to @context * in tests no more use the reload argument in the exist? method * rename the INRAETHES test file name * fix mappings test test_external_mapping_with_no_source_ids validity * handle users with no username to_string * add requested language tests * use for Goo the language filter feature branch * add request_store gem * update requested language tests to use RequestStore gem * migrate submission attributes metadata to a yaml scheme file * migrate submission types enforce to the type section * update ontology submission types and validators * add metadata information to some attributes of ontology submission Updated metadata information for version, URI, hasOntologyLanguage, status, hasFormalityLevel, hasOntologySyntax, deprecated, versionIRI attributes * fix a typo in ontology submission curatedOn attribute validator * reading language value from request query parameter called 'language' * update the metadata extractor to handle the new goo validators * fix tests to handle the new ontology submission validators * force averageChildCount metrics to be a float * remove the ontology_submission creationDate attribute default value * disable extractedMeta the keyClasses and exampleIdentifier attributes * remove unique validator fro the URI attribute * make exampleIdentifier default the first class of the ontology * add enforce_symmetric_ontologies proc validator test * implment enforce_symmetric_ontologies proc validator * use enforce_symmetric_ontologies proc validator for som submission attrs * move ontology_submission_validators tests to a seperate file * add status_align_callbacks tests * implement submission status align callbacks * add the new two status onUpdate callback to the submission attribute * remove the old enforce_symmetric_ontologies from the submission tests * implement submission retired validators and callback * use submission retired validators and callbacks * add submission retired status validators and callbacks tests * add submission modification_date_previous_align validator test * implement modification_date_previous_align validator * refactor validators module to extract the callback module * add submission test_has_prior_version_callback * implement and use include_previous_submission onUpdate callback * add ontology update_submissions_has_part test * implement and use ontology update_submissions_has_part callback * implement and use submission include_ontology_views validator * Update ontology_submission.yml Update ontology_submission.yml Update ontology_submission.yml Update ontology_submission.yml Update ontology_submission.yml Update ontology_submission.yml Update ontology_submission.yml Update ontology_submission.yml * Update Gemfile.luck to get the new version of Goo * fix some syntax issue the ontology_submission.yml file * add submission inverse ontology properties callbacks tests * implement and use ontology_inverse_of callback for useImports and usedBy * Update ontology_submission.yml labels : uri,homepage, natural language,langauge, publication Update ontology_submission.yml Labels => Documentation, version, Description, Status, Creation date, contact Update ontology_submission.yml adding labels : Number of classes, Number of individuals, Number of properties, Modification date, Number of individuals, Number of axioms or triples, Keywords, Key classes, Known usage, Notes, Knowledge representation paradigm Update ontology_submission.yml adding labels : Designed for task Update ontology_submission.yml Adding labels : Was generated by, curator, was invalidated by, Endorsed by, Funded or sponsored by, Translator, Subject, Formality level, License, Engineering methodology Update ontology_submission.yml Adding labels : Created With, Prior version, Imports, Created With, Incompatible, Backward compatible, Deprecated, Generally related to, Has equivalences with, Hidden or past name, Coverage, Publisher, Other identifier, Source Update ontology_submission.yml adding labels : Abstract, Has part (has views), Has format, Audience, SPARQL endpoint, Accrual policy, Accrual periodicity, Accrual method, Download URL, Free-text search endpoint, Competency question, logo, depiction, Disparate modelling with, To do list, Preferred namespace URI, Preferred namespace prefix,More permissions, Use guidelines, Curation date, Repository, Bug database, Mailing list, Example of resource, Rights holder, Associated media, Indexed or Included in catalog or repository * refactor and reorder submission attributes and group them by category * disable metadata extraction for hasOntologyLanguage attribute * update Gemfile.lock to get the latest version of Goo * fix syntax issues in the ontology_submission.yml file * enable submission creationDate automatic extraction * implement and use lexvo_language validator * add submission lexvo_language_validator test * remove no more needed concatenate, textarea and isOntology attributes enforce * remove submission metrics attributes and move them to the metrics model * set the default values callbacks to submissions attributes * don't show request language if @context is not enabled * Accrual periodicity values * IncludedInDataCatalog : enforcedValues * apply for some submission attributes ontologies_inverse_of callback * Add metadataMappings to properties Synchronize and consolidate the file * Add metadataMappings values Synchronize and consolidate the file * Add missing properties (Object description properties) & pullLocation * Add obsoleteParent property * Add Missing Metrics properties * fix json serializer nil exception (#79) if hash was missing @context key the json serializer throwed a nil exception * add some metrics attributes as embed values for Submissions * prevent a bug when an embed object is null (e.g submission with no metrics) * Feature: return requested languages in @language - part 2 - multiple langugaes (#80) * remove platform languages * set all to default in language params * upcase the requested language * support select multilanguage * return only existing language * extract get_languages * fix json serializer nil exception * access submission safely * refactor --------- Co-authored-by: Syphax bouazzouni * add get_languages and get_submission_languages helpers * use get_languages helper to get the current context language * extract get_language helper to get the requested language * get serialized object submission only if include 'submission' attribute (#85) * call to read_restricted? only if instance_to_base_on not nil * remove duplicated gzip? function * add zip_file function to the file utilities module * add archiving submission zipping old uploadedFile file test * add removing archived submission unzipped folder test * implement and extract the new archive action in the submission process * prevent interconnected tests of zipped_submission process tests * add archiving file size threshold for zipping uploaded file * fix ontology submission yaml file syntax issues * add AgentIdentifier model * add FOAF Agent model * update submission person and organization attributes to use Agent model * update Agent model to enforce name to be unique and an auto generated ID * disable extracting metadata for attributes of type * rename Agent 'type' to 'agentType' to not conflicts with JSON-LD @type * remove property: :pageHome form Agent model because it does not exist * make identifier model embded true * add read write access rules for agent and identifier models * remove firstName and lastName attribute from Agent model * enforce Agent affiliations to be all of type Organization * enforce Identifier notation attribute to not be a URL * add agent test for creation validity * enforce to show all attributes of the embed affiliations of Agents * add show_with_language param * update get_submission_languages * change identifier id to make be schemaAgency + notation * make agent identifiers list unique * make agent email attribute unique * make agent name no more unique * change agent affiliations attribute namespace to org:memberOf * fix identifier id to be nil if notation or agentType empty * make email agent attribute optional * add is_organizaion validator to agent and submission affiliation attributes * fix the class portal language test for the new multilanagual support Now when we ask a language we ether the values with the matching language, or nil or empty if not. Were before we had fallback to show the values in the others languages to not have empty fields * optimize request and portal lang tests by parsing the test ontology once * add test request all languages unit test * use the new getters argument to show languages * fix skos xl tests after the new multilangual support SKOS XL labels are tagged with a language so literal value is empty if it does not match the requested language but the object is still fetched and showed * add test for multilingual terms indexation and search * update SOLR terms schema to add dynamicFields for values in all langs * make the indexation use map_attributes with include_languages enabled * override the Ressource to_hash method in Class model to * update the indexed document of a class model to include the dynamic fields for values in other languages * rename the getters to show_all_languages argument to include_languages * add is_person validator to hasCreator and hasContributor attributes * embed all agents attributes for the submission model * fix submission deprecate_previous_submissions callback when no valid * refactor submission agent validators to extract common logic * update the include_ontology_views validator to test prefixed url id * add Agent type to submission endorsedBy attribute * remove URI type of submission usedOntologyEngineeringTool attribute * remove class type for exampleIdentifier and keyClasses attributes * check if object.class respond to attributes before calling it * check if the attribute method is a getter and not serialized method * check if the attribute method is a getter and not serialized method * use the same populate method as the attribute to show languages in properties also * use the same populate method as the attribute to show languages in properties also * Fix bug in authorization.rb * Improved support for OAuth 2.0 and SSO * bundle add oauth2 * remove duplicate find_apikey in the authorization call * add find_access_token method oauth2 authorization * add the unauthorized message the alternative text if oath2 enabled * add user oauth2 tests * enforce user email attribute to be unique * on user save (creation) send a notification if enabled in the arguments * add oauth2 providers configs * implement oauth2 providers token authentification * remove access token authorization to use only apikeys methods * fix tests after enforcing user email uniqueness * override security when sync user with an external provider * fix update_submissions_has_part callback to check if valid before saving * add uri type enforcement to submission URI attribute * disable attributes onUpdate callbacks feature * fix URI extraction process to enforce RDF::URI instead of string * fix test after URI enforced to be URI * disable complex attriubtes validators and callbacks * Update Object description properties Changed enforced values and definitons. * Remove enforced values for pullLocation * fix ontology submission attributes categories * disable complex validators tests * embed for submission model all the attributes of the object metrics * Fix: ontology submission metadata file rework (#108) * Template added at top of file * Consolidation of the "General" properties * Consolidation of "Licensing", "Description" and "Dates" * Consolidation of the "Person and orga" properties * Update ontology_submission.yml * Consolidation of the "Usage" and "Methodology" properties * Consolidation of the "object description properties" * Consolidated the Metrics properties * Consolidation of Links and Relations properties * Consolidation of Content and Media properties * Fix syntax error --------- Co-authored-by: Syphax bouazzouni * add usage method to the agent models (#109) * Fix multiple errors and syntax bugs in ontology_submission.ym file (#110) * Fix multiple errors and syntax bugs. * Update ontology_submission.yml * Fix: optimize fetch all agents usages query (#111) * add usage method to the agent models * optimize the agents usages query, to do batch loading when fetching all agents * Fix: the lexvo language validator to no check the iso version (#112) * update the lexvo language validator to no check the iso version * Fix: login auth type mail options (#113) * added mail options test to catch auth type case * fixed auth type mail options not being saved * Fix: ontology submisison "includedInDataCatalog" and "accrualMethod" metadata (#114) * fix includedInCatalog enforced values to be urls * update accrualMethod to no more be limited to URIs --------- Co-authored-by: HADDAD Zineddine Co-authored-by: DJEBABRIA Hiba <59914426+hibadjebabria169@users.noreply.github.com> Co-authored-by: Raimi Solorzano Niederhausen <44089477+RaimiSol@users.noreply.github.com> Co-authored-by: Clement Jonquet Co-authored-by: Guillaume Alviset <44084050+galviset@users.noreply.github.com> --- Gemfile | 2 + Gemfile.lock | 12 +- config/config.rb.sample | 20 + config/config.test.rb | 18 + config/schemes/ontology_submission.yml | 2249 ++++++++++------- .../concerns/mappings/mapping_creator.rb | 2 +- .../submission_metadata_extractor.rb | 2 +- .../submission_validators.rb | 37 +- lib/ontologies_linked_data/config/config.rb | 1 + .../models/agents/agent.rb | 50 +- lib/ontologies_linked_data/models/ontology.rb | 2 +- .../models/ontology_submission.rb | 67 +- .../models/users/oauth_authentication.rb | 191 ++ .../models/users/user.rb | 12 +- .../monkeypatches/object.rb | 15 +- .../security/authorization.rb | 152 +- lib/ontologies_linked_data/serializer.rb | 4 +- .../serializers/json.rb | 4 +- test/mappings/test_mappings_bulk_load.rb | 2 +- test/models/test_agent.rb | 99 +- test/models/test_ontology.rb | 14 +- test/models/test_ontology_submission.rb | 7 +- .../test_ontology_submission_validators.rb | 20 +- test/models/test_project.rb | 2 +- test/models/test_provisional_class.rb | 4 +- test/models/user/test_user_oauth.rb | 80 + test/rack/test_request_authorization.rb | 2 +- test/test_case.rb | 2 + 28 files changed, 1992 insertions(+), 1080 deletions(-) create mode 100644 lib/ontologies_linked_data/models/users/oauth_authentication.rb create mode 100644 test/models/user/test_user_oauth.rb diff --git a/Gemfile b/Gemfile index 07d0c8da..c9e868b1 100644 --- a/Gemfile +++ b/Gemfile @@ -20,6 +20,7 @@ gem 'rsolr', '~> 1.0' gem 'rubyzip', '~> 1.0' gem 'thin' gem 'request_store' +gem 'jwt' # Testing group :test do @@ -29,6 +30,7 @@ group :test do gem 'simplecov' gem 'simplecov-cobertura' # for codecov.io gem 'test-unit-minitest' + gem 'webmock' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 2228cc51..f1ba6511 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,6 +41,8 @@ GEM coderay (1.1.3) concurrent-ruby (1.2.2) connection_pool (2.4.1) + crack (0.4.5) + rexml cube-ruby (0.0.3) daemons (1.4.1) date (3.3.4) @@ -75,6 +77,7 @@ GEM faraday-rack (1.0.0) faraday-retry (1.0.3) ffi (1.16.3) + hashdiff (1.0.1) hashie (5.0.0) htmlentities (4.3.4) http-accept (1.7.0) @@ -84,6 +87,7 @@ GEM concurrent-ruby (~> 1.0) json (2.7.1) json_pure (2.7.1) + jwt (2.7.1) language_server-protocol (3.17.0.3) launchy (2.5.2) addressable (~> 2.8) @@ -196,6 +200,10 @@ GEM unicode-display_width (2.5.0) uuid (2.3.9) macaddr (~> 1.0) + webmock (3.19.1) + addressable (>= 2.8.0) + crack (>= 0.3.2) + hashdiff (>= 0.4.0, < 2.0.0) PLATFORMS x86_64-darwin-21 @@ -211,6 +219,7 @@ DEPENDENCIES faraday (~> 1.9) ffi goo! + jwt libxml-ruby (~> 2.0) minitest minitest-reporters (>= 0.5.0) @@ -232,6 +241,7 @@ DEPENDENCIES sparql-client! test-unit-minitest thin + webmock BUNDLED WITH - 2.3.26 + 2.4.21 diff --git a/config/config.rb.sample b/config/config.rb.sample index 31410611..0a0fedf0 100644 --- a/config/config.rb.sample +++ b/config/config.rb.sample @@ -19,6 +19,26 @@ LinkedData.config do |config| Goo.configure do |conf| conf.main_languages = ['en'] end + + #oauth + config.oauth_providers = { + github: { + check: :access_token, + link: 'https://api.github.com/user' + }, + keycloak: { + check: :jwt_token, + cert: 'KEYCLOAK_SECRET_KEY' + }, + orcid: { + check: :access_token, + link: 'https://pub.orcid.org/v3.0/me' + }, + google: { + check: :access_token, + link: 'https://www.googleapis.com/oauth2/v3/userinfo' + } + } end #sometimes tmp by default cannot allocate large files diff --git a/config/config.test.rb b/config/config.test.rb index e4a628ac..34a92500 100644 --- a/config/config.test.rb +++ b/config/config.test.rb @@ -33,4 +33,22 @@ config.property_search_server_url = SOLR_PROP_SEARCH_URL.to_s config.sparql_endpoint_url = "http:://sparql_endpoint.com" # config.enable_notifications = false + config.oauth_providers = { + github: { + check: :access_token, + link: 'https://api.github.com/user' + }, + keycloak: { + check: :jwt_token, + cert: 'KEYCLOAK_SECRET_KEY' + }, + orcid: { + check: :access_token, + link: 'https://pub.orcid.org/v3.0/me' + }, + google: { + check: :access_token, + link: 'https://www.googleapis.com/oauth2/v3/userinfo' + } + } end \ No newline at end of file diff --git a/config/schemes/ontology_submission.yml b/config/schemes/ontology_submission.yml index 473e2873..e992334c 100644 --- a/config/schemes/ontology_submission.yml +++ b/config/schemes/ontology_submission.yml @@ -1,323 +1,127 @@ -URI: - extractedMetadata: true - label: "URI identifier" - helpText: "The URI of the ontology which is described by this metadata." - description: [ "OMV: The URI of the ontology which is described by these metadata." ] - display: "general" - example: 'https://w3id.org/myontto' -homepage: - extractedMetadata: true - metadataMappings: [ "cc:attributionURL", "mod:homepage", "doap:blog", "schema:mainEntityOfPage" ] - helpText: "The URL of the homepage for the ontology." - label: "Homepage" +###Template -hasOntologyLanguage: - extractedMetadata: false - display: 'general' - description: [ "SCHEMA: Media type, typically MIME format (see IANA site) of the content, e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, 'encoding' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.", "MOD: A language that is used to create an ontology." ] - label: "Language" +#propname: +# display: "general" / +# label: "" +# helpText: "" +# example: '' +# description: [ +# "ACRO: description.", +# "ACRO: description." ] +# extractedMetadata: true / false +# enforcedValues: { +# "..", +# ".." } +# metadataMappings: [ "ns:propname", ".." ] -publication: - extractedMetadata: true - description: [ "SCHEMA: A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.","DCTERMS: A bibliographic reference for the resource.","OMV: List of bibliographic references describing the ontology and its applications.","FOAF: A document that this thing is the primary topic of" ] - helpText: "The URL of bibliographic reference for the ontology." - metadataMappings: [ "omv:reference", "dct:bibliographicCitation", "foaf:isPrimaryTopicOf", "schema:citation", "cito:citesAsAuthority", "schema:citation" ] - label: "Publication" +# AgroPortal properties ordered as MOD file -naturalLanguage: +### General + +#Acronym => Ontology object (omv:acronym) +#Name => Ontology object (omv:name) + +#URI +URI: + display: "general" + label: "URI" + helpText: "The URI of the ontology which is described by these metadata." + example: 'https://w3id.org/myontology' + description: [ + "OMV: The URI of the ontology which is described by these metadata.", + "MOD: The Unique Resoource Identifier of this ontology, assigned by responsible authority."] extractedMetadata: true - description: [ "DUBLIN CORE: A language of the resource.","SCHEMA: The language of the content or performance or used in an action. Please use one of the language codes from the IETF BCP 47 standard. See also availableLanguage.","DOAP: ISO language code a project has been translated into." ] - metadataMappings: [ "dc:language", "dct:language", "doap:language", "schema:inLanguage" ] - helpText: "The language of the content of the ontology.<br>Consider using a <a target="_blank" href="http://www.lexvo.org/">Lexvo URI</a> with ISO639-3 code.<br>e.g.: http://lexvo.org/id/iso639-3/eng" - enforcedValues: { - "http://lexvo.org/id/iso639-3/eng": "English", - "http://lexvo.org/id/iso639-3/fra": "French", - "http://lexvo.org/id/iso639-3/spa": "Spanish", - "http://lexvo.org/id/iso639-3/por": "Portuguese", - "http://lexvo.org/id/iso639-3/ita": "Italian", - "http://lexvo.org/id/iso639-3/deu": "German" } - label: "Natural language" + metadataMappings: [ "mod:URI", "omv:URI" ] -documentation: +#Version IRI +versionIRI: + display: "general" + label: "Version IRI" + helpText: "The property that identifies the version IRI of an ontology." + example: 'https://w3id.org/myontology/3.2.0' + description: [ + "OWL: The property that identifies the version IRI of an ontology." ] extractedMetadata: true - description: [ "DCTERMS: A link to the documentation page on a thing","DCAT: A Web page that can be navigated to in a Web browser to gain access to the dataset, its distributions and/or additional information.", "OMV: URL for further documentation.","RDFS: Further information about the subject resource.", "DOAP: URL of Wiki for collaborative discussion of project. ","VANN: A reference to a resource that provides information on how this resource is to be used","MOD: A link to the documentation page on a thing." ] - metadataMappings: [ "rdfs:seeAlso", "foaf:page", "vann:usageNote", "mod:document", "dcat:landingPage", "doap:wiki" ] - helpText: "URL for further documentation." - label: "Documentation" + +#Version information version: - extractedMetadata: true - helpText: "The version of the released ontology" - metadataMappings: [ "owl:versionInfo", "mod:version", "doap:release", "pav:version", "schema:version", "oboInOwl:data-version", "oboInOwl:version", "adms:last" ] - description: [ "MOD: The version of the released ontology.", - "SCHEMA: The version of the CreativeWork embodied by a specified resource.", - "OMV: The version information of the ontology.", - "OWL: The annotation property that provides version information for an ontology or another OWL construct. ", - "PAV: The version number of a resource.", - "DOAP: A project release", - "ADMS : A link to the current or latest version of the Asset" ] + display: 'general' + label: "Version information" + helpText: "The version information of the ontology." example: "v.3.2.0" - label: "Version" -description: - label: "Description" - extractedMetadata: true - description: [ "DCTERMS: An account of the resource","SCHEMA: A description of the item.","OMV: Free text description of an ontology.","DOAP: Plain text description of a project, of 2-4 sentences in length.","RDFS: A human-readable description of a resource." ] - helpText: "Free text description of the ontology." - metadataMappings: [ "dc:description", "dct:description", "doap:description", "schema:description", "oboInOwl:remark" ] - + description: [ + "OMV: The version information of the ontology.", + "MOD: The current version of the ontology. Possibly using Semantic versioning.", + "OWL: The annotation property that provides version information for an ontology or another OWL construct. ", + "PAV: The version number of a resource.", + "DOAP: A project release", + "SCHEMA: The version of the CreativeWork embodied by a specified resource."] + extractedMetadata: true + metadataMappings: [ "omv:version", "mod:version", "owl:versionInfo", "pav:version", "doap:release", "schema:version", "oboInOwl:data-version", "oboInOwl:version" ] + +#Status status: - extractedMetadata: true + display: "general" label: "Status" - metadataMappings: [ "adms:status", "idot:state" ] - helpText: "Information about the ontology status (alpha, beta, production, retired)." - enforcedValues: [ "alpha", "beta", "production", "retired" ] + helpText: "The status of the current version of the ontology (alpha, beta, production, retired)." + example: 'production' + description: [ + "MOD: The status of the current version of the ontology (alpha, beta, production, retired).", + "OMV: It specifies the tracking information for the contents of the ontology. Pre-defined values.", + "IDOT: State of a resource (physical location providing access to data or information about the identified entity). This should be based on a recent manual or automatic check of the resource. Possible values are: 'up', 'down', 'probably up', 'obsolete resource', 'restricted access' and 'unknown'.", + "ADMS : Links to the status of the Asset or Asset Distribution in the context of a particular workflow process. Since Status is defined using a skos:Concept, that is the defined range for this property." ] + extractedMetadata: true + enforcedValues: [ + "alpha", + "beta", + "production", + "retired" ] + metadataMappings: [ "omv:status", "mod:status", "adms:status", "idot:state" ] + +#Deprecated +deprecated: display: "general" - description: [ "OMV: It specifies the tracking information for the contents of the ontology. Pre-defined values.", - "IDOT: State of a resource (physical location providing access to data or information about the identified entity). This should be based on a recent manual or automatic check of the resource. Possible values are: 'up', 'down', 'probably up', 'obsolete resource', 'restricted access' and 'unknown'.", - "ADMS : Links to the status of the Asset or Asset Distribution in the context of a particular workflow process. Since Status is defined using a skos:Concept, that is the defined range for this property" - ] - -contact: - helpText: "The people to contact when questions about the ontology. Composed of the contacts name and email." - label: "Contact" - description: "DCAT: Relevant contact information for the cataloged resource. Use of vCard is recommended" - -creationDate: - extractedMetadata: true - description: [ "DCTERMS: Date of submission of the resource.", "SCHEMA: Date of first broadcast/publication." ] - metadataMappings: [ "dct:dateSubmitted", "schema:datePublished" ] - label: "Creation date" - -released: - extractedMetadata: true - description: [ "DCTERMS: Date of submission of the resource.", - "SCHEMA: Date of first broadcast/publication." ] - label: "Release date" - helpText: "Date of the ontology release." - metadataMappings: [ "omv:creationDate", "dc:date", "dct:date", "dct:issued", "mod:creationDate", "doap:created", "schema:dateCreated","prov:generatedAtTime", "pav:createdOn", "pav:authoredOn", "pav:contributedOn", "oboInOwl:date", "oboInOwl:hasDate" ] - - -numberOfClasses: - metadataMappings: [ "void:classes", "voaf:classNumber", "mod:noOfClasses" ] - description: [ "MOD: The total number of classes in an ontology.", - "OMV: Number of classes in ontology.", - "VOAF: The number of classes defined in the vocabulary namespace. Classes imported from other namespaces are not taken into account.", - "VOID: The total number of distinct classes in a void:Dataset. In other words, the number of distinct resources occurring as objects of rdf:type." ] - display: "metrics" - helpText: "Number of classes in this ontology. Automatically computed by OWLAPI." - label: "Number of classes" - -numberOfIndividuals: - metadataMappings: [ "mod:noOfIndividuals" ] - description: [ "MOD: The total number of individuals in an ontology.", - "OMV: Number of individuals in the ontology.", - "VOID: The total number of entities that are described in a void:Dataset." ] - display: "metrics" - helpText: "Number of individuals in this ontology. Automatically computed by OWLAPI." - label: "Number of individuals" - -numberOfProperties: - metadataMappings: [ "void:properties", "voaf:propertyNumber", "mod:noOfProperties" ] - description: [ "MOD: The total number of properties in an ontology.", - "OMV: Number of properties in the ontology.", - "VOAF: The number of properties defined in the vocabulary namespace. Properties imported from other namespaces are not taken into account.", - "VOID: The total number of distinct properties in a void:Dataset. In other words, the number of distinct resources that occur in the predicate position of triples in the dataset." ] - display: "metrics" - helpText: "Number of properties in this ontology. Automatically computed by OWLAPI." - label: "Number of properties" - - -modificationDate: - extractedMetadata: true - description: [ "DCTERMS: Date on which the resource was changed", - "SCHEMA: The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed.", - "OMV: Date of the last modification made to the ontology", - "PAV: The date of the last update of the resource" ] - metadataMappings: [ "dct:modified", "schema:dateModified", "pav:lastUpdateOn", "mod:updated" ] - helpText: "Date of the last modification made to the ontology" - label: "Modification date" - -entities: - extractedMetadata: true - description: [ "VOID: The total number of entities that are described in a void:Dataset." ] - label: "Number of entities" - display: "metrics" - helpText: "Number of entities in this ontology." - -numberOfAxioms: - extractedMetadata: true - description: [ "MOD: The total number of axioms in an ontology.", - "OMV: Number of axioms in ontology." ] - metadataMappings: [ "mod:noOfAxioms", "void:triples" ] - display: "metrics" - helpText: "Number of axioms in this ontology." - label: "Number of axioms or triples" - -keyClasses: - extractedMetadata: false - description: [ "OMV: Representative classes in the ontology.", - "FOAF: The primary topic of some page or document.", - "SCHEMA: Indicates the primary entity described in some page or other CreativeWork." ] - display: "content" - metadataMappings: [ "foaf:primaryTopic", "void:exampleResource", "schema:mainEntity" ] - helpText: "Representative classes in the ontology." - label: "Key classes" - -keywords: - extractedMetadata: true - description: [ "DCTERMS: A keyword(s) is used to describe the content of an ontology", - "SCHEMA: Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.", - "OMV: List of keywords related to an ontology.", - "DCAT: A keyword or tag describing a resource.", - "MOD: A keyword(s) is used to describe the content of an ontology." ] - helpText: "List of keywords related to the ontology." - metadataMappings: [ "mod:keyword", "dcat:keyword", "schema:keywords" ] - label: "Keywords" - -knownUsage: - extractedMetadata: true - description: [ "OMV: The applications where the ontology is being used." ] - display: "usage" - helpText: "The applications where the ontology is being used." - example: "Used to annotate phenotypes and patterns of gene expression" - label: "Known usage" - -notes: - extractedMetadata: true - description: [ "RDFS: A description of the subject resource.", - "OMV: Additional information about the ontology that is not included somewhere else (e.g. information that you do not want to include in the documentation)." ] - metadataMappings: [ "rdfs:comment", "adms:versionNotes" ] - helpText: "Additional information about the ontology that is not included somewhere else (e.g. information that you do not want to include in the documentation)." - label: "Notes" - -conformsToKnowledgeRepresentationParadigm: - extractedMetadata: true - description: [ "MOD: A representation formalism that is followed to describe knowledge in an ontology. Example includes description logics, first order logic, etc.", - "OMV: Information about the paradigm model used to create the ontology.", - "DCTERMS: An established standard to which the described resource conforms." ] - metadataMappings: [ "mod:KnowledgeRepresentationFormalism", "dct:conformsTo" ] - display: "methodology" - helpText: "A representation formalism that is followed to describe knowledge in an ontology. Example includes description logics, first order logic, etc." - label: "Knowledge representation paradigm" - -hasContributor: - extractedMetadata: false - description: [ "DCTERMS: An entity responsible for making contributions to the resource", - "SCHEMA: A secondary contributor to the CreativeWork or Event.", - "OMV: Contributors to the creation of the ontology.", - "PAV: The resource was contributed to by the given agent.", - "SCHEMA: A secondary contributor to the CreativeWork or Event.", - "DOAP: Project contributor", - "OMV: Contributors to the creation of the ontology" ] - label: "Contributors" - metadataMappings: [ "dc:contributor", "dct:contributor", "doap:helper", "schema:contributor", "pav:contributedBy" ] - helpText: "Contributors to the creation of the ontology." - -hasCreator: - extractedMetadata: false - description: [ "OMV: Main responsible for the creation of the ontology", - "DCTERMS: An entity primarily responsible for making the resource", - "FOAF: An agent that made this thing", - "PROV: Attribution is the ascribing of an entity to an agent.", - "PAV: An agent that originated or gave existence to the work that is expressed by the digital resource.", - "PAV: An agent primary responsible for making the digital artifact or resource representation.", - "DOAP: Maintainer of a project, a project leader.", - "SCHEMA: The author of this content or rating." ] - label: "Creators" - metadataMappings: [ "dc:creator", "dct:creator", "foaf:maker", "prov:wasAttributedTo", "doap:maintainer", "pav:authoredBy", "pav:createdBy", "schema:author", "schema:creator" ] - helpText: "Main responsible for the creation of the ontology." - -designedForOntologyTask: - extractedMetadata: true - description: [ "DCTERMS: The purpose for which the ontology was originally designed", - "OMV: The purpose for which the ontology was originally designed." ] - display: "usage" - label: "Designed for task" - helpText: "The purpose for which the ontology was originally designed." - enforcedValues: { - "http://omv.ontoware.org/2005/05/ontology#AnnotationTask": "Annotation Task", - "http://omv.ontoware.org/2005/05/ontology#ConfigurationTask": "Configuration Task", - "http://omv.ontoware.org/2005/05/ontology#FilteringTask": "Filtering Task", - "http://omv.ontoware.org/2005/05/ontology#IndexingTask": "Indexing Task", - "http://omv.ontoware.org/2005/05/ontology#IntegrationTask": "Integration Task", - "http://omv.ontoware.org/2005/05/ontology#MatchingTask": "Matching Task", - "http://omv.ontoware.org/2005/05/ontology#MediationTask": "Mediation Task", - "http://omv.ontoware.org/2005/05/ontology#PersonalizationTask": "Personalization Task", - "http://omv.ontoware.org/2005/05/ontology#QueryFormulationTask": "Query Formulation Task", - "http://omv.ontoware.org/2005/05/ontology#QueryRewritingTask": "Query Rewriting Task", - "http://omv.ontoware.org/2005/05/ontology#SearchTask": "Search Task" - } - -wasGeneratedBy: - extractedMetadata: true - description: [ "PROV: Generation is the completion of production of a new entity by an activity. This entity did not exist before generation and becomes available for usage after this generation" ] - display: "people" - label: "Was generated by" - helpText: "People who generated the ontology." - -wasInvalidatedBy: - extractedMetadata: true - label: "Was invalidated by" - description: [ "PROV: Invalidation is the start of the destruction, cessation, or expiry of an existing entity by an activity" ] - display: "people" - helpText: "People who invalidated the ontology." - -curatedBy: - extractedMetadata: false - description: [ "PAV: Specifies an agent specialist responsible for shaping the expression in an appropriate format. Often the primary agent responsible for ensuring the quality of the representation.", - "MOD: A curator who restructure the previously authored content and shape it to be appropriate for the intended representation (e.g. by normalizing the fields for being represented in a spreadsheet)." ] - display: "people" - label: "Curator" - metadataMappings: [ "mod:evaluatedBy" ] - helpText: "People who curated the ontology." - example: 'Yvonne M. Bradford (0000-0002-9900-7880)' - -endorsedBy: - extractedMetadata: false - label: "Endorsed by" - description: [ "MOD: An ontology endorsed by an agent.", - "OMV: The parties that have expressed support or approval to this ontology." ] - metadataMappings: [ "mod:endorsedBy" ] - helpText: "The parties that have expressed support or approval to this ontology" - display: "people" - example: 'INRAE (003vg9w96)' - -fundedBy: - extractedMetadata: false - label: "Funded or sponsored by" - description: [ "MOD: An ontology that is sponsored by and developed under a project.", - "FOAF: An organization funding a project or person.", - "SCHEMA: The Organization on whose behalf the creator was working." ] - metadataMappings: [ "mod:sponsoredBy", "schema:sourceOrganization" ] - display: "people" - helpText: "The organization funding the ontology development." - example: [ 'Yvonne M. Bradford (0000-0002-9900-7880','INRAE (003vg9w96)' ] - -translator: + label: "Deprecated" + helpText: "The annotation property that indicates that a given entity has been deprecated." + example: 'false' + description: [ + "OWL: The annotation property that indicates that a given entity has been deprecated.", + "MOD: The classes and properties of an ontology that are no longer in use.", + "IDOT: Indicates if the current dataset is obsolete (not provided any more to the public community). Value can either be 'true' or 'false' (xsd:boolean). The statement is usually omitted if 'false'.", + "DCAT: An annotation with the owl:deprecated annotation property and the value equal to \"true\"^^xsd:boolean can be used to specify that an IRI is deprecated" ] + extractedMetadata: true + enforcedValues: [ + "true", + "false" ] + metadataMappings: [ "owl:deprecated", "mod:obsolete", "idot:obsolete" ] + +#Representation language +hasOntologyLanguage: + display: "general" + label: "Representation language" + helpText: "The ontology language." + description: [ + "MOD: A representation language that is used to create an ontology (e.g., OWL, RDF-S, SKOS).", + "OMV: The ontology language.", + "SCHEMA : Media type, typically MIME format (see IANA site) of the content." ] extractedMetadata: false - label: "Translator" - description: "SCHEMA: Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event." - metadataMappings: [ "doap:translator" ] - display: "people" - helpText: "Organization or person who adapted the ontology to different languages, regional differences and technical requirements" - -hasDomain: - extractedMetadata: true - label: "Subject" - description: [ "DCTERMS: The topic of the resource.", - "SCHEMA: The subject matter of the content.", - "FOAF: A topic of some page or document.", - "OMV: Typically, the domain can refer to established topic hierarchies such as the general purpose topic hierarchy DMOZ or the domain specific topic hierarchy ACM for the computer science domain", - "DCAT: A main category of the resource." ] - helpText: "Typically, the domain can refer to established topic hierarchies such as the general purpose topic hierarchy DMOZ or the domain specific topic hierarchy ACM for the computer science domain" - metadataMappings: [ "dc:subject", "dct:subject", "foaf:topic", "dcat:theme", "schema:about" ] - display: "usage" - + enforcedValues: [ + "OBO", + "OWL", + "SKOS", + "UMLS" ] + metadataMappings: [ "mod:hasRepresentationLanguage", "omv:hasOntologyLanguage", "schema:fileFormat" ] + +#Formality level hasFormalityLevel: - extractedMetadata: true + display: "general" label: "Formality level" - metadataMappings: [ "mod:ontologyFormalityLevel" ] helpText: "Level of formality of the ontology." + description: [ + "MOD: The level of formality of an ontology (as defined by the NKOS KOS Types Vocabulary).", + "OMV: Level of formality of the ontology." ] + extractedMetadata: true enforcedValues: { "http://w3id.org/nkos/nkostype#classification_schema": "Classification scheme", "http://w3id.org/nkos/nkostype#dictionary": "Dictionary", @@ -333,38 +137,18 @@ hasFormalityLevel: "http://w3id.org/nkos/nkostype#terminology": "Terminology", "http://w3id.org/nkos/nkostype#thesaurus": "Thesaurus" } - display: "general" - description: "OMV: The level of formality of an ontology." - - -hasLicense: - extractedMetadata: true - label: "License" - description: [ "CC: A Work has a License.", - "DC: Information about rights held in and over the resource.", - "SCHEMA: A license document that applies to this content, typically indicated by URL.", - "DCTERMS: A legal document giving official permission to do something with the resource. Recommended practice is to identify the license document with a URI. If this is not possible or feasible, a literal value that identifies the license may be provided.", - "OMV: Underlying license model." ] - metadataMappings: [ "dc:rights", "dct:rights", "dct:license", "cc:license", "schema:license" ] - helpText: "Underlying license model.<br>Consider using a <a target="_blank" href="http://rdflicense.appspot.com/">URI to describe your License</a><br>Consider using a <a target="_blank" href="http://licentia.inria.fr/">INRIA licentia</a> to choose your license" - enforcedValues: { - "https://creativecommons.org/licenses/by/4.0/": "CC Attribution 4.0 International", - "https://creativecommons.org/licenses/by/3.0/": "CC Attribution 3.0", - "https://creativecommons.org/publicdomain/zero/1.0/": "CC Public Domain Dedication", - "http://www.gnu.org/licenses/gpl-3.0": "GNU General Public License 3.0", - "http://www.gnu.org/licenses/gpl-2.0": "GNU General Public License 2.0", - "https://opensource.org/licenses/Artistic-2.0": "Open Source Artistic license 2.0", - "https://opensource.org/licenses/MIT": "MIT License", - "https://opensource.org/licenses/BSD-3-Clause": "BSD 3-Clause License", - "http://www.apache.org/licenses/LICENSE-2.0": "Apache License 2.0" - } - + metadataMappings: [ "omv:hasFormalityLevel", "mod:formalityLevel" ] +#Syntax hasOntologySyntax: + display: "general" + label: "Syntax" + helpText: "The presentation syntax for the ontology langage." + description: [ + "MOD: The syntax of this current ontology distribution (as defined by W3C formats).", + "OMV: The presentation syntax for the ontology langage.", + "DCTERMS : The file format, physical medium, or dimensions of the resource." ] extractedMetadata: true - metadataMappings: [ "mod:syntax", "dc:format", "dct:format" ] - label: "Ontology Syntax" - helpText: "The presentation syntax for the ontology langage.<br>Properties taken from <a target="_blank" href="https://www.w3.org/ns/formats/">W3C URIs for file format</a>" enforcedValues: { "http://www.w3.org/ns/formats/JSON-LD": "JSON-LD", "http://www.w3.org/ns/formats/N3": "N3", @@ -386,15 +170,45 @@ hasOntologySyntax: "http://www.w3.org/ns/formats/TriG": "TriG", "http://purl.obolibrary.org/obo/oboformat/spec.html": "OBO" } - description: [ "DUBLIN CORE: The file format, physical medium, or dimensions of the resource.", "MOD: The syntax followed in the creation of an ontology." ] + metadataMappings: [ "omv:hasOntologySyntax", "mod:hasSyntax", "dc:format", "dcterms:format" ] -isOfType: +#Natural language +naturalLanguage: + display: "general" + label: "Natural language" + helpText: "The language of the content of the ontology (with values in Lexvo/iso639-1)." + description: [ + "DCTERMS: A language of the resource. Recommended practice is to use either a non-literal value representing a language from a controlled vocabulary such as ISO 639-2 or ISO 639-3, or a literal value consisting of an IETF Best Current Practice 47 language tag.", + "OMV: The language of the content of the ontology, i.e. English, French, etc.", + "DOAP: ISO language code a project has been translated into.", + "SCHEMA: The language of the content or performance or used in an action. Please use one of the language codes from the IETF BCP 47 standard." ] extractedMetadata: true - description: [ "OMV: The nature of the content of the ontology ", + enforcedValues: { + "http://lexvo.org/id/iso639-1/en": "English", + "http://lexvo.org/id/iso639-1/fr": "French", + "http://lexvo.org/id/iso639-1/es": "Spanish", + "http://lexvo.org/id/iso639-1/pt": "Portuguese", + "http://lexvo.org/id/iso639-1/it": "Italian", + "http://lexvo.org/id/iso639-1/de": "German", + "http://lexvo.org/id/iso639-1/ar": "Arabic", + "http://lexvo.org/id/iso639-1/zh": "Chinese", + "http://lexvo.org/id/iso639-1/hi": "Hindi", + "http://lexvo.org/id/iso639-1/nl": "Dutch", + "http://lexvo.org/id/iso639-1/fi": "Finnish", + "http://lexvo.org/id/iso639-1/el": "Greek", + "http://lexvo.org/id/iso639-1/ja": "Japanese" + } + metadataMappings: [ "omv:naturalLanguage", "dc:language", "dcterms:language", "doap:language", "schema:inLanguage" ] + +#Generic type +isOfType: + display: "general" + label: "Generic type" + helpText: "The nature of the content of the ontology." + description: [ + "OMV: The nature of the content of the ontology.", "DCTERMS: The nature or genre of the resource." ] - metadataMappings: [ "dc:type", "dct:type" ] - label: "Generic Type" - helpText: "The nature of the content of the ontology.<br>Properties taken from <a target="_blank" href="http://wiki.dublincore.org/index.php/NKOS_Vocabularies#KOS_Types_Vocabulary">DCMI KOS type vocabularies</a>" + extractedMetadata: true enforcedValues: { "http://omv.ontoware.org/2005/05/ontology#ApplicationOntology": "Application Ontology", "http://omv.ontoware.org/2005/05/ontology#CoreOntology": "Core Ontology", @@ -403,289 +217,589 @@ isOfType: "http://omv.ontoware.org/2005/05/ontology#UpperLevelOntology": "Upper Level Ontology", "http://omv.ontoware.org/2005/05/ontology#Vocabulary": "Vocabulary" } - -usedOntologyEngineeringMethodology: + metadataMappings: [ "omv:isOfType", "dc:type", "dcterms:type" ] + +#Other identifier +identifier: + display: "general" + label: "Other identifier" + helpText: "An unambiguous reference to the resource within a given context. Recommended practice is to identify the resource by means of a string conforming to an identification system." + example: 'https://doi.org/10.15454/1.4690062322351956E12' + description: [ + "DCTERMS: An unambiguous reference to the resource within a given context. Recommended practice is to identify the resource by means of a string conforming to an identification system. Examples include International Standard Book Number (ISBN), Digital Object Identifier (DOI), and Uniform Resource Name (URN). Persistent identifiers should be provided as HTTP URIs.", + "SKOS: A notation is a string of characters such as\"T58.5\"or\"303.4833\"used to uniquely identify a concept within the scope of a given concept scheme.", + "ADMS: adms:identifier is used to link any resource to an instance of adms:Identifier which is its range. N.B. it is not appropriate to use dcterms:identifer to link to the Identifier class as its range is rdfs:Literal. ADMS uses this to provide any identifier for the Asset.", + "SCHEMA: The identifier property represents any kind of identifier for any kind of Thing, such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. " ] extractedMetadata: true - label: "Engineering methodology" - description: [ "MOD: A methodology following which an ontology is created", - "SCHEMA: The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual, e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies.", - "ADMS: More information about the format in which an Asset Distribution is released. This is different from the file format as, for example, a ZIP file (file format) could contain an XML schema (representation technique)." ] - metadataMappings: [ "mod:methodologyUsed", "adms:representationTechnique", "schema:publishingPrinciples" ] - display: "methodology" - helpText: "Information about the method model used to create the ontology" + metadataMappings: [ "dc:identifier", "dcterms:identifier", "skos:notation", "adms:identifier" ] + -usedOntologyEngineeringTool: +### Licensing + +#Access rights => Ontology object (bpm:viewingRestriction) + +#License +hasLicense: + display: "licensing" + label: "License" + helpText: "A legal document giving official permission to do something with the resource. Recommended practice is to identify the license document with a URI. " + description: [ + "DCTERMS: A legal document giving official permission to do something with the resource. Recommended practice is to identify the license document with a URI. If this is not possible or feasible, a literal value that identifies the license may be provided.", + "OMV: Underlying license model.", + "SCHEMA: A license document that applies to this content, typically indicated by URL.", + "CC: A Work has a License.", + "DC: Information about rights held in and over the resource." ] extractedMetadata: true - label: "Created With" - description: [ "PAV: The software/tool used by the creator (pav:createdBy) when making the digital resource, for instance a word processor or an annotation tool.", - "MOD: The tool used for the creation of an ontology.", - "OMV: Information about the tool used to create the ontology." ] - metadataMappings: [ "mod:toolUsed", "pav:createdWith", "oboInOwl:auto-generated-by" ] - helpText: "Information about the tool used to create the ontology" enforcedValues: { - "http://protege.stanford.edu": "Protégé", - "OWL API": "OWL API", - "http://oboedit.org/": "OBO-Edit", - "SWOOP": "SWOOP", - "OntoStudio": "OntoStudio", - "Altova": "Altova", - "SemanticWorks": "SemanticWorks", - "OilEd": "OilEd", - "IsaViz": "IsaViz", - "WebODE": "WebODE", - "OntoBuilder": "OntoBuilder", - "WSMO Studio": "WSMO Studio", - "VocBench": "VocBench", - "TopBraid": "TopBraid", - "NeOn-Toolkit": "NeOn-Toolkit" + "https://creativecommons.org/licenses/by/4.0/": "CC Attribution 4.0 International", + "https://creativecommons.org/licenses/by/3.0/": "CC Attribution 3.0", + "https://creativecommons.org/publicdomain/zero/1.0/": "CC Public Domain Dedication", + "http://www.gnu.org/licenses/gpl-3.0": "GNU General Public License 3.0", + "http://www.gnu.org/licenses/gpl-2.0": "GNU General Public License 2.0", + "https://opensource.org/licenses/Artistic-2.0": "Open Source Artistic license 2.0", + "https://opensource.org/licenses/MIT": "MIT License", + "https://opensource.org/licenses/BSD-3-Clause": "BSD 3-Clause License", + "http://www.apache.org/licenses/LICENSE-2.0": "Apache License 2.0" } + metadataMappings: [ "dc:rights", "dcterms:rights", "dcterms:license", "cc:license", "schema:license" ] -useImports: +#Use guidelines +useGuidelines: + display: "licensing" + label: "Use guidelines" + helpText: "A related resource which defines how the ontology should be used." + description: [ + "CC: A related resource which defines non-binding use guidelines for the work." ] extractedMetadata: true - label: "Imports" - description: [ "OWL: References another OWL ontology containing definitions, whose meaning is considered to be part of the meaning of the importing ontology.", - "OMV: References another ontology metadata instance that describes an ontology containing definitions, whose meaning is considered to be part of the meaning of the ontology described by this ontology metadata instance.", - "DCTERMS: A related resource that is required by the described resource to support its function, delivery, or coherence.", - "VOAF: Indicates that the subject vocabulary extends the expressivity of the object vocabulary by declaring subsumption relationships, using object vocabulary class as domain or range of a subject vocabulary property, defining local restrictions etc ...." ] - metadataMappings: [ "owl:imports", "door:imports", "void:vocabulary", "voaf:extends", "dct:requires", "oboInOwl:import" ] - helpText: "References another ontology metadata instance that describes an ontology containing definitions, whose meaning is considered to be part of the meaning of the ontology described by this ontology metadata instance" -hasPriorVersion: +#More permissions +morePermissions: + display: "licensing" + label: "More permissions" + helpText: "A related resource which describes additional permissions or alternative licenses." + description: [ + "CC: A related resource which describes additional permissions or alternative licenses for a Work which may be available." ] extractedMetadata: true - label: "Prior version" - description: [ "OWL: This identifies the specified ontology as a prior version of the containing ontology.", - "OMV: Contains a reference to another ontology metadata instance.", - "DCTERMS: A related resource of which the described resource is a version, edition, or adaptation.", - "PROV: A revision is a derivation for which the resulting entity is a revised version of some original. The implication here is that the resulting entity contains substantial content from the original.", - "DOOR: Prior version relation from OWL.", - "ADMS: A link to the previous version of the Asset" ] - metadataMappings: [ "owl:priorVersion", "dct:isVersionOf", "door:priorVersion", "prov:wasRevisionOf", "adms:prev", "pav:previousVersion", "pav:hasEarlierVersion" ] - helpText: "An URI to the prior version of the ontology" - example: 'http://data.agroportal.lirmm.fr/ontologies/GO/submissions/208' + +#Rights holder +copyrightHolder: + display: "licensing" + label: "Rights holder" + helpText: "The party holding the legal copyright to the ontology." + description: [ + "SCHEMA: The party holding the legal copyright to the CreativeWork.", + "DCTERMS: A person or organization owning or managing rights over the resource." ] + extractedMetadata: false + +### Description -isBackwardCompatibleWith: +#Description +description: + display: "description" + label: "Description" + helpText: "Free text description of an ontology." + example: '' + description: [ + "DCTERMS: An account of the resource.", + "SCHEMA: A description of the item.", + "OMV: Free text description of an ontology.", + "DOAP: Plain text description of a project, of 2-4 sentences in length.","RDFS: A human-readable description of a resource." ] extractedMetadata: true - label: "Backward compatible" - description: [ "OWL: This identifies the specified ontology as a prior version of the containing ontology, and further indicates that it is backward compatible with it.", - "OMV: The ontology metadata instance which describes an ontology that is a compatible prior version of the ontology described by this ontology metadata Instance.", - "DOOR: The relation of being a compatible new version from owl" ] - metadataMappings: [ "owl:backwardCompatibleWith", "door:backwardCompatibleWith" ] - display: "relations" - helpText: "URI of an ontology that has its prior version compatible with the described ontology" + metadataMappings: [ "omv:description", "dc:description", "dcterms:description", "doap:description", "schema:description", "oboInOwl:remark" ] -isIncompatibleWith: +#Homepage +homepage: + display: "description" + label: "Homepage" + helpText: "Ontology homepage." + description: [ + "FOAF: A homepage for some thing.", + "MOD: An unambiguous reference to the resource within a given context.", + "DOAP: URI of a blog related to a project.", + "CC: The URL the creator of a Work would like used when attributing re-use.", + "SCHEMA: Indicates a page (or other CreativeWork) for which this thing is the main entity being described." ] extractedMetadata: true - label: "Incompatible" - description: [ "OWL: This indicates that the containing ontology is a later version of the referenced ontology, but is not backward compatible with it.", - "OMV: The described ontology is a later version of the ontology described by the metadata specified, but is not backward compatible with it. It can be used to explicitly state that ontology cannot upgrade to use the new version without checking whether changes are required." ] - metadataMappings: [ "owl:incompatibleWith", "door:owlIncompatibleWith" ] - display: "relations" - helpText: "URI of an ontology that is a prior version of this ontology, but not compatible" + metadataMappings: [ "foaf:homepage", "cc:attributionURL", "mod:homepage", "doap:blog", "schema:mainEntityOfPage" ] -deprecated: +#Documentation +documentation: + display: "description" + label: "Documentation" + helpText: "URL for further documentation." + description: [ + "MOD: A link to the documentation page on a thing.", + "DCAT: A Web page that can be navigated to in a Web browser to gain access to the dataset, its distributions and/or additional information.", + "OMV: URL for further documentation.", + "RDFS: Further information about the subject resource.", + "DOAP: URL of Wiki for collaborative discussion of project.", + "VANN: A reference to a resource that provides information on how this resource is to be used.", + "FOAF: A page or document about this thing." ] + extractedMetadata: true + metadataMappings: [ "omv:documentation", "rdfs:seeAlso", "foaf:page", "vann:usageNote", "mod:document", "dcat:landingPage", "doap:wiki" ] + +#Notes or comments +notes: + display: "description" + label: "Notes" + helpText: "Additional information about the ontology that is not included somewhere else." + description: [ + "RDFS: A description of the subject resource.", + "OMV: Additional information about the ontology that is not included somewhere else (e.g. information that you do not want to include in the documentation).", + "ADMS: A description of changes between this version and the previous version of the Asset." ] extractedMetadata: true - label: "Deprecated" - metadataMappings: [ "idot:obsolete" ] - helpText: "To specify if the ontology IRI is deprecated" - description: [ "DCAT: An annotation with the owl:deprecated annotation property and the value equal to \"true\"^^xsd:boolean can be used to specify that an IRI is deprecated", - "OWL: The annotation property that indicates that a given entity has been deprecated.", - "IDOT: Indicates if the current dataset is obsolete (not provided any more to the public community). Value can either be 'true' or 'false' (xsd:boolean). The statement is usually omitted if 'false'." - ] + metadataMappings: [ "omv:notes", "rdfs:comment", "adms:versionNotes" ] -versionIRI: +#Keywords +keywords: + display: "description" + label: "Keywords" + helpText: "List of keywords related to an ontology." + description: [ + "SCHEMA: Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.", + "OMV: List of keywords related to an ontology.", + "DCAT: A keyword or tag describing a resource.", + "MOD: A keyword(s) is used to describe the content of an ontology." ] extractedMetadata: true - display: "general" - label: "Version IRI" - helpText: "Identifies the version IRI of an ontology." - description: [ "OWL: The property that identifies the version IRI of an ontology" ] + metadataMappings: [ "omv:keywords", "mod:keyword", "dcat:keyword", "schema:keywords" ] -ontologyRelatedTo: +#Hidden label +hiddenLabel: + display: "description" + label: "Hidden label" + helpText: "A lexical label for a resource that should be hidden when generating visual displays of the resource, but should still be accessible to free text search operations." + description: [ + "SKOS: A lexical label for a resource that should be hidden when generating visual displays of the resource, but should still be accessible to free text search operations." ] extractedMetadata: true - label: "Generally related to" - description: [ "DCTERMS: A related resource", - "VOAF: Indicates that the subject vocabulary uses or extends some class or property of the object vocabulary" ] - metadataMappings: [ "dc:relation", "dct:relation", "voaf:reliesOn" ] - helpText: "An ontology that uses or extends some class or property of the described ontology" - -comesFromTheSameDomain: + metadataMappings: [ "skos:hiddenLabel" ] + +#Alternative name +alternative: + display: "description" + label: "Alternative name" + helpText: "An alternative name for the resource. The distinction between titles and alternative titles is application-specific." + description: [ + "DCTERMS: An alternative name for the resource. The distinction between titles and alternative titles is application-specific.", + "SKOS: The preferred and alternative labels are useful when generating or creating human-readable representations of a knowledge organization system.", + "SCHEMA: An alias for the item. A short label that is used by some communities to refer to a dataset", + "IDOT: A short label that is used by some communities to refer to a dataset (see 'preferredPrefix')." ] extractedMetadata: true - description: "DOOR: If the two ontologies come from the same domain (without any other details)." - display: "relations" - helpText: "Ontologies that come from the same domain" - label: "From the same domain than" + metadataMappings: [ "dcterms:alternative", "skos:altLabel", "idot:alternatePrefix", "schema:alternativeHeadline", "schema:alternateName" ] +#Abstract +abstract: + display: "description" + label: "Abstract" + helpText: "A summary or abstrct of the ontology." + description: [ + "DCTERMS: A summary of the resource." ] + extractedMetadata: true + metadataMappings: [ "dcterms:abstract" ] -similarTo: +#Bibliographic reference +publication: + display: "description" + label: "Bibliographic reference" + helpText: "List of bibliographic references describing the ontology and its applications." + description: [ + "SCHEMA: A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.", + "DCTERMS: A bibliographic reference for the resource.", + "OMV: List of bibliographic references describing the ontology and its applications.", + "FOAF: A document that this thing is the primary topic of.", + "CITO: The citing entity cites the cited entity as one that provides an authoritative description or definition of the subject under discussion." ] extractedMetadata: true - label: "Similar to" - description: [ "VOAF: Used to assert that two vocabularies are similar in scope and objectives, independently of the fact that they otherwise refer to each other.", - "DOOR: Represents the meaning of 'how an ontology overlap/cover parts of the same area of interest of another ontology." ] - metadataMappings: [ "voaf:similar" ] - display: "relations" - helpText: "Vocabularies that are similar in scope and objectives, independently of the fact that they otherwise refer to each other." + metadataMappings: [ "omv:reference", "dcterms:bibliographicCitation", "foaf:isPrimaryTopicOf", "schema:citation", "cito:citesAsAuthority" ] -isAlignedTo: - extractedMetadata: true - label: "Has equivalences with" - description: [ "VOAF: Indicates that the subject vocabulary declares some equivalent classes or properties with the object vocabulary.", - "DOOR: Links two ontologies if there exists an alignment which covers a substantial part of the vocabulary (i.e., a proportion greater than a threshold).", - "NKOS: A related resource with which the described resource is aligned." ] - metadataMappings: [ "voaf:hasEquivalencesWith", "nkos:alignedWith" ] - helpText: "Ontologies that have an alignment which covers a substantial part of the described ontology" +### Dates -explanationEvolution: +#Creation date +creationDate: + display: "dates" + label: "Creation date" + helpText: "Date of original (or first) creation of the resource." + description: [ + "DCTERMS:date: A point or period of time associated with an event in the lifecycle of the resource.", + "DCTERMS:created: Date of creation of the resource.", + "DCTERMS:issued: Date of formal issuance (e.g., publication) of the resource.", + "PROV: Generation is the completion of production of a new entity by an activity. This entity did not exist before generation and becomes available for usage after this generation.", + "PAV:authoredOn: The date this resource was authored.", + "PAV:contributedOn: The date this resource was contributed to.", + "PAV:createdOn: The date of creation of the resource representation.", + "DOAP: Date when something was created, in YYYY-MM-DD form. e.g. 2004-04-05.", + "SCHEMA: The date on which the CreativeWork was created or the item was added to a DataFeed.", + "DOAP: Date when something was created, in YYYY-MM-DD form. e.g. 2004-04-05." ] + extractedMetadata: true + metadataMappings: [ "dcterms:created", "dcterms:date", "dcterms:issued", "doap:created", "mod:creationDate", "oboInOwl:hasDate", "oboInOwl:date", "omv:creationDate", "pav:createdOn", "pav:authoredOn", "pav:contributedOn", "prov:generatedAtTime", "schema:dateCreated"] + +#Modification date +modificationDate: + display: "dates" + label: "Modification date" + helpText: "Date of the last modification made to the ontology." + description: [ + "DCTERMS: Date on which the resource was changed.", + "SCHEMA: The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed.", + "OMV: Date of the last modification made to the ontology.", + "PAV: The date of the last update of the resource." ] + extractedMetadata: true + metadataMappings: [ "omv:modificationDate", "dcterms:modified", "schema:dateModified", "pav:lastUpdateOn" ] + +#Validity date +valid: + display: "dates" + label: "Validity date" + helpText: "Date (often a range) of validity of a resource." + description: [ + "DCTERMS: Date (often a range) of validity of a resource.", + "SCHEMA: The end date and time of the item.", + "PROV: Invalidation is the start of the destruction, cessation, or expiry of an existing entity by an activity. The entity is no longer available for use (or further invalidation) after invalidation. Any generation or usage of an entity precedes its invalidation." ] extractedMetadata: true - description: [ "DOOR: Evolution which involves only at the syntactic level.", - "PROV: An entity that is a specialization of another shares all aspects of the latter, and additionally presents more specific aspects of the same thing as the latter.", - "VOAF:Indicates that the subject vocabulary defines some subclasses or subproperties of the object vocabulary, or local restrictions on those" ] - metadataMappings: [ "voaf:specializes", "prov:specializationOf" ] - display: "relations" - label: "Specialization of" - helpText: "If the ontology is a latter version that is semantically equivalent to another ontology." - -generalizes: + metadataMappings: [ "dcterms:valid", "prov:invaliatedAtTime", "schema:endDate" ] + +#Curation date +curatedOn: + display: "dates" + label: "Curation date" + helpText: "Specifies the date this resource was curated. pav:curatedBy gives the agents that performed the curation." + description: [ + "PAV: Specifies the date this resource was curated. pav:curatedBy gives the agents that performed the curation." ] extractedMetadata: true - description: [ "VOAF: Indicates that the subject vocabulary generalizes by some superclasses or super properties the object vocabulary.", - "PROV: Inverse property of specializationOf." ] - display: "relations" - label: "Generalization of" - helpText: "Vocabulary that is generalized by some superclasses or superproperties by the described ontology" + metadataMappings: [ "pav:curatedOn" ] -hasDisparateModelling: +#Submission date +released: + display: "dates" + label: "Submission date" + helpText: "Date of the submission/release in the portal." + description: [ + "DCTERMS: Date of submission of the resource.", + "SCHEMA: Date of first broadcast/publication." ] extractedMetadata: true - description: "DOOR: Disagreements related to the conceptualization of the ontologies. Two ontologies are considered to have disparate modeling if they represent corresponding entities in different ways, e.g. as an instance in one case and a class in the other.." - display: "relations" - label: "Disparate modelling with" - helpText: "URI of an ontology that is considered to have a different model, because they represent corresponding entities in different ways.<br>e.g. an instance in one case and a class in the other for the same concept" + metadataMappings: [ "dcterms:dateSubmitted", "schema:datePublished" ] -hiddenLabel: - extractedMetadata: true - label: "Hidden or past name" - description: [ "MOD: Hidden or past name", - "SKOS: A lexical label for a resource that should be hidden when generating visual displays of the resource, but should still be accessible to free text search operations." ] - helpText: "The hidden labels are useful when a user is interacting with a knowledge organization system via a text-based search function. The user may, for example, enter mis-spelled words when trying to find a relevant concept. If the mis-spelled query can be matched against a hidden label, the user will be able to find the relevant concept, but the hidden label won't otherwise be visible to the user" +### Persons and organizations -coverage: - extractedMetadata: true - label: "Coverage" - description: [ "DCTERMS: The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant. Spatial topic and spatial applicability may be a named place or a location specified by its geographic coordinates. Temporal topic may be a named period, date, or date range. A jurisdiction may be a named administrative entity or a geographic place to which the resource applies.", - "SCHEMA: The 'spatial' property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate." ] - metadataMappings: [ "dc:coverage", "schema:spatial" ] - display: "usage" - helpText: "The spatial or temporal topic of the ontology, the spatial applicability of the ontology, or the jurisdiction under which the ontology is relevant." +#Contact +contact: + display: "persons and organizations" + label: "Contact" + helpText: "The persons who can be contacted to enquire about an ontology. Composed of the contacts name and email." + description: [ + "DCAT: Relevant contact information for the cataloged resource. Use of vCard is recommended."] + extractedMetadata: false + metadataMappings: [ "dcat:contactPoint" ] -publisher: +#Creator +hasCreator: + display: "persons and organizations" + label: "Creator" + helpText: "Main responsible for the creation of the ontology." + description: [ + "OMV: Main responsible for the creation of the ontology", + "DCTERMS: An entity primarily responsible for making the resource", + "FOAF: An agent that made this thing", + "PROV: Attribution is the ascribing of an entity to an agent.", + "PAV:authoredBy: An agent that originated or gave existence to the work that is expressed by the digital resource.", + "PAV:cretaedBy: An agent primary responsible for making the digital artifact or resource representation.", + "DOAP: Maintainer of a project, a project leader.", + "SCHEMA:author: The author of this content or rating.", + "SCHEMA:creator: The creator/author of this CreativeWork." ] extractedMetadata: false + metadataMappings: [ "omv:hasCreator", "dc:creator", "dcterms:creator", "foaf:maker", "prov:wasAttributedTo", "doap:maintainer", "pav:authoredBy", "pav:createdBy", "schema:author", "schema:creator" ] + +#Contributor +hasContributor: + display: "persons and organizations" + label: "Contributor" + helpText: "Contributors to the creation of the ontology." + description: [ + "DCTERMS: An entity responsible for making contributions to the resource.", + "SCHEMA: A secondary contributor to the CreativeWork or Event.", + "OMV: Contributors to the creation of the ontology.", + "PAV: The resource was contributed to by the given agent.", + "DOAP: Project contributor" ] + extractedMetadata: false + metadataMappings: [ "omv:hasContributor", "dc:contributor", "dcterms:contributor", "doap:helper", "schema:contributor", "pav:contributedBy" ] + +#Curator +curatedBy: + display: "persons and organizations" + label: "Curator" + helpText: "Specifies an agent specialist responsible for curating/evaluating the ontology." + description: [ + "PAV: Specifies an agent specialist responsible for shaping the expression in an appropriate format. Often the primary agent responsible for ensuring the quality of the representation.", + "MOD: An ontology that is evaluated by an agent." ] + extractedMetadata: false + metadataMappings: [ "mod:evaluatedBy", "pav:curatedBy" ] + +#Translator +translator: + display: "persons and organizations" + label: "Translator" + helpText: "Organization or person who adapts a creative work to different languages." + description: [ + "SCHEMA: Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event." ] + extractedMetadata: false + metadataMappings: [ "schema:translator" ] + +#Publisher +publisher: + display: "persons and organizations" label: "Publisher" - description: [ "DCTERMS: An entity responsible for making the resource available.", - "SCHEMA: The publisher of creative work.", - "ADMS: The name of the agency that issued the identifier." ] - metadataMappings: [ "dc:publisher", "schema:publisher" ] - display: "license" helpText: "An entity responsible for making the ontology available." + description: [ + "DCTERMS: An entity responsible for making the resource available.", + "SCHEMA: The publisher of creative work.", + "ADMS: The name of the agency that issued the identifier." ] + extractedMetadata: false + metadataMappings: [ "dc:publisher", "dcterms:publisher", "schema:publisher", "adms:schemaAgency" ] +#Funded or sponsored by +fundedBy: + display: "persons and organizations" + label: "Funded or sponsored by" + helpText: "An organization funding a project or person." + description: [ + "MOD: An ontology that is sponsored by and developed under a project.", + "FOAF: An organization funding a project or person.", + "SCHEMA: The organization on whose behalf the creator was working." ] + extractedMetadata: false + metadataMappings: [ "foaf:fundedBy", "mod:sponsoredBy", "schema:sourceOrganization" ] + +#Endorsed by +endorsedBy: + display: "persons and organizations" + label: "Endorsed by" + helpText: "The parties that have expressed support or approval to this ontology." + description: [ + "MOD: An ontology endorsed by an agent.", + "OMV: The parties that have expressed support or approval to this ontology." ] + extractedMetadata: false + metadataMappings: [ "omv:endorsedBy", "mod:endorsedBy" ] + +### Community -identifier: - extractedMetadata: true - label: "Other identifier" - description: [ "DCTERMS: An unambiguous reference to the resource within a given context. Recommended practice is to identify the resource by means of a string conforming to an identification system. Examples include International Standard Book Number (ISBN), Digital Object Identifier (DOI), and Uniform Resource Name (URN). Persistent identifiers should be provided as HTTP URIs.", - "SKOS: A notation is a string of characters such as\"T58.5\"or\"303.4833\"used to uniquely identify a concept within the scope of a given concept scheme.", - "ADMS: adms:identifier is used to link any resource to an instance of adms:Identifier which is its range. N.B. it is not appropriate to use dcterms:identifer to link to the Identifier class as its range is rdfs:Literal. ADMS uses this to provide any identifier for the Asset.", - "SCHEMA: The identifier property represents any kind of identifier for any kind of Thing, such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. " ] - metadataMappings: [ "dc:identifier", "skos:notation", "adms:identifier" ] - helpText: "An unambiguous reference to the ontology. Use the ontology URI if not provided in the ontology metadata." - example: 'https://doi.org/10.15454/1.4690062322351956E12' +#User notes or reviews => Ontology object (bpm:notes) +#Evaluation => Ontology object (bpm:reviews) +#Group => Ontology object (bpm:group) +#Used in project => Ontology object (bpm:project) -source: +#Target audience +audience: + display: "community" + label: "Audience" + helpText: "A set of users/agents for whom the ontology is intended or useful." + description: [ + "DCTERMS: a class of entity for whom the resource is intended or useful.", + "DOAP: Description of target user base.", + "SCHEMA: An intended audience, i.e. a group for whom something was created." ] extractedMetadata: true - description: [ "CTERMS: A related resource from which the described resource is derived", - "SCHEMA: A resource from which this work is derived or from which it is a modification or adaptation.", - "PROV: A derivation is a transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a pre-existing entity.", - "PROV: Influence is the capacity of an entity, activity, or agent to have an effect on the character, development, or behavior of another by means of usage, start, end, generation, invalidation, communication, derivation, attribution, association, or delegation.", - "PAV: Derived from a different resource.", - "NKOS: A resource used as the source for a derivative resource." ] - display: "links" - label: "Source" - metadataMappings: [ "dc:source", "prov:wasInfluencedBy", "prov:wasDerivedFrom", "pav:derivedFrom", "schema:isBasedOn", "nkos:basedOn", "mod:sourceOntology" ] - helpText: "A related resource from which the described resource is derived." + metadataMappings: [ "dcterms:audience", "doap:audience", "schema:audience" ] -abstract: +#Analytics => Ontology object (bpm:analytics) + +#Repository +repository: + display: "community" + label: "Repository" + helpText: "Ontology source code repository." + example: 'https://github.com/Planteome/plant-trait-ontology' + description: [ + "DOAP: Source code repository." ] extractedMetadata: true - label: "Abstract" - description: "DCTERMS: A summary of the resource" - helpText: "A summary of the ontology" + metadataMappings: [ "doap:repository" ] -alternative: +#Bug database +bugDatabase: + display: "community" + label: "Bug database" + helpText: "Bug tracker for a project." + example: 'https://github.com/Planteome/plant-trait-ontology/issues' + description: [ + "DOAP: Bug tracker for a project." ] + extractedMetadata: true + metadataMappings: [ "doap:bug-database" ] + +#Mailing list +mailingList: + display: "community" + label: "Mailing list" + helpText: "Ontology support mailing list or email address." + description: [ + "DOAP: Mailing list home page or email address." ] extractedMetadata: true - description: [ "DCTERMS: An alternative name for the resource. The distinction between titles and alternative titles is application-specific.", - "SKOS: The preferred and alternative labels are useful when generating or creating human-readable representations of a knowledge organization system.", - "SCHEMA: An alias for the item. A short label that is used by some communities to refer to a dataset", - "IDOT: A short label that is used by some communities to refer to a dataset (see 'preferredPrefix')." ] - label: "Alternative name" - metadataMappings: [ "skos:altLabel", "idot:alternatePrefix", "schema:alternativeHeadline", "schema:alternateName" ] - helpText: "An alternative title for the ontology" + metadataMappings: [ "doap:mailing-list" ] -hasPart: +#To Do List +toDoList: + display: "community" + label: "To do list" + helpText: "Describes future tasks planned by a resource curator." + description: [ + "VOAF: Describes future tasks planned by a resource curator. This property is primarily intended to be used for vocabularies or datasets, but the domain is left open, it can be used for any resource. Use iCalendar Vtodo class and its properties to further describe the task calendar, priorities etc." ] extractedMetadata: true - label: "Has part (has views)" - description: [ "DCTERMS: A related resource that is included either physically or logically in the described resource.", - "SCHEMA: Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).", - "ADMS: Links to a sample of an Asset (which is itself an Asset)." ] - metadataMappings: [ "schema:hasPart", "oboInOwl:hasSubset", "adms:includedAsset" ] - display: "relations" - helpText: "A related ontology that is included either physically or logically in the described ontology." + metadataMappings: [ "mod:toDoList", "voaf:toDoList" ] -isFormatOf: +#Award +award: + display: "community" + label: "Award" + helpText: "An award won by or for this item." + description: [ + "SCHEMA: An award won by or for this item." ] extractedMetadata: true - label: "Is format of" - description: "DCTERMS: A related resource that is substantially the same as the described resource, but in another format" - display: "links" - helpText: "URL to the original document that describe this ontology in a not ontological format (i.e.: the OBO original file)" + metadataMappings: [ "schema:award" ] +### Usage -hasFormat: +#Known usage +knownUsage: + display: "usage" + label: "Known usage" + helpText: "The applications where the ontology is being used." + example: "Used to annotate phenotypes and patterns of gene expression." + description: [ + "OMV: The applications where the ontology is being used.", + "MOD: Type of applications or usage of the ontology." ] extractedMetadata: true - label: "Has format" - description: "DCTERMS: A related resource that is substantially the same as the described resource, but in another format" - display: "links" - helpText: "URL to a document that describe this ontology in a not ontological format (i.e.: the OBO original file) generated from this ontology." + metadataMappings: [ "mod:knownUsage", "omv:knownUsage" ] - -audience: +#Designed for task +designedForOntologyTask: + display: "usage" + label: "Designed for task (as defined by OMV)." + helpText: "The purpose or tasks for which the ontology was originally designed." + description: [ + "MOD: The purpose or tasks for which the ontology was originally designed.", + "OMV: The purpose for which the ontology was originally designed." ] extractedMetadata: true - label: "Audience" - description: [ "DCTERMS: a class of entity for whom the resource is intended or useful (public visé ou recommandé pour la ressource).", - "DOAP: Description of target user base.", - "SCHEMA: An intended audience, i.e. a group for whom something was created" ] - metadataMappings: [ "doap:audience", "schema:audience" ] - display: "community" - helpText: "Description of the target user base of the ontology." + enforcedValues: { + "http://omv.ontoware.org/2005/05/ontology#AnnotationTask": "Annotation Task", + "http://omv.ontoware.org/2005/05/ontology#ConfigurationTask": "Configuration Task", + "http://omv.ontoware.org/2005/05/ontology#FilteringTask": "Filtering Task", + "http://omv.ontoware.org/2005/05/ontology#IndexingTask": "Indexing Task", + "http://omv.ontoware.org/2005/05/ontology#IntegrationTask": "Integration Task", + "http://omv.ontoware.org/2005/05/ontology#MatchingTask": "Matching Task", + "http://omv.ontoware.org/2005/05/ontology#MediationTask": "Mediation Task", + "http://omv.ontoware.org/2005/05/ontology#PersonalizationTask": "Personalization Task", + "http://omv.ontoware.org/2005/05/ontology#QueryFormulationTask": "Query Formulation Task", + "http://omv.ontoware.org/2005/05/ontology#QueryRewritingTask": "Query Rewriting Task", + "http://omv.ontoware.org/2005/05/ontology#SearchTask": "Search Task" + } + metadataMappings: [ "omv:designedForOntologyTask", "mod:designedForTask" ] -valid: +#Subject +hasDomain: + display: "usage" + label: "Subject" + helpText: "The topics of the ontology." + example: '' + description: [ + "DCTERMS: The topic of the resource.", + "SCHEMA: The subject matter of the content.", + "FOAF: A topic of some page or document.", + "OMV: Typically, the domain can refer to established topic hierarchies such as the general purpose topic hierarchy (DMOZ or the domain specific topic hierarchy ACM for the computer science domain.", + "DCAT: A main category of the resource." ] + extractedMetadata: true + metadataMappings: [ "omv:hasDomain", "dc:subject", "dcterms:subject", "foaf:topic", "dcat:theme", "schema:about" ] + +#Coverage +coverage: + display: "usage" + label: "Coverage" + helpText: "The spatial or temporal topic of the ontology, the spatial applicability of the ontology, or the jurisdiction under which the ontology is relevant." + description: [ + "DCTERMS: The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant. Spatial topic and spatial applicability may be a named place or a location specified by its geographic coordinates. Temporal topic may be a named period, date, or date range. A jurisdiction may be a named administrative entity or a geographic place to which the resource applies.", + "SCHEMA: The 'spatial' property can be used in cases when more specific properties (e.g. locationCreated, spatialCoverage, contentLocation) are not known to be appropriate." ] extractedMetadata: true - description: [ "DCTERMS: Date (often a range) of validity of a resource.", - "SCHEMA: The end date and time of the item.", - "PROV: Invalidation is the start of the destruction, cessation, or expiry of an existing entity by an activity. The entity is no longer available for use (or further invalidation) after invalidation. Any generation or usage of an entity precedes its invalidation." ] - label: "Valid until" - metadataMappings: [ "prov:invaliatedAtTime", "schema:endDate" ] - display: "dates" - helpText: "Date (often a range) of validity of the ontology." + metadataMappings: [ "dc:coverage", "dcterms:coverage", "schema:spatial" ] + +#Example of use +example: + display: "usage" + label: "Example of use" + helpText: "A reference to a resource that provides an example of how this ontology can be used." + description: [ + "VANN: A reference to a resource that provides an example of how this resource can be used.", + "SCHEMA: Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook." ] + extractedMetadata: true + metadataMappings: [ "vann:example", "schema:workExample" ] + +### Methodology and provenance -accrualMethod: +#Knowledge representation paradigm +conformsToKnowledgeRepresentationParadigm: + display: "methodology" + label: "Knowledge representation paradigm" + helpText: "OMV: Information about the paradigm model used to create the ontology." + example: '' + description: [ + "MOD: A representation formalism that is followed to describe knowledge in an ontology. Example includes description logics, first order logic, etc.", + "OMV: Information about the paradigm model used to create the ontology.", + "DCTERMS: An established standard to which the described resource conforms." ] + extractedMetadata: true + metadataMappings: [ "omv:conformsToKnowledgeRepresentationParadigm", "mod:KnowledgeRepresentationFormalism", "dcterms:conformsTo" ] + +#Engineering methodology +usedOntologyEngineeringMethodology: + display: "methodology" + label: "Engineering methodology" + helpText: "Information about the method model used to create the ontology." + description: [ + "MOD: A methodology following which an ontology is created.", + "OMV: Information about the method model used to create the ontology.", + "SCHEMA: The publishingPrinciples property indicates (typically via URL) a document describing the editorial principles of an Organization (or individual, e.g. a Person writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies.", + "ADMS: More information about the format in which an Asset Distribution is released. This is different from the file format as, for example, a ZIP file (file format) could contain an XML schema (representation technique)." ] + extractedMetadata: true + metadataMappings: [ "omv:usedOntologyEngineeringMethodology", "mod:methodologyUsed", "adms:representationTechnique", "schema:publishingPrinciples" ] + +#Created with +usedOntologyEngineeringTool: + display: "methodology" + label: "Created with" + helpText: "Information about the tool used to create the ontology." + description: [ + "PAV: The software/tool used by the creator (pav:createdBy) when making the digital resource, for instance a word processor or an annotation tool.", + "MOD: The tool used for the creation of an ontology.", + "OMV: Information about the tool used to create the ontology." ] extractedMetadata: true + enforcedValues: [ + "Protégé", + "OWL API", + "OBO-Edit", + "SWOOP", + "OntoStudio", + "Altova", + "OilEd", + "IsaViz", + "WebODE", + "OntoBuilder", + "WSMO Studio", + "VocBench", + "TopBraid", + "NeOn-Toolkit", + "Another tool" ] + metadataMappings: [ "omv:usedOntologyEngineeringTool", "mod:toolUsed", "pav:createdWith", "oboInOwl:auto-generated-by" ] + +#Accrual method +accrualMethod: + display: "methodology" label: "Accrual method" - description: "DCTERMS: The method by which items are added to a collection. May use a value from the Collection Description Accrual Method Vocabulary" - display: "methodology" helpText: "The method by which items are added to the ontology." + example: 'We take term request via GitHub issues.' + description: [ + "DCTERMS: The method by which items are added to a collection. May use a value from the Collection Description Accrual Method Vocabulary." ] + extractedMetadata: true + metadataMappings: [ "dcterms:accrualMethod" ] - +#Accrual periodicity accrualPeriodicity: - extractedMetadata: true + display: "methodology" label: "Accrual periodicity" - description: "DCTERMS: The frequency with which items are added to a collection" - display: "methodology" - metadataMappings: [ "nkos:updateFrequency" ] - helpText: "The frequency with which items are added to the ontology." + helpText: "The frequency with which items are added to the ontology (as defined by CLD)." + description: [ + "DCTERMS: The frequency with which items are added to a collection.", + "NKOS: The period in which a KOS is typically updated." ] + extractedMetadata: true enforcedValues: { "http://purl.org/cld/freq/triennial": "Triennial", "http://purl.org/cld/freq/biennial": "Biennial", @@ -703,453 +817,728 @@ accrualPeriodicity: "http://purl.org/cld/freq/daily": "Daily", "http://purl.org/cld/freq/continuous": "Continuous", "http://purl.org/cld/freq/irregular": "Irregular", - } + metadataMappings: [ "dcterms:accrualPeriodicity", "nkos:updateFrequency" ] - +#Accrual policy accrualPolicy: - extractedMetadata: true + display: "methodology" label: "Accrual policy" - description: "DCTERMS: The policy governing the addition of items to a collection" - display: "methodology" helpText: "The policy governing the addition of items to the ontology." - -endpoint: + example: 'Term proposals are review by an expert committee.' + description: [ + "DCTERMS: The policy governing the addition of items to a collection." ] extractedMetadata: true - label: "SPARQL endpoint" - description: [ "SD: Relates an instance of sd:Service to a SPARQL endpoint that implements the SPARQL Protocol service for the service. The object of the sd:endpoint property is an IRI.", - "VOID: A SPARQL protocol endpoint that allows SPARQL query access to a void:Dataset." ] - metadataMappings: [ "void:sparqlEndpoint" ] - display: "content" - - -dataDump: + metadataMappings: [ "dcterms:accrualPolicy" ] + +#Competency question +competencyQuestion: + display: "methodology" + label: "Competency question" + helpText: "A set of questions made to build an ontology at the design time." + description: [ + "MOD: A set of questions made to build an ontology at the design time." ] extractedMetadata: true - label: "Download URL" - description: [ "DCAT: The URL of the downloadable file in a given format. E.g. CSV file or RDF file. The format is indicated by the distribution's dcterms:format and/or dcat:mediaType.", - "VOID: An RDF dump, partial or complete, of a void:Dataset.", - "DOAP: Mirror of software download web page.", - "SCHEMA: A downloadable form of this dataset, at a specific location, in a specific format." ] - metadataMappings: [ "schema:distribution", "doap:download-mirror" ] - display: "content" + metadataMappings: [ "mod:competencyQuestion" ] -csvDump: - display: "content" - label: "CSV dump" +#Sample queries => Not implemented -openSearchDescription: +#Was generated by +wasGeneratedBy: + display: "methodology" + label: "Was generated by" + helpText: "Generation is the completion of production of a new ontology by an activity." + example: 'Generated by the workflow described ...' + description: [ + "PROV: Generation is the completion of production of a new entity by an activity. This entity did not exist before generation and becomes available for usage after this generation." ] extractedMetadata: true - label: "Free-text search endpoint" - description: "VOID: An OpenSearch description document for a free-text search service over a void:Dataset. " - metadataMappings: [ "doap:service-endpoint" ] - display: "content" + metadataMappings: [ "prov:wasGeneratedBy" ] -uriLookupEndpoint: +#Was invalidated by +wasInvalidatedBy: + display: "methodology" + label: "Was invalidated by" + helpText: "Invalidation is the start of the destruction, cessation, or expiry of an existing ontology by an activity." + example: 'Invalidated by the production of ...' + description: [ + "PROV: Invalidation is the start of the destruction, cessation, or expiry of an existing entity by an activity. The entity is no longer available for use (or further invalidation) after invalidation. Any generation or usage of an entity precedes its invalidation." ] extractedMetadata: true - description: "VOID: A protocol endpoint for simple URI lookups for a void:Dataset." - display: "content" - label: "URI Lookup Endpoint" - helpText: "A protocol endpoint for simple URI lookups for the ontology." + metadataMappings: [ "prov:wasInvalidatedBy" ] -uriRegexPattern: - extractedMetadata: true - description: "VOID: A protocol endpoint for simple URI lookups for a void:Dataset." - metadataMappings: [ "idot:identifierPattern" ] - display: "content" - label: "URI Regex Pattern" - helpText: "A regular expression that matches the URIs of the ontology entities." +### Object description properties -depiction: +#Object preferred label property +prefLabelProperty: + display: "object description properties" + label: "Object preferred label property" + helpText: "Property used to specify objects preferred label." + description: [ + "MOD: Property used to specify objects preferred label." ] extractedMetadata: true - label: "Depiction" - description: [ "FOAF: A depiction of something.", - "DOAP: Web page with screenshots of project. An image of the item. SCHEMA: An image of the item. This can be a URL or a fully described ImageObject." ] - metadataMappings: [ "doap:screenshots", "schema:image" ] - display: "images" - helpText: "The URL of an image representing the ontology." + enforcedValues: { + "http://www.w3.org/2004/02/skos/core#prefLabel": "skos:prefLabel", + "http://www.w3.org/2000/01/rdf-schema#label": "rdfs:label", + "http://schema.org/name": "schema:name", + "http://xmlns.com/foaf/0.1/name": "foaf:name", + "http://purl.org/dc/terms/title": "dcterms:title", + "http://purl.org/dc/elements/1.1/title": "dc:title" + } + metadataMappings: [ "mod:prefLabelProperty" ] -logo: +#Object synonym property +synonymProperty: + display: "object description properties" + label: "Object synonym property" + helpText: "Property used to specify objects synonyms." + description: [ + "MOD: Property used to specify objects synonyms." ] extractedMetadata: true - label: "Logo" - description: [ "FOAF: A logo representing something.", - "SCHEMA: An associated logo." ] - metadataMappings: [ "schema:logo" ] - display: "images" - helpText: "The URL of the ontology logo." + enforcedValues: { + "http://www.w3.org/2004/02/skos/core#altLabel ": "skos:altLabel", + "http://purl.org/dc/terms/alternative ": "dcterms:alternative", + "http://schema.org/alternateName": "schema:alternativeName", + "http://www.geneontology.org/formats/oboInOwl#hasSynonym": "oboInOwl:hasSynonym", + "http://www.geneontology.org/formats/oboInOwl#hasExactSynonym": "oboInOwl:hasExactSynonym", + "http://www.geneontology.org/formats/oboInOwl#hasNarrowSynonym": "oboInOwl:hasNarrowSynonym", + "http://www.geneontology.org/formats/oboInOwl#hasBroadSynonym": "oboInOwl:hasBroadSynonym", + "http://www.geneontology.org/formats/oboInOwl#hasRelatedSynonym": "oboInOwl:hasRelatedSynonym" + } + metadataMappings: [ "mod:synonymProperty" ] -competencyQuestion: +#Object definition property +definitionProperty: + display: "object description properties" + label: "Object definition property" + helpText: "Property used to specify objects definition." + description: [ + "MOD: Property used to specify objects definition." ] + extractedMetadata: true + enforcedValues: { + "http://www.w3.org/2004/02/skos/core#definition": "skos:definition", + "http://www.w3.org/2000/01/rdf-schema#comment": "rdfs:comment", + "http://purl.org/dc/terms/description ": "dcterms:description", + "http://purl.org/dc/elements/1.1/description": "dc:description", + "http://schema.org/description ": "schema:decription", + "http://www.geneontology.org/formats/oboInOwl#hasDefinition": "oboInOwl:hasDefinition" + } + metadataMappings: [ "mod:definitionProperty" ] + +#Object author property +authorProperty: + display: "object description properties" + label: "Object author property" + helpText: "Property used to specify object author." + description: [ + "MOD: Property used to specify object author." ] extractedMetadata: true - label: "Competency question" - description: [ "FOAF: A logo representing something.", - "SCHEMA: An associated logo." ] - display: "methodology" - helpText: "A set of questions made to build an ontology at the design time." - + enforcedValues: { + "http://purl.org/dc/elements/1.1/creator": "dc:creator", + "http://purl.org/dc/terms/creator": "dcterms:creator", + "http://schema.org/author": "schema:author", + "http://www.w3.org/ns/prov#wasAttributedTo": "prov:wasAttributedTo", + "http://purl.org/pav/authoredBy": "pav:authoredBy", + "http://purl.org/pav/createdBy": "pav:createdBy", + "http://xmlns.com/foaf/0.1/maker": "foaf:maker" + } + metadataMappings: [ "mod:authorProperty" ] -usedBy: +#Object obsolete property +obsoleteProperty: + display: "object description properties" + label: "Object obsolete property" + helpText: "Property used to specify obsolete objects." + description: [ + "MOD: Property used to specify obsolete objects." ] extractedMetadata: true - label: "Used by" - description: [ "VOAF: Indicates that the subject vocabulary is used by the object vocabulary.", - "NKOS: Agent using the described KOS" ] - display: "relations" - metadataMappings: [ "nkos:usedBy" ] - helpText: "Ontologies that use the described ontology." + enforcedValues: { + "http://www.w3.org/2002/07/owl#deprecated": "owl:deprecated", + "http://identifiers.org/idot/obsolete": "idot:obsolete" + } + metadataMappings: [ "mod:obsoleteProperty" ] -metadataVoc: +#Object creation date property +createdProperty: + display: "object description properties" + label: "Object creation date property" + helpText: "Property used to specify the date of creation of a class or another object in the ontology." + description: [ + "MOD: Property used to specify the date of creation of a class or another object in the ontology." ] extractedMetadata: true - description: [ "VOAF: Indicates that the subject vocabulary uses the object vocabulary in metadata at vocabulary or element level", - "SCHEMA: Indicates (by URL or string) a particular version of a schema used in some CreativeWork.", - "ADMS: A schema according to which the Asset Repository can provide data about its content, e.g. ADMS.", - "MOD: A vocabulary(ies) that is used and/or referred to create the current ontology." ] - display: "content" - label: "Metadata vocabulary used" - metadataMappings: [ "mod:vocabularyUsed", "adms:supportedSchema", "schema:schemaVersion" ] - helpText: "Vocabularies that are used and/or referred to create the described ontology." + enforcedValues: { + "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/dc/elements/1.1/date": "dc: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": "schema:dateCreated", + "http://www.w3.org/ns/prov#generatedAtTime": "prov:generatedAtTime" + } + metadataMappings: [ "mod:modifiedProperty" ] -hasDisjunctionsWith: +#Object modification date property +modifiedProperty: + display: "object description properties" + label: "Object modification date property" + helpText: "Property used to specify the date of modification of a class or another object in the ontology." + description: [ + "MOD: Property used to specify the date of modification of a class or another object in the ontology." ] extractedMetadata: true - label: "Disparate modelling with" - description: "VOAF: Indicates that the subject vocabulary declares some disjunct classes with the object vocabulary" - helpText: "Ontology that declares some disjunct classes with the described ontology." - -toDoList: + enforcedValues: { + "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/dc/elements/1.1/date": "dc: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": "schema:dateModified" + } + metadataMappings: [ "mod:createdProperty" ] + +#Hierarchy property +hierarchyProperty: + display: "object description properties" + label: "Hierarchy property" + helpText: "A property that is used to specify the hierarchy." + description: [ + "MOD: A property that is used to specify the hierarchy." ] extractedMetadata: true - label: "To do list" - description: "VOID: Describes future tasks planned by a resource curator. This property is primarily intended to be used for vocabularies or datasets, but the domain is left open, it can be used for any resource. Use iCalendar Vtodo class and its properties to further describe the task calendar, priorities etc" - display: "community" - helpText: "Describes future tasks planned by a resource curator." + enforcedValues: { + "http://www.w3.org/2000/01/rdf-schema#subClassOf": "rdfs:subClassOf", + "http://www.w3.org/2004/02/skos/core#broader": "skos:broader" + } + metadataMappings: [ "mod:hierarchyProperty" ] + +### Links -example: +#Access URL +pullLocation: + display: "links" + label: "Access URL" + helpText: "A URL of a resource that gives access to a distribution of the ontology." + description: [ + "DCAT: A URL of a resource that gives access to a distribution of the dataset. E.g. landing page, feed, SPARQL endpoint.", + "OMV: The location where the ontology can be found.", + "DOAP: Web page from which the project software can be downloaded" ] extractedMetadata: true - description: [ "VANN: A reference to a resource that provides an example of how this resource can be used.", - "SCHEMA: Example/instance/realization/derivation of the concept of this creative work. eg. The paperback edition, first edition, or eBook" ] - metadataMappings: [ "schema:workExample" ] - display: "usage" - helpText: "A reference to a resource that provides an example of how this ontology can be used." - label: "Example of use" + metadataMappings: [ "doap:download-page" , "dcat:accessURL" , "omv:resourceLocator" ] -preferredNamespaceUri: +#Is format of +isFormatOf: + display: "links" + label: "Is format of" + helpText: "A related resource that is substantially the same as the described resource, but in another format." + description: [ + "DCTERMS: A related resource that is substantially the same as the described resource, but in another format." ] extractedMetadata: true - label: "Preferred namespace URI" - description: [ "VANN: The preferred namespace URI to use when using terms from this vocabulary in an XML document.", - "VOID: A URI that is a common string prefix of all the entity URIs in a void:Dataset" ] - metadataMappings: [ "void:uriSpace" ] - helpText: "The preferred namespace URI to use when using terms from this ontology." - example: 'http://purl.obolibrary.org/obo/ENVO_' + metadataMappings: [ "dcterms:isFormatOf" ] - -preferredNamespacePrefix: +#Has format +hasFormat: + display: "links" + label: "Has format" + helpText: "A related resource that is substantially the same as the pre-existing described resource, but in another format." + description: [ + "DCTERMS: A related resource that is substantially the same as the pre-existing described resource, but in another format." ] extractedMetadata: true - label: "Preferred namespace prefix" - description: [ "VANN: The preferred namespace prefix to use when using terms from this vocabulary in an XML document.", - "IDOT: Short label that is commonly used to refer to the dataset. Often used to identify the dataset in IRIs for specific items (or records). This may also stand in place of the base IRI of the dataset (e.g. see http://prefix.cc)." ] - metadataMappings: [ "idot:preferredPrefix", "oboInOwl:default-namespace", "oboInOwl:hasDefaultNamespace" ] - helpText: "The preferred namespace prefix to use when using terms from this ontology." + metadataMappings: [ "dcterms:hasFormat" ] - -morePermissions: - description: "CC: A related resource which describes additional permissions or alternative licenses for a Work which may be available" +#Download URL +dataDump: + display: "links" + label: "Download URL" + helpText: "An RDF dump, partial or complete, of an ontology." + description: [ + "DCAT: The URL of the downloadable file in a given format. E.g. CSV file or RDF file. The format is indicated by the distribution's dcterms:format and/or dcat:mediaType.", + "VOID: An RDF dump, partial or complete, of a void:Dataset.", + "DOAP: Mirror of software download web page.", + "SCHEMA: A downloadable form of this dataset, at a specific location, in a specific format." ] extractedMetadata: true - label: "More permissions" - display: "license" - helpText: "A related resource which describes additional permissions or alternative licenses." + metadataMappings: [ "void:dataDump", "schema:distribution", "doap:download-mirror", "dcat:downloadURL" ] +csvDump: + display: "links" + label: "CSV dump" + helpText: "A CSV dump, partial or complete, of an ontology." + extractedMetadata: false -useGuidelines: +#URI look endpoint +uriLookupEndpoint: + display: "links" + label: "URI Lookup Endpoint" + helpText: "A protocol endpoint for simple URI lookups for the ontology." + description: [ + "VOID: A protocol endpoint for simple URI lookups for a void:Dataset." ] extractedMetadata: true - label: "Use guidelines" - description: "CC: A related resource which defines non-binding use guidelines for the work" - display: "community" - helpText: "A related resource which defines how the ontology should be used." - + metadataMappings: [ "void:uriLookupEndpoint" ] -curatedOn: +#Free-text search endpoint +openSearchDescription: + display: "links" + label: "Free-text search endpoint" + helpText: "An open search description document for a free-text search service over an ontology." + description: [ + "VOID: An OpenSearch description document for a free-text search service over a void:Dataset." ] extractedMetadata: true - label: "Curation date" - description: "PAV: Specifies the date this resource was curated. pav:curatedBy gives the agents that performed the curation." - display: "dates" - helpText: "The date the ontology was curated." - example: '2022-09-06' + metadataMappings: [ "void:openSearchDescription" ] -repository: +#Browsing user interface +ui: + display: "links" + label: "Browsing user interface" + helpText: "The user interface (URL) where the ontology may be browsed or searched." + description: [ + "MOD: The user interface (URL) where the ontology may be browsed or searched." ] extractedMetadata: true - label: "Repository" - description: "DOAP: Source code repository" - display: "community" - helpText: "Link to the source code repository." - example: 'https://github.com/Planteome/plant-trait-ontology' + metadataMappings: [ "mod:browsingUI" ] -bugDatabase: +#Source +source: + display: "links" + label: "Source" + helpText: "A related resource from which the described resource is derived." + description: [ + "DCTERMS: A related resource from which the described resource is derived.", + "SCHEMA: A resource from which this work is derived or from which it is a modification or adaptation.", + "PROV:prov:wasDerivedFrom: A derivation is a transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a pre-existing entity.", + "PROV:wasInfluencedBy: Influence is the capacity of an entity, activity, or agent to have an effect on the character, development, or behavior of another by means of usage, start, end, generation, invalidation, communication, derivation, attribution, association, or delegation.", + "PAV: Derived from a different resource.", + "NKOS: A resource used as the source for a derivative resource.", + "MOD: The ontology(ies) referred to while creating the present ontology." ] extractedMetadata: true - label: "Bug database" - description: "DOAP: Bug tracker for a project" - display: "community" - helpText: "Link to the bug tracker of the ontology (i.e.: GitHub issues)." + metadataMappings: [ "dcterms:source", "mod:sourceOntology", "nkos:basedOn", "pav:derivedFrom", "prov:wasInfluencedBy", "prov:wasDerivedFrom", "schema:isBasedOn" ] -mailingList: +#SPARQL endpoint +endpoint: + display: "links" + label: "SPARQL endpoint" + helpText: "Relates an instance of sd:Service to a SPARQL endpoint that implements the SPARQL Protocol service for the service." + description: [ + "SD: Relates an instance of sd:Service to a SPARQL endpoint that implements the SPARQL Protocol service for the service. The object of the sd:endpoint property is an IRI.", + "VOID: A SPARQL protocol endpoint that allows SPARQL query access to a void:Dataset." ] extractedMetadata: true - label: "Mailing list" - description: "DOAP: Mailing list home page or email address " - display: "community" - helpText: "Mailing list home page or email address." - -exampleIdentifier: - extractedMetadata: false - label: "Example of resource" - description: [ "VOID: Example resource of dataset.", - "IDOT: An example identifier used by one item (or record) from a dataset." ] - display: "content" - helpText: "An example identifier used by one item (or record) from a dataset." - -award: + metadataMappings: [ "sd:endpoint", "void:sparqlEndpoint" ] + +#Indexed or Included in catalog or repository +includedInDataCatalog: + display: "links" + label: "Indexed or included in catalog or repository" + helpText: "An ontology library or repository which contains this ontology (e.g., OBO Foundry, NCBO BioPortal, EBI-OLS, FAIRsharing, etc.)." + description: [ + "SCHEMA: A data catalog which contains this dataset." ] extractedMetadata: true - label: "Award" - description: "SCHEMA: An award won by or for this item" - display: "community" - helpText: "An award won by this ontology." - -copyrightHolder: - extractedMetadata: false - label: "Rights holder" - description: [ "SCHEMA: The party holding the legal copyright to the CreativeWork.", - "DCTERMS: A person or organization owning or managing rights over the resource." ] - display: "license" - helpText: "The party holding the legal copyright to the CreativeWork." - example: 'INRAE (003vg9w96)' - -associatedMedia: + enforcedValues: { + "https://bioportal.bioontology.org": "NCBO BioPortal", + "https://agroportal.lirmm.fr": "AgroPortal", + "https://bioportal.lirmm.fr": "SIFR BioPortal", + "https://ecoportal.lifewatchitaly.eu": "LifeWatch EcoPortal", + "https://medportal.bmicc.cn": "MedPortal", + "https://matportal.org": "MatPortal", + "https://industryportal.enit.fr": "IndustryPortal", + "https://earthportal.eu": "EarthPortal", + "https://biodivportal.gfbio.org": "BiodivPortal", + "https://ebi.ac.uk/ols": "EBI OLS", + "https://ontobee.org": "Ontobee", + "https://ontohub.org": "OntoHub", + "https://aber-owl.net": "AberOWL", + "https://lov.linkeddata.es/dataset/lov": "LOV", + "https://onki.fi": "ONKI Ontology Library Service", + "https://mmisw.org": "MMI ORR", + "https://cor.esipfed.org": "ESIP COR", + "https://hetop.eu": "CISMeF HeTOP", + "https://finto.fi": "FINTO", + "https://vocabs.ardc.edu.au": "ANDC RVA" , + "https://vocab.nerc.ac.uk": "NVS" , + "https://terminologies.gfbio.org": "GFBIO TS", + "https://loterre.fr": "Loterre", + "https://datalab.review.fao.org/datalab/caliper": "Caliper", + "https://cropontology.org": "Crop Ontology Curation Tool", + "https://planteome.org": "Planteome", + "https://obofoundry.org": "OBO Foundry", + "https://vest.agrisemantics.org": "Agrisemantics", + "https://fairsharing.org": "FAIRsharing", + "https://thezfiles.co.za/ROMULUS": "ROMULUS", + "https://daml.org/ontologies": "DAML Ontology Library", + "https://stl.mie.utoronto.ca/colore": "Colore", + "https://bartoc.org": "BARTOC", + "https://taxobank.org": "TaxoBank", + "https://linkeddata.ge.imati.cnr.it": "LusTRE", + "https://lov4iot.appspot.com": "LOV4IoT", + "https://vocab.linkeddata.es": "VOCAB OEG", + "https://liveschema.eu": "LiveSchema", + "https://protegewiki.stanford.edu/wiki/Protege_Ontology_Library": "Protege Ontology Library" + } + metadataMappings: [ "schema:includedInDataCatalog" ] + +### Relation + +#Imports +useImports: + display: "relations" + label: "Imports" + helpText: "References another ontology metadata instance that describes an ontology containing definitions, whose meaning is considered to be part of the meaning of the ontology described by this ontology metadata instance." + description: [ + "OWL: References another OWL ontology containing definitions, whose meaning is considered to be part of the meaning of the importing ontology.", + "OMV: References another ontology metadata instance that describes an ontology containing definitions, whose meaning is considered to be part of the meaning of the ontology described by this ontology metadata instance.", + "DCTERMS: A related resource that is required by the described resource to support its function, delivery, or coherence.", + "VOAF: Indicates that the subject vocabulary extends the expressivity of the object vocabulary by declaring subsumption relationships, using object vocabulary class as domain or range of a subject vocabulary property, defining local restrictions etc." ] extractedMetadata: true - label: "Associated media" - description: "SCHEMA: A media object that encodes this CreativeWork. This property is a synonym for encoding" - display: "images" - helpText: "A media object that encodes this ontology. This property is a synonym for encoding." - + metadataMappings: [ "omv:useImports", "owl:imports", "voaf:extends", "dcterms:requires", "oboInOwl:import" ] -workTranslation: - extractedMetadata: true - description: [ "MOD: A pointer to the translated ontology(ies) for an existing ontology. ", - "SCHEMA: A work that is a translation of the content of this work.", - "ADMS: Links Assets that are translations of each other." ] +#Prior version +hasPriorVersion: display: "relations" - helpText: "A ontology that is a translation of the content of this ontology." - metadataMappings: [ "mod:translation " ] - label: "Translated from" + label: "Prior version" + helpText: "Contains a reference to another ontology metadata instance." + description: [ + "OWL: c This identifies the specified ontology as a prior version of the containing ontology.", + "OMV: Contains a reference to another ontology metadata instance.", + "DCTERMS: A related resource of which the described resource is a version, edition, or adaptation.", + "PROV: A revision is a derivation for which the resulting entity is a revised version of some original. The implication here is that the resulting entity contains substantial content from the original.", + "DOOR: Prior version relation from OWL.", + "ADMS: A link to the previous version of the Asset." ] + extractedMetadata: true + metadataMappings: [ "omv:hasPriorVersion", "owl:priorVersion", "dcterms:isVersionOf", "door:priorVersion", "prov:wasRevisionOf", "adms:prev" ] + +#Is part of (view of) => Ontology object (bpm:viewOf) +#Has part (has views) +hasPart: + display: "relations" + label: "Has part (has views)" + helpText: "A related resource that is included either physically or logically in the described resource." + description: [ + "DCTERMS: A related resource that is included either physically or logically in the described resource.", + "SCHEMA: Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).", + "ADMS: Links to a sample of an Asset (which is itself an Asset)." ] + extractedMetadata: true + metadataMappings: [ "dcterms:hasPart", "schema:hasPart", "oboInOwl:hasSubset", "adms:sample" ] -translationOfWork: +#Specializes +explanationEvolution: + display: "relations" + label: "Specializes" + helpText: "Evolution which involves only at the syntactic level." + description: [ + "DOOR: Evolution which involves only at the syntactic level.", + "PROV: An entity that is a specialization of another shares all aspects of the latter, and additionally presents more specific aspects of the same thing as the latter.", + "VOAF:Indicates that the subject vocabulary defines some subclasses or subproperties of the object vocabulary, or local restrictions on those.", + "MOD: An ontology that is a specialization of another and presents more specific aspects." ] extractedMetadata: true - description: [ "SCHEMA: The work that this work has been translated from.", - "ADMS: Links Assets that are translations of each other." ] - metadataMappings: [ "adms:translation" ] - helpText: "The ontology that this ontology has been translated from." - label: "Translation of" + metadataMappings: [ "mod:specializes", "door:explanationEvolution", "voaf:specializes", "prov:specializationOf" ] + +#Generalizes +generalizes: display: "relations" - -includedInDataCatalog: + label: "Generalizes" + helpText: "Indicates that the subject vocabulary generalizes by some superclasses or super properties the object vocabulary." + description: [ + "VOAF: Indicates that the subject vocabulary generalizes by some superclasses or super properties the object vocabulary.", + "MOD: An ontology that is a generalization of another and presents more generic aspects.", + "PROV: Inverse property of specializationOf." ] extractedMetadata: true - label: "Indexed or Included in catalog or repository" - description: "SCHEMA: A data catalog which contains this dataset." - display: "links" - helpText: "A data catalog which contains this ontology (i.e.: OBOfoundry, aber-owl, EBI, VEST registry...)." - enforcedValues: { - "bioportal.bioontology.org": "NCBO BioPortal", - "agroportal.lirmm.fr": "AgroPortal", - "bioportal.lirmm.fr": "SIFR BioPortal", - "ebi.ac.uk/ols": "EBI OLS", - "ontobee.org": "Ontobee", - "ontohub.org": "OntoHub", - "aber-owl.net": "AberOWL", - "lov.linkeddata.es/dataset/lov": "LOV", - "onki.fi": "ONKI Ontology Library Service", - "mmisw.org": "MMI ORR", - "cor.esipfed.org": "ESIP COR", - "ecoportal.lifewatchitaly.eu": "LifeWatch EcoPortal", - "matportal.org": "MatPortal", - "medportal.bmicc.cn": "MedPortal", - "hetop.eu": "CISMeF HeTOP", - "finto.fi": "FINTO", - "vocabs.ardc.edu.au": "ANDC RVA" , - "vocab.nerc.ac.uk": "NVS" , - "terminologies.gfbio.org": "GFBIO TS", - "loterre.fr": "Loterre", - "datalab.review.fao.org/datalab/caliper": "Caliper", - "cropontology.org": "Crop Ontology Curation Tool", - "planteome.org": "Planteome", - "obofoundry.org": "OBO Foundry", - "vest.agrisemantics.org": "Agrisemantics", - "fairsharing.org": "FAIRsharing", - "thezfiles.co.za/ROMULUS": "ROMULUS", - "daml.org/ontologies": "DAML Ontology Library", - "stl.mie.utoronto.ca/colore": "Colore", - "bartoc.org": "BARTOC", - "taxobank.org": "TaxoBank", - "linkeddata.ge.imati.cnr.it": "LusTRE", - "lov4iot.appspot.com": "LOV4IoT", - "vocab.linkeddata.es": "VOCAB OEG", - "liveschema.eu": "LiveSchema", - "protegewiki.stanford.edu/wiki/Protege_Ontology_Library": "Protege Ontology Library" - } + metadataMappings: [ "voaf:generalizes", "mod:generalizes", "prov:generalizationOf" ] -prefLabelProperty: +#Used by +usedBy: + display: "relations" + label: "Used by" + helpText: "Indicates that the subject vocabulary is used by the object vocabulary." + description: [ + "VOAF: Indicates that the subject vocabulary is used by the object vocabulary.", + "NKOS: Agent using the described KOS.", + "MOD: Ontologies that use the described ontology." ] + extractedMetadata: true + metadataMappings: [ "mod:usedBy", "voaf:usedBy", "nkos:usedBy" ] + +#Relies on +#Relation +#Generaly related to +ontologyRelatedTo: + display: "relations" + label: "Generally related to or relies on" + helpText: "An ontology is related to another or relies/uses another one." + description: [ + "DCTERMS: A related resource.", + "VOAF: Indicates that the subject vocabulary uses or extends some class or property of the object vocabulary.", + "MOD: A general property for different kind of case when a semantic resource relies or reuses another one.", + "VOID: A vocabulary that is used in the dataset.", + "DOOR: An ontology is related to another if one of the DOOR relations is satisfied." ] + extractedMetadata: true + metadataMappings: [ "door:ontologyRelatedTo", "dc:relation", "dcterms:relation", "voaf:reliesOn", "mod:reliesOn", "void:vocabulary"] + +#Similar to +similarTo: + display: "relations" + label: "Similar to" + helpText: "Represents the meaning of 'how an ontology overlap/cover parts of the same area of interest of another ontology." + description: [ + "VOAF: Used to assert that two vocabularies are similar in scope and objectives, independently of the fact that they otherwise refer to each other.", + "DOOR: Represents the meaning of 'how an ontology overlap/cover parts of the same area of interest of another ontology.", + "MOD: Ontologies that are similar or thematically close to the described ontology." ] + extractedMetadata: true + metadataMappings: [ "voaf:similar", "mod:similar", "door:similarTo" ] + +#Comes from the same domain +comesFromTheSameDomain: + display: "relations" + label: "Comes from the same domain" + helpText: "If the two ontologies come from the same domain (without any other details)." + description: [ + "DOOR: If the two ontologies come from the same domain (without any other details).", + "MOD: Ontologies that come from the same domain or discipline than the described ontology, not necessariliy similar or close." ] + extractedMetadata: true + metadataMappings: [ "mod:comesFromTheSameDomain", "door:comesFromTheSameDomain" ] + +#Has equivalences with +isAlignedTo: + display: "relations" + label: "Has equivalences with" + helpText: "Links two ontologies if there exists an alignment which covers a substantial part of the vocabulary (i.e., a proportion greater than a threshold)." + description: [ + "VOAF: Indicates that the subject vocabulary declares some equivalent classes or properties with the object vocabulary.", + "DOOR: Links two ontologies if there exists an alignment which covers a substantial part of the vocabulary (i.e., a proportion greater than a threshold).", + "NKOS: A related resource with which the described resource is aligned.", + "MOD: Ontologies to which the described ontology is aligned or has equivalences or mappigns with." ] extractedMetadata: true - description: "MOD: Property used to specify objects preferred label" - label: "Object preferred label property" - display: "Object description properties" - enforcedValues: { - "http://www.w3.org/2004/02/skos/core#prefLabel": "prefLabel", - "http://www.w3.org/2000/01/rdf-schema#label": "label", - "http://schema.org/name": "name", - "http://xmlns.com/foaf/0.1/name": "name", - "http://purl.org/dc/terms/title": "title" - } - -synonymProperty: + metadataMappings: [ "door:isAlignedTo", "voaf:hasEquivalencesWith", "nkos:alignedWith", "mod:hasEquivalencesWith"] + +#Backward Compatible +isBackwardCompatibleWith: + display: "relations" + label: "Backward compatible" + helpText: "The ontology metadata instance which describes an ontology that is a compatible prior version of the ontology described by this ontology metadata Instance." + description: [ + "OWL: This identifies the specified ontology as a prior version of the containing ontology, and further indicates that it is backward compatible with it.", + "OMV: The ontology metadata instance which describes an ontology that is a compatible prior version of the ontology described by this ontology metadata Instance.", + "DOOR: The relation of being a compatible new version from owl." ] extractedMetadata: true - description: "MOD: Property used to specify objects synonyms" - label: "Object synonym property" - display: "Object description properties" - enforcedValues: { - "http://www.w3.org/2004/02/skos/core#altLabel ": "altLabel", - "http://purl.org/dc/terms/alternative ": "alternative", - "http://schema.org/alternateName": "alternativeName" - } - - -definitionProperty: + metadataMappings: [ "omv:isBackwardCompatibleWith", "owl:backwardCompatibleWith", "door:backwardCompatibleWith" ] + +#Incompatible +isIncompatibleWith: + display: "relations" + label: "Incompatible" + helpText: "The described ontology is a later version of the ontology described by the metadata specified, but is not backward compatible with it. It can be used to explicitly state that ontology cannot upgrade to use the new version without checking whether changes are required." + description: [ + "OWL: This indicates that the containing ontology is a later version of the referenced ontology, but is not backward compatible with it.", + "OMV: The described ontology is a later version of the ontology described by the metadata specified, but is not backward compatible with it. It can be used to explicitly state that ontology cannot upgrade to use the new version without checking whether changes are required." ] extractedMetadata: true - description: "MOD: Property used to specify objects' definition" - label: "Object definition property" - display: "Object description properties" - enforcedValues: { - "http://www.w3.org/2004/02/skos/core#definition": "definition", - "http://www.w3.org/2000/01/rdf-schema#comment": "comment", - "http://purl.org/dc/terms/description ": "description", - "http://schema.org/description ": "decription" - } + metadataMappings: [ "owl:incompatibleWith", "door:owlIncompatibleWith", "omv:isIncompatibleWith" ] - -authorProperty: +#Disparate modelling with +hasDisparateModelling: + display: "relations" + label: "Disparate modelling with" + helpText: "Disagreements related to the conceptualization of the ontologies." + description: [ + "DOOR: Disagreements related to the conceptualization of the ontologies. Two ontologies are considered to have disparate modeling if they represent corresponding entities in different ways, e.g. as an instance in one case and a class in the other.", + "MOD: Ontologies that are considered to have a different model, because they represent corresponding entities in different ways e.g., an instance in one case and a class in the other for the same concept." ] extractedMetadata: true - description: "MOD: Property used to specify object's author" - label: "Object author property" - display: "Object description properties" - enforcedValues: { - "http://purl.org/dc/elements/1.1/creator": "creator", - "http://schema.org/author": "author", - "http://www.w3.org/ns/prov#wasAttributedTo": "wasAttributedTo", - "http://purl.org/pav/authoredBy": "authoredBy", - "http://purl.org/pav/createdBy": "createdBy", - "http://xmlns.com/foaf/0.1/maker": "maker" - } + metadataMappings: [ "door:hasDisparateModelling", "mod:hasDisparateModellingWith" ] -obsoleteProperty: +#Has disjunctions with +hasDisjunctionsWith: + display: "relations" + label: "Has disjunctions with" + helpText: "Indicates that the subject vocabulary declares some disjunct classes with the object vocabulary." + description: [ + "VOAF: Indicates that the subject vocabulary declares some disjunct classes with the object vocabulary.", + "MOD: Indicates that the subject ontologies declares some disjunct classes with the object ontologies." ] extractedMetadata: true - description: "MOD: Property used to specify obsolete objects" - label: "Object obsolete property" - display: "Object description properties" - enforcedValues: { - "http://www.w3.org/2002/07/owl#owl:deprecated": "deprecated", - "http://identifiers.org/idot/obsolete": "obsolete" - } + metadataMappings: [ "mod:hasDisjunctionsWith", "voaf:hasDisjunctionsWith" ] -createdProperty: +#Translation +workTranslation: + display: "relations" + label: "Translation" + helpText: "A work that is a translation of the content of this work." + description: [ + "MOD: Ontologies which are translations from the described ontology. ", + "SCHEMA: A work that is a translation of the content of this work.", + "ADMS: Links Assets that are translations of each other." ] extractedMetadata: true - description: "MOD: Property used to specify the date of creation of a class or another object in the ontology." - label: "Object creation date property" - display: "Object description properties" - 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" - } + metadataMappings: [ "mod:translation", "schema:workTranslation", "adms:translation" ] + +#Translation of +translationOfWork: + display: "relations" + label: "Translation of" + helpText: "The work that this work has been translated from." + description: [ + "SCHEMA: The work that this work has been translated from.", + "ADMS: Links Assets that are translations of each other." ] + extractedMetadata: true + metadataMappings: [ "adms:translation", "schema:translationOfWork" ] + +### Content -modifiedProperty: +#Identifier pattern +uriRegexPattern: + display: "content" + label: "Identifier pattern" + helpText: "A regular expression that matches the URIs of a void:Dataset's entities." + example: 'http://purl.obolibrary.org/obo/ENVO_' + description: [ + "VOID: A regular expression that matches the URIs of a void:Dataset's entities.", + "IDOT: Regular expression describing alphanumeric strings used to identify items (or records) in a dataset." ] extractedMetadata: true - description: "MOD: Property used to specify the date of modification of a class or another object in the ontology." - label: "Object modification date property" - display: "Object description properties" - enforcedValues: { - "http://purl.org/dc/terms" , - "http://schema.org" , - "http://purl.org/pav" , - "https://omv2.sourceforge.net" - } + metadataMappings: [ "void:uriRegexPattern", "idot:identifierPattern" ] -hierarchyProperty: +#Preferred Namespace URI +preferredNamespaceUri: + display: "content" + label: "Preferred namespace URI" + helpText: "The preferred namespace URI to use when using terms from this vocabulary in an XML document." + example: '' + description: [ + "VANN: The preferred namespace URI to use when using terms from this vocabulary in an XML document.", + "VOID: A URI that is a common string prefix of all the entity URIs in a void:Dataset." ] extractedMetadata: true - description: "MOD: A property that is used to specify the hierarchy" - label: "Hierarchy property" - display: "Object description properties" - enforcedValues: { - "https://www.w3.org/TR/rdf-schema/#ch_subclassof": "rdfs:subClassOf", - "http://www.sparna.fr/skos/SKOS-traduction-francais.html#broader": "skos:broader" - } + metadataMappings: [ "void:uriSpace", "vann:preferredNamespaceUri" ] -pullLocation: +#Preferred Namespace Prefix +preferredNamespacePrefix: + display: "content" + label: "Preferred namespace prefix" + helpText: "The preferred namespace prefix to use when using terms from this ontology." + example: '' + description: [ + "VANN: The preferred namespace prefix to use when using terms from this vocabulary in an XML document.", + "IDOT: Short label that is commonly used to refer to the dataset. Often used to identify the dataset in IRIs for specific items (or records). This may also stand in place of the base IRI of the dataset (e.g. see http://prefix.cc)." ] extractedMetadata: true - description: [ "DCAT: A URL of a resource that gives access to a distribution of the dataset. E.g. landing page, feed, SPARQL endpoint.", - "OMV: The location where the ontology can be found.", - "DOAP: Web page from which the project software can be downloaded" ] - metadataMappings: [ "doap:download-page" , "dcat:accessURL" , "omv:resourceLocator" ] - label: "Access URL" - display: "Links" - enforcedValues: { - "https://www.w3.org/TR/rdf-schema/#ch_subclassof": "rdfs:subClassOf", - "http://www.sparna.fr/skos/SKOS-traduction-francais.html#broader": "skos:broader" - } + metadataMappings: [ "vann:preferredNamespacePrefix", "idot:preferredPrefix", "oboInOwl:default-namespace", "oboInOwl:hasDefaultNamespace" ] +#Root of obsolete branch obsoleteParent: - extractedMetadata: true - description: [ "MOD: property used to specify the root of an obsolete branch in the ontology." ] - metadataMappings: [ "doap:download-page" , "dcat:accessURL" , "omv:resourceLocator" ] + display: "content" label: "Root of obsolete branch" - display: "Content" - - -maxDepth: + helpText: "Property used to specify the root of an obsolete branch in the ontology." + description: [ + "MOD: Property used to specify the root of an obsolete branch in the ontology." ] extractedMetadata: true - description: "MOD: Maximum depth of the hierarchy tree (BioPortal definition)." - metadataMappings: "mod:maxDepth" - label: "Maximum depth of the hierarchy" - display: "Metrics" + metadataMappings: [ "mod:obsoleteParent" ] -maxChildCount: - extractedMetadata: true - description: "MOD: Maximum number of children per class (BioPortal definition)." - metadataMappings: "mod:maxChildCount" - label: "Maximum number of children per class" - display: "Metrics" +#Example of resource +exampleIdentifier: + display: "content" + label: "Example of resource" + helpText: "An example identifier used by one item in the ontology." + description: [ + "VOID: Example resource of dataset.", + "IDOT: An example identifier used by one item (or record) from a dataset." ] + extractedMetadata: false + metadataMappings: [ "void:exampleResource", "idot:exampleIdentifier" ] -averageChildCount: - extractedMetadata: true - description: "MOD: Average number of children per class (BioPortal definition)." - metadataMappings: "mod:averageChildCount" - label: "Average number of children per class" - display: "Metrics" +#Key classes +keyClasses: + display: "content" + label: "Key classes" + helpText: "Representative classes in the ontology." + description: [ + "OMV: Representative classes in the ontology.", + "FOAF: The primary topic of some page or document.", + "SCHEMA: Indicates the primary entity described in some page or other CreativeWork." ] + extractedMetadata: false + metadataMappings: [ "foaf:primaryTopic", "schema:mainEntity", "omv:keyClasses"] -classesWithOneChild: +#Metadata vocabulary used +metadataVoc: + display: "content" + label: "Metadata vocabulary used" + helpText: "Indicates that the subject vocabulary uses the object vocabulary in metadata at vocabulary or element level." + description: [ + "VOAF: Indicates that the subject vocabulary uses the object vocabulary in metadata at vocabulary or element level.", + "SCHEMA: Indicates (by URL or string) a particular version of a schema used in some CreativeWork.", + "ADMS: A schema according to which the Asset Repository can provide data about its content, e.g. ADMS.", + "MOD: A vocabulary(ies) that is used and/or referred to create the current ontology." ] + extractedMetadata: false + enforcedValues: { + "http://w3id.org/nkos/nkostype#classification_schema": "Classification scheme", + "http://www.w3.org/2000/01/rdf-schema#": "RDF Schema (RDFS)", + "http://www.w3.org/2002/07/owl#": "OWL 2 Web Ontology Language (OWL)", + "http://www.w3.org/2004/02/skos/core#": "Simple Knowledge Organization System (SKOS)", + "http://purl.org/dc/elements/1.1/": "Dublin core (DC)", + "http://purl.org/dc/terms/": "Dublin core (DCTERMS)", + "http://omv.ontoware.org/2005/05/ontology#": "Ontology Metadata Vocabulary (OMV)", + "http://www.isibang.ac.in/ns/mod#": "Metadata for Ontology Description and Publication (MOD 1)", + "https://w3id.org/mod": "Metadata for Ontology Description and Publication (MOD 2)", + "http://kannel.open.ac.uk/ontology#": "Descriptive Ontology of Ontology Relations (DOOR)", + "http://purl.org/vocommons/voaf#": "Vocabulary of a Friend (VOAF)", + "http://rdfs.org/ns/void#": "Vocabulary of Interlinked Datasets (VOID)", + "http://biomodels.net/vocab/idot.rdf#": "Identifiers.org (IDOT)", + "http://purl.org/vocab/vann/": "Vocabulary for annotating vocabulary descriptions (VANN)", + "http://www.w3.org/ns/dcat#": "Data Catalog Vocabulary (DCAT)", + "http://www.w3.org/ns/adms#": "Asset Description Metadata Schema (ADMS)", + "http://schema.org/": "Schema.org (SCHEMA)", + "http://xmlns.com/foaf/0.1/": "Friend of a Friend Vocabulary (FOAF)", + "http://usefulinc.com/ns/doap#": "Description of a Project (DOAP)", + "http://creativecommons.org/ns#": "Creative Commons Rights Expression Language (CC)", + "http://www.w3.org/ns/prov#": "Provenance Ontology (PROV)", + "http://purl.org/pav/": "Provenance, Authoring and Versioning (PAV)", + "http://www.geneontology.org/formats/oboInOwl#": "OboInOwl Mappings (OBOINOWL)", + "http://www.w3.org/ns/sparql-service-description#": "SPARQL 1.1 Service Description (SD)", + "http://w3id.org/nkos#": "Networked Knowledge Organization Systems Dublin Core Application Profile (NKOS)" } + metadataMappings: [ "mod:metadataVoc", "mod:vocabularyUsed", "adms:supportedSchema", "schema:schemaVersion", "voaf:metadataVoc"] + +#Root resources => Ontology object (roots) +#Classes partition => Ontology object (classes) +#Properties partition => Ontology object (properties) +#Has version => Ontology object (submissions) +#Changes => Ontology object (diffFilePath) + +### Media + +#Associated media +associatedMedia: + display: "media" + label: "The URL of a media associated to the ontology." + helpText: "A media object that encodes this ontology. This property is a synonym for encoding." + description: [ + "SCHEMA: A media object that encodes this CreativeWork. This property is a synonym for encoding." ] extractedMetadata: true - description: "MOD: Average number of children per class (BioPortal definition)." - metadataMappings: "mod:classesWithOneChild" - label: "Number of classes with a single child" - display: "Metrics" + metadataMappings: [ "schema:associatedMedia" ] -classesWithMoreThan25Children: +#Depiction +depiction: + display: "media" + label: "Depiction" + helpText: "The URL of an image or depiction representing the ontology." + description: [ + "FOAF: A depiction of something.", + "DOAP: Web page with screenshots of project. An image of the item. SCHEMA: An image of the item. This can be a URL or a fully described ImageObject.", + "SCHEMA: An image of the item. This can be a URL or a fully described ImageObject." ] extractedMetadata: true - description: "MOD: Number of classes that have more than 25 direct subclasses (BioPortal definition)." - metadataMappings: "mod:classesWithMoreThan25Children" - label: "Number of classes with more than 25 children" - display: "Metrics" - -classesWithNoDefinition: + metadataMappings: [ "doap:screenshots", "schema:image" ] + +#Logo +logo: + display: "media" + label: "Logo" + helpText: "The URL of the ontology logo." + description: [ + "FOAF: A logo representing something.", + "SCHEMA: An associated logo." ] extractedMetadata: true - description: "MOD: Number of classes that have no value for the definition property (BioPortal definition). For ontologies in OBO and RRF formats, the property for definition is part of the language. For OWL ontologies, the authors specify this property as part of the ontology metadata (the default is skos:definition)." - metadataMappings: "mod:classesWithNoDefinition" - label: "Number of classes with no definition" - display: "Metrics" + metadataMappings: [ "schema:logo", "foaf:logo"] + +### Metrics + +#Number of classes => Metrics object (classes) +#Number of individuals => Metrics object (individuals) +#Number of properties => Metrics object (properties) +#Number of object properties => Not implemented +#Number of data properties => Not implemented +#Number of axioms or triples => Not implemented +#Number of labels => Not implemented +#Number of deprecated objects => Not implemented +#Byte size => Not implemented +#Maximum depth of the hierarchy => Metrics object (maxDepth) +#Maximum number of children per class => Metrics object (maxChildCount) +#Average number of children per class => Metrics object (averageChildCount) +#Number of classes with a single child => Metrics object (classesWithOneChild) +#Number of classes with more than 25 children => Metrics object (classesWithMoreThan25Children) +#Number of classes with no definition => Metrics object (classesWithNoDefinition) + diff --git a/lib/ontologies_linked_data/concerns/mappings/mapping_creator.rb b/lib/ontologies_linked_data/concerns/mappings/mapping_creator.rb index 600ed13a..92662e57 100644 --- a/lib/ontologies_linked_data/concerns/mappings/mapping_creator.rb +++ b/lib/ontologies_linked_data/concerns/mappings/mapping_creator.rb @@ -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 diff --git a/lib/ontologies_linked_data/concerns/ontology_submissions/submission_metadata_extractor.rb b/lib/ontologies_linked_data/concerns/ontology_submissions/submission_metadata_extractor.rb index a5722893..dfd258f5 100644 --- a/lib/ontologies_linked_data/concerns/ontology_submissions/submission_metadata_extractor.rb +++ b/lib/ontologies_linked_data/concerns/ontology_submissions/submission_metadata_extractor.rb @@ -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 diff --git a/lib/ontologies_linked_data/concerns/ontology_submissions/submission_validators.rb b/lib/ontologies_linked_data/concerns/ontology_submissions/submission_validators.rb index f16c41b8..4125f501 100644 --- a/lib/ontologies_linked_data/concerns/ontology_submissions/submission_validators.rb +++ b/lib/ontologies_linked_data/concerns/ontology_submissions/submission_validators.rb @@ -46,40 +46,37 @@ def deprecated?(inst = self) module Validators include ValidatorsHelpers - def is_organization(inst, attr) - inst.bring(attr) if inst.bring?(attr) - affiliations = inst.send(attr) + def enforce_agent_type(values, type, attr) + Array(values).each do |aff| + error = ["is_#{type}", "`#{attr}` must contain only agents of type #{type.capitalize}"] + + return error unless aff.is_a?(LinkedData::Models::Agent) - Array(affiliations).each do |aff| aff.bring(:agentType) if aff.bring?(:agentType) - unless aff.agentType&.eql?('organization') - return [:is_organization, "`#{attr}` must contain only agents of type Organization"] - end + return error unless aff.agentType&.eql?(type) end - [] end - def is_person(inst, attr) + def is_organization(inst, attr) inst.bring(attr) if inst.bring?(attr) - persons = inst.send(attr) + affiliations = inst.send(attr) - Array(persons).each do |person| - person.bring(:agentType) if person.bring?(:agentType) - unless person.agentType&.eql?('person') - return [:persons, "`#{attr}` must contain only agents of type Person"] - end - end + enforce_agent_type(affiliations, 'organization', attr) + end - [] + def is_person(inst, attr) + inst.bring(attr) if inst.bring?(attr) + persons = inst.send(attr) + enforce_agent_type(persons, 'person', attr) end def lexvo_language(inst, attr) values = Array(attr_value(inst, attr)) - return if values.all? { |x| x&.to_s&.start_with?('http://lexvo.org/id/iso639-3') } + return if values.all? { |x| x&.to_s&.start_with?('http://lexvo.org/id/iso') } - [:lexvo_language, "#{attr} values need to be in the lexvo namespace (e.g http://lexvo.org/id/iso639-3/fra)"] + [:lexvo_language, "#{attr} values need to be in the lexvo namespace (e.g http://lexvo.org/id/iso639-1/fr)"] end def deprecated_retired_align(inst, attr) @@ -126,7 +123,7 @@ def include_ontology_views(inst, attr) return if views.nil? || views.empty? parts = attr_value(inst, :hasPart) || [] - return if views.all? { |v| parts.include?(v.id) } + return if views.all? { |v| parts.include?(LinkedData::Models::Base.replace_url_id_to_prefix(v.id)) } [:include_ontology_views, "#{attr} needs to include all the views of the ontology"] diff --git a/lib/ontologies_linked_data/config/config.rb b/lib/ontologies_linked_data/config/config.rb index f47ab633..ba5274cb 100644 --- a/lib/ontologies_linked_data/config/config.rb +++ b/lib/ontologies_linked_data/config/config.rb @@ -88,6 +88,7 @@ def config(&block) @settings.admin_emails ||= [] @settings.interportal_hash ||= {} + @settings.oauth_providers ||= {} # number of times to retry a query when empty records are returned @settings.num_retries_4store ||= 10 diff --git a/lib/ontologies_linked_data/models/agents/agent.rb b/lib/ontologies_linked_data/models/agents/agent.rb index f9574a0c..8afcbad3 100644 --- a/lib/ontologies_linked_data/models/agents/agent.rb +++ b/lib/ontologies_linked_data/models/agents/agent.rb @@ -16,14 +16,62 @@ class Agent < LinkedData::Models::Base attribute :identifiers, namespace: :adms, property: :identifier, enforce: %i[Identifier list unique_identifiers] attribute :affiliations, enforce: %i[Agent list is_organization], namespace: :org, property: :memberOf attribute :creator, type: :user, enforce: [:existence] - embed :identifiers, :affiliations embed_values affiliations: LinkedData::Models::Agent.goo_attrs_to_load + [identifiers: LinkedData::Models::AgentIdentifier.goo_attrs_to_load] + serialize_methods :usages write_access :creator access_control_load :creator + def self.load_agents_usages(agents = []) + is_a = RDF::URI.new('http://www.w3.org/1999/02/22-rdf-syntax-ns#type') + q = Goo.sparql_query_client.select(:id, :property, :agent, :status).distinct + .from(LinkedData::Models::OntologySubmission.uri_type) + .where( + [:id, + is_a, + LinkedData::Models::OntologySubmission.uri_type + ], + [:id, + LinkedData::Models::OntologySubmission.attribute_uri(:submissionStatus), + :status + ] + ) + + + q = q.optional([:agent, is_a, LinkedData::Models::Agent.uri_type]) + q = q.optional([:id, :property, :agent]) + + ready_submission_filter = "?status = <#{RDF::URI.new(LinkedData::Models::SubmissionStatus.id_prefix + 'RDF')}> || ?status = <#{RDF::URI.new(LinkedData::Models::SubmissionStatus.id_prefix + 'UPLOADED')}>" + q.filter(ready_submission_filter) + + + q.filter(agents.map{|agent| "?agent = <#{agent.id}>"}.join(' || ')) unless agents.empty? + + data = q.each_solution.group_by{|x| x[:agent]} + + agents_usages = data.transform_values do |values| + r = values.select { |value| value[:status]['RDF'] } + r = values.select { |value| value[:status]['UPLOADED'] } if r.empty? + r.reject{|x| x[:property].nil? }.map{|x| [x[:id], x[:property]]} + end + + agents.each do |agent| + usages = agents_usages[agent.id] + usages = usages ? usages.group_by(&:shift) : {} + usages = usages.transform_values{|x| x.flatten.map(&:to_s)} + + agent.instance_variable_set("@usages", usages) + agent.loaded_attributes.add(:usages) + end + end + + def usages(force_update: false) + self.class.load_agents_usages([self]) if !instance_variable_defined?("@usages") || force_update + @usages + end + def unique_identifiers(inst, attr) inst.bring(attr) if inst.bring?(attr) identifiers = inst.send(attr) diff --git a/lib/ontologies_linked_data/models/ontology.rb b/lib/ontologies_linked_data/models/ontology.rb index fb8011a7..17275a26 100644 --- a/lib/ontologies_linked_data/models/ontology.rb +++ b/lib/ontologies_linked_data/models/ontology.rb @@ -154,7 +154,7 @@ def update_submissions_has_part(inst, attr) sub.bring_remaining sub.hasPart = parts - sub.save + sub.save if sub.valid? return unless changed && action.eql?(:remove) diff --git a/lib/ontologies_linked_data/models/ontology_submission.rb b/lib/ontologies_linked_data/models/ontology_submission.rb index 8b0e94f6..cbf15d15 100644 --- a/lib/ontologies_linked_data/models/ontology_submission.rb +++ b/lib/ontologies_linked_data/models/ontology_submission.rb @@ -23,6 +23,7 @@ class OntologySubmission < LinkedData::Models::Base FILES_TO_DELETE = ['labels.ttl', 'mappings.ttl', 'obsolete.ttl', 'owlapi.xrdf', 'errors.log'] FOLDERS_TO_DELETE = ['unzipped'] FLAT_ROOTS_LIMIT = 1000 + FILE_SIZE_ZIPPING_THRESHOLD = 100 * 1024 * 1024 # 100MB model :ontology_submission, scheme: File.join(__dir__, '../../../config/schemes/ontology_submission.yml'), name_with: ->(s) { submission_id_generator(s) } @@ -44,13 +45,11 @@ 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' }, - onUpdate: :retired_previous_align - attribute :deprecated, namespace: :owl, type: :boolean, enforce: [:deprecated_retired_align], - onUpdate: :deprecate_previous_submissions, default: ->(x) { false } + attribute :status, namespace: :omv, enforce: %i[existence], default: ->(x) { 'production' } + attribute :deprecated, namespace: :owl, type: :boolean, default: ->(x) { false } attribute :hasOntologyLanguage, namespace: :omv, type: :ontology_format, enforce: [:existence] attribute :hasFormalityLevel, namespace: :omv, type: :uri attribute :hasOntologySyntax, namespace: :omv, type: :uri, default: ->(s) {ontology_syntax_default(s)} @@ -77,11 +76,10 @@ class OntologySubmission < LinkedData::Models::Base # Date metadata attribute :released, type: :date_time, enforce: [:existence] - attribute :valid, namespace: :dct, type: :date_time, enforce: [:validity_date_retired_align] - attribute :curatedOn, namespace: :pav, type: %i[date_time list], enforce: [:superior_equal_to_creationDate] + attribute :valid, namespace: :dct, type: :date_time + attribute :curatedOn, namespace: :pav, type: %i[date_time list] attribute :creationDate, namespace: :omv, type: :date_time, default: ->(x) { Date.today.to_datetime } - attribute :modificationDate, namespace: :omv, type: :date_time, - enforce: %i[superior_equal_to_creationDate modification_date_previous_align] + attribute :modificationDate, namespace: :omv, type: :date_time # Person and organizations metadata attribute :contact, type: %i[contact list], enforce: [:existence] @@ -90,14 +88,14 @@ class OntologySubmission < LinkedData::Models::Base attribute :curatedBy, namespace: :pav, type: %i[list Agent] attribute :publisher, namespace: :dct, type: %i[list Agent] attribute :fundedBy, namespace: :foaf, type: %i[list Agent], enforce: [:is_organization] - attribute :endorsedBy, namespace: :omv, type: :list, enforce: [:is_organization] + attribute :endorsedBy, namespace: :omv, type: %i[list Agent], enforce: [:is_organization] attribute :translator, namespace: :schema, type: %i[list Agent] # Community metadata attribute :audience, namespace: :dct attribute :repository, namespace: :doap, type: :uri attribute :bugDatabase, namespace: :doap, type: :uri - attribute :mailingList, namespace: :doap, enforce: [:email] + attribute :mailingList, namespace: :doap attribute :toDoList, namespace: :voaf, type: :list attribute :award, namespace: :schema, type: :list @@ -111,8 +109,8 @@ class OntologySubmission < LinkedData::Models::Base # Methodology metadata attribute :conformsToKnowledgeRepresentationParadigm, namespace: :omv attribute :usedOntologyEngineeringMethodology, namespace: :omv - attribute :usedOntologyEngineeringTool, namespace: :omv, type: %i[list uri] - attribute :accrualMethod, namespace: :dct, type: %i[list uri] + attribute :usedOntologyEngineeringTool, namespace: :omv, type: %i[list] + attribute :accrualMethod, namespace: :dct, type: %i[list] attribute :accrualPeriodicity, namespace: :dct attribute :accrualPolicy, namespace: :dct attribute :competencyQuestion, namespace: :mod, type: :list @@ -133,29 +131,29 @@ class OntologySubmission < LinkedData::Models::Base attribute :includedInDataCatalog, namespace: :schema, type: %i[list uri] # Relations - attribute :hasPriorVersion, namespace: :omv, type: :uri, onUpdate: [:include_previous_submission] - attribute :hasPart, namespace: :dct, type: %i[uri list], enforce: %i[include_ontology_views] - attribute :ontologyRelatedTo, namespace: :door, type: %i[list uri], onUpdate: :enforce_symmetric_ontologies - attribute :similarTo, namespace: :door, type: %i[list uri], onUpdate: :enforce_symmetric_ontologies - attribute :comesFromTheSameDomain, namespace: :door, type: %i[list uri], onUpdate: :enforce_symmetric_ontologies - attribute :isAlignedTo, namespace: :door, type: %i[list uri], onUpdate: :enforce_symmetric_ontologies + attribute :hasPriorVersion, namespace: :omv, type: :uri + attribute :hasPart, namespace: :dct, type: %i[uri list] + attribute :ontologyRelatedTo, namespace: :door, type: %i[list uri] + attribute :similarTo, namespace: :door, type: %i[list uri] + attribute :comesFromTheSameDomain, namespace: :door, type: %i[list uri] + attribute :isAlignedTo, namespace: :door, type: %i[list uri] attribute :isBackwardCompatibleWith, namespace: :omv, type: %i[list uri] attribute :isIncompatibleWith, namespace: :omv, type: %i[list uri] - attribute :hasDisparateModelling, namespace: :door, type: %i[list uri], onUpdate: :enforce_symmetric_ontologies + attribute :hasDisparateModelling, namespace: :door, type: %i[list uri] attribute :hasDisjunctionsWith, namespace: :voaf, type: %i[uri list] - attribute :generalizes, namespace: :voaf, type: %i[list uri], onUpdate: :ontology_inverse_of_callback - attribute :explanationEvolution, namespace: :door, type: %i[list uri], onUpdate: :ontology_inverse_of_callback - attribute :useImports, namespace: :omv, type: %i[list uri], onUpdate: :ontology_inverse_of_callback - attribute :usedBy, namespace: :voaf, type: %i[uri list], onUpdate: :ontology_inverse_of_callback - attribute :workTranslation, namespace: :schema, type: %i[uri list], onUpdate: :ontology_inverse_of_callback - attribute :translationOfWork, namespace: :schema, type: %i[uri list], onUpdate: :ontology_inverse_of_callback + attribute :generalizes, namespace: :voaf, type: %i[list uri] + attribute :explanationEvolution, namespace: :door, type: %i[list uri] + attribute :useImports, namespace: :omv, type: %i[list uri] + attribute :usedBy, namespace: :voaf, type: %i[uri list] + attribute :workTranslation, namespace: :schema, type: %i[uri list] + attribute :translationOfWork, namespace: :schema, type: %i[uri list] # Content metadata attribute :uriRegexPattern, namespace: :void, type: :uri attribute :preferredNamespaceUri, namespace: :vann, type: :uri attribute :preferredNamespacePrefix, namespace: :vann - attribute :exampleIdentifier, namespace: :idot, type: :class, default: ->(s) { LinkedData::Models::Class.in(s).first } - attribute :keyClasses, namespace: :omv, type: %i[list class] + attribute :exampleIdentifier, namespace: :idot + attribute :keyClasses, namespace: :omv, type: %i[list] attribute :metadataVoc, namespace: :voaf, type: %i[uri list] attribute :uploadFilePath attribute :diffFilePath @@ -181,14 +179,13 @@ class OntologySubmission < LinkedData::Models::Base def self.agents_attrs [:hasCreator, :publisher, :copyrightHolder, :hasContributor, - :translator, :endorsedBy, :fundedBy, :publisher, :curatedBy ] + :translator, :endorsedBy, :fundedBy, :curatedBy] end # Hypermedia settings - embed *[:contact, :ontology] + agents_attrs + embed *[:contact, :ontology, :metrics] + agents_attrs def self.embed_values_hash out = { - submissionStatus: [:code], hasOntologyLanguage: [:acronym], metrics: %i[classes individuals properties], - + submissionStatus: [:code], hasOntologyLanguage: [:acronym] } agent_attributes = LinkedData::Models::Agent.goo_attrs_to_load + @@ -499,6 +496,10 @@ def zip_submission_uploaded_file return self.uploadFilePath if zipped? return self.uploadFilePath if self.uploadFilePath.nil? || self.uploadFilePath.empty? + + return self.uploadFilePath if File.size(self.uploadFilePath) < FILE_SIZE_ZIPPING_THRESHOLD + + old_path = self.uploadFilePath new_path = Utils::FileHelpers.zip_file(old_path) FileUtils.rm(old_path, force: true) @@ -1670,7 +1671,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: []) diff --git a/lib/ontologies_linked_data/models/users/oauth_authentication.rb b/lib/ontologies_linked_data/models/users/oauth_authentication.rb new file mode 100644 index 00000000..ac4bdf0a --- /dev/null +++ b/lib/ontologies_linked_data/models/users/oauth_authentication.rb @@ -0,0 +1,191 @@ +require 'bcrypt' +require 'openssl' +require 'base64' +require 'json' +require 'jwt' +require 'faraday' + +module LinkedData + module Models + module Users + module OAuthAuthentication + + def self.included base + base.extend ClassMethods + end + + module ClassMethods + + def oauth_providers + LinkedData.settings.oauth_providers + end + + def oauth_authenticate(token, provider) + user_data = case provider.to_sym + when :github + auth_github(token) + when :google + auth_google(token) + when :orcid + auth_orcid(token) + when :keycloak + auth_keycloak(token) + else + nil + end + + create_if_not_exists(user_data) if user_data + end + + private + + def create_if_not_exists(user_data) + user = user_by_email(user_data[:email]) + if user.nil? + auth_create_user(user_data) + else + sync_providers_id(user, user_data[:githubId], user_data[:orcidId]) + end + end + + def sync_providers_id(user, github_id, orcid_id) + user.bring_remaining + + user.githubId = github_id if user.githubId&.empty? && !github_id&.empty? + user.orcidId = orcid_id if user.orcidId&.empty? && !orcid_id&.empty? + + + user.save(override_security: true) if user.valid? + user + end + + def auth_create_user(user_data) + user = User.new(user_data) + user.password = SecureRandom.hex(16) + + return nil unless user.valid? + + user.save(send_notifications: true) + user + end + + def user_by_email(email) + LinkedData::Models::User.where(email: email).first + end + + def user_from_orcid_data(user_data) + { + email: user_data['email'], + firstName: user_data['name']['given-names'], + lastName: user_data['name']['family-name'], + username: user_data['email'].split('@').first, + orcidId: user_data['orcid'] + } + end + + def auth_orcid(token) + user_data = token_check(token, :orcid) + + return nil if user_data.nil? + + user_from_orcid_data user_data + + end + + def user_from_google_data(user_data) + { + email: user_data['email'], + firstName: user_data['given_name'], + lastName: user_data['family_name'], + username: user_data['email'].split('@').first + } + end + + def auth_google(token) + user_data = token_check(token, :google) + + return nil if user_data.nil? + + user_from_google_data user_data + end + + def user_from_github_data(user_data) + { + email: user_data['email'], + username: user_data['login'], + firstName: user_data['name'].split(' ').first, + lastName: user_data['name'].split(' ').drop(1).join(' '), + githubId: user_data['login'] + } + + end + + def auth_github(token) + + user_data = token_check(token, :github) + + return nil if user_data.nil? + + user_from_github_data user_data + + end + + def user_from_keycloak_data(user_data) + { + email: user_data['email'], + username: user_data['preferred_username'], + firstName: user_data['given_name'], + lastName: user_data['family_name'] + } + end + + def auth_keycloak(token) + user_data = token_check(token, :keycloak) + + return nil if user_data.nil? + + user_from_keycloak_data user_data + end + + def token_check(token, provider) + provider_config = oauth_providers[provider.to_sym] + + return nil unless provider_config + + if provider_config[:check].eql?(:access_token) + access_token_check(token, provider_config[:link]) + elsif provider_config[:check].eql?(:jwt_token) + jwt_token_check(token, provider_config[:cert]) + end + end + + def jwt_token_check(jwt_token, cert) + decode_cert = Base64.decode64(cert) + rsa_public = OpenSSL::X509::Certificate.new(decode_cert).public_key + begin + JWT.decode(jwt_token, rsa_public, true, { algorithm: 'HS256' }) + rescue JWT::DecodeError + nil + end + end + + def access_token_check(token, link) + response = Faraday.new(url: link) do |faraday| + faraday.headers['Authorization'] = "Bearer #{token}" + faraday.adapter Faraday.default_adapter + end.get + + return nil unless response.success? + + JSON.parse(response.body) + end + end + + end + + end + + end +end + + diff --git a/lib/ontologies_linked_data/models/users/user.rb b/lib/ontologies_linked_data/models/users/user.rb index 39bd4f8d..87b2821b 100644 --- a/lib/ontologies_linked_data/models/users/user.rb +++ b/lib/ontologies_linked_data/models/users/user.rb @@ -9,15 +9,17 @@ module Models class User < LinkedData::Models::Base include BCrypt include LinkedData::Models::Users::Authentication + include LinkedData::Models::Users::OAuthAuthentication attr_accessor :show_apikey model :user, name_with: :username attribute :username, enforce: [:unique, :existence] - attribute :email, enforce: [:existence] + attribute :email, enforce: [:unique, :existence] attribute :role, enforce: [:role, :list], :default => lambda {|x| [LinkedData::Models::Users::Role.default]} attribute :firstName attribute :lastName + attribute :subscribed, default: false attribute :githubId, enforce: [:unique] attribute :orcidId, enforce: [:unique] attribute :created, enforce: [:date_time], :default => lambda { |record| DateTime.now } @@ -72,6 +74,14 @@ def save(*args) Ontology.cache_collection_invalidate OntologySubmission.cache_collection_invalidate end + + if args.include?(:send_notifications) && args[:send_notifications] + begin + LinkedData::Utils::Notifications.new_user(user) + rescue Exception => e + end + end + super end diff --git a/lib/ontologies_linked_data/monkeypatches/object.rb b/lib/ontologies_linked_data/monkeypatches/object.rb index 66ad77a8..45599d1b 100644 --- a/lib/ontologies_linked_data/monkeypatches/object.rb +++ b/lib/ontologies_linked_data/monkeypatches/object.rb @@ -54,7 +54,7 @@ def to_flex_hash(options = {}, &block) # Add methods methods = methods - do_not_serialize_nested(options) methods.each do |method| - hash[method] = self.send(method.to_s) if self.respond_to?(method) rescue next + populate_attribute(hash, method) if self.respond_to?(method) rescue next end # Get rid of everything except the 'only' @@ -244,7 +244,7 @@ def populate_attributes(hash, all = false, only = [], options = {}) attributes.each do |attribute| next unless self.respond_to?(attribute) - hash[attribute] = self.send(attribute) + populate_attribute(hash, attribute) end elsif !only.empty? # Only get stuff we need @@ -256,13 +256,22 @@ def populate_attributes(hash, all = false, only = [], options = {}) hash end + def populate_attribute(hash, attribute) + if self.method(attribute).parameters.eql?([[:rest, :args]]) + hash[attribute] = self.send(attribute, include_languages: true) + else + # a serialized method + hash[attribute] = self.send(attribute) + end + end + def populate_hash_from_list(hash, attributes) attributes.each do |attribute| attribute = attribute.to_sym next unless self.respond_to?(attribute) begin - hash[attribute] = self.send(attribute, include_languages: true) + populate_attribute(hash, attribute) rescue Goo::Base::AttributeNotLoaded next rescue ArgumentError diff --git a/lib/ontologies_linked_data/security/authorization.rb b/lib/ontologies_linked_data/security/authorization.rb index e64fe9f9..05a02789 100644 --- a/lib/ontologies_linked_data/security/authorization.rb +++ b/lib/ontologies_linked_data/security/authorization.rb @@ -1,49 +1,55 @@ require 'set' + module LinkedData module Security class Authorization APIKEYS_FOR_AUTHORIZATION = {} + USER_APIKEY_PARAM = 'userapikey'.freeze + API_KEY_PARAM = 'apikey'.freeze + def initialize(app = nil) @app = app end ROUTES_THAT_BYPASS_SECURITY = Set.new([ - "/", - "/documentation", - "/jsonview/jsonview.css", - "/jsonview/jsonview.js" - ]) + "/", + "/documentation", + "/jsonview/jsonview.css", + "/jsonview/jsonview.js" + ]) def call(env) req = Rack::Request.new(env) params = req.params + apikey = find_apikey(env, params) + status = 200 + error_message = '' - unless apikey - status = 401 - response = { - status: status, - error: "You must provide an API Key either using the query-string parameter `apikey` or the `Authorization` header: `Authorization: apikey token=my_apikey`. " + \ - "Your API Key can be obtained by logging in at #{LinkedData.settings.ui_host}/account" - } - end - if status != 401 && !authorized?(apikey, env) + if !apikey + status = 401 + error_message = <<-MESSAGE + You must provide an API Key either using the query-string parameter `apikey` or the `Authorization` header: `Authorization: apikey token=my_apikey`. + Your API Key can be obtained by logging in at #{LinkedData.settings.ui_host}/account" + MESSAGE + elsif !authorized?(apikey, env) status = 401 - response = { - status: status, - error: "You must provide a valid API Key. " + \ - "Your API Key can be obtained by logging in at #{LinkedData.settings.ui_host}/account" - } + error_message = "You must provide a valid API Key. Your API Key can be obtained by logging in at #{LinkedData.settings.ui_host}/account" end - if status == 401 && !bypass?(env) + response = { + status: status, + error: error_message + } + + if status.eql?(401) && !bypass?(env) LinkedData::Serializer.build_response(env, status: status, body: response) else status, headers, response = @app.call(env) - apikey_cookie(env, headers, apikey, params) + save_apikey_in_cookie(env, headers, apikey, params) [status, headers, response] end end @@ -57,55 +63,56 @@ def bypass?(env) ## # Inject a cookie with the API Key if it is present and we're in HTML content type - def apikey_cookie(env, headers, apikey, params) + COOKIE_APIKEY_PARAM = "ncbo_apikey" + def save_apikey_in_cookie(env, headers, apikey, params) # If we're using HTML, inject the apikey in a cookie (ignores bad accept headers) + best = nil begin best = LinkedData::Serializer.best_response_type(env, params) - rescue LinkedData::Serializer::AcceptHeaderError; end - if best == LinkedData::MediaTypes::HTML - Rack::Utils.set_cookie_header!(headers, "ncbo_apikey", {:value => apikey, :path => "/", :expires => Time.now+90*24*60*60}) + rescue LinkedData::Serializer::AcceptHeaderError + # Ignored end + + return unless best == LinkedData::MediaTypes::HTML + + Rack::Utils.set_cookie_header!(headers, COOKIE_APIKEY_PARAM, { + value: apikey, + path: '/', + expires: Time.now + 90 * 24 * 60 * 60 + }) end def find_apikey(env, params) - apikey = nil - header_auth = env["HTTP_AUTHORIZATION"] || env["Authorization"] - if params["apikey"] && params["userapikey"] - apikey_authed = authorized?(params["apikey"], env) - return unless apikey_authed - apikey = params["userapikey"] - elsif params["apikey"] - apikey = params["apikey"] - elsif apikey.nil? && header_auth - token = Rack::Utils.parse_query(header_auth.split(" ")[1]) - # Strip spaces from start and end of string - apikey = token["token"].gsub(/\"/, "") - # If the user apikey is passed, use that instead - if token["userapikey"] && !token["userapikey"].empty? - apikey_authed = authorized?(apikey, env) - return unless apikey_authed - apikey = token["userapikey"].gsub(/\"/, "") - end - elsif apikey.nil? && env["HTTP_COOKIE"] && env["HTTP_COOKIE"].include?("ncbo_apikey") - cookie = Rack::Utils.parse_query(env["HTTP_COOKIE"]) - apikey = cookie["ncbo_apikey"] if cookie["ncbo_apikey"] - end - apikey + apikey = user_apikey(env, params) + return apikey if apikey + + apikey = params[API_KEY_PARAM] + return apikey if apikey + + apikey = request_header_apikey(env) + return apikey if apikey + + cookie_apikey(env) end + def authorized?(apikey, env) return false if apikey.nil? + if APIKEYS_FOR_AUTHORIZATION.key?(apikey) store_user(APIKEYS_FOR_AUTHORIZATION[apikey], env) else - users = LinkedData::Models::User.where(apikey: apikey).include(LinkedData::Models::User.attributes(:all)).to_a - return false if users.empty? + user = LinkedData::Models::User.where(apikey: apikey) + .include(LinkedData::Models::User.attributes(:all)) + .first + return false if user.nil? + # This will kind-of break if multiple apikeys exist # Though it is also kind-of ok since we just want to know if a user with corresponding key exists - user = users.first + store_user(user, env) end - return true + true end def store_user(user, env) @@ -113,6 +120,47 @@ def store_user(user, env) env.update("REMOTE_USER" => user) end + private + + + def request_header_apikey(env) + header_auth = get_header_auth(env) + return if header_auth.empty? + + token = Rack::Utils.parse_query(header_auth.split(' ').last) + # Strip spaces from start and end of string + apikey = token['token'].gsub(/\"/, "") + # If the user apikey is passed, use that instead + if token[USER_APIKEY_PARAM] && !token[USER_APIKEY_PARAM].empty? + apikey_authed = authorized?(apikey, env) + return unless apikey_authed + + apikey = token[USER_APIKEY_PARAM].gsub(/\"/, "") + end + apikey + end + + def cookie_apikey(env) + return unless env["HTTP_COOKIE"] + + cookie = Rack::Utils.parse_query(env['HTTP_COOKIE']) + cookie[COOKIE_APIKEY_PARAM] if cookie['ncbo_apikey'] + end + + def get_header_auth(env) + env["HTTP_AUTHORIZATION"] || env["Authorization"] || '' + end + + def user_apikey(env,params) + return unless (params["apikey"] && params["userapikey"]) + + apikey_authed = authorized?(params[API_KEY_PARAM], env) + + return unless apikey_authed + + params[USER_APIKEY_PARAM] + end + end end end diff --git a/lib/ontologies_linked_data/serializer.rb b/lib/ontologies_linked_data/serializer.rb index 4e2e67ba..c1d9f630 100644 --- a/lib/ontologies_linked_data/serializer.rb +++ b/lib/ontologies_linked_data/serializer.rb @@ -84,7 +84,9 @@ def self.response(options = {}) end def self.serialize(type, obj, params, request) - lang = params['lang'] || params['language']|| Goo.main_languages.first + + lang = self.get_language(params) + only = params['display'] || [] only = only.split(',') unless only.is_a?(Array) all = only[0] == 'all' diff --git a/lib/ontologies_linked_data/serializers/json.rb b/lib/ontologies_linked_data/serializers/json.rb index 7e550199..e4161b49 100644 --- a/lib/ontologies_linked_data/serializers/json.rb +++ b/lib/ontologies_linked_data/serializers/json.rb @@ -7,7 +7,7 @@ class JSON def self.serialize(obj, options = {}) - result_lang = nil + hash = obj.to_flex_hash(options) do |hash, hashed_obj| current_cls = hashed_obj.respond_to?(:klass) ? hashed_obj.klass : hashed_obj.class result_lang = self.get_languages(get_object_submission(hashed_obj), options[:lang]) if result_lang.nil? @@ -71,7 +71,7 @@ def self.get_languages(submission, user_languages) def self.get_submission_languages(submission_natural_language = []) submission_natural_language = submission_natural_language.values.flatten if submission_natural_language.is_a?(Hash) submission_natural_language.map { |natural_language| natural_language.to_s['iso639'] && natural_language.to_s.split('/').last[0..1].to_sym }.compact - end + end def self.type(current_cls, hashed_obj) if current_cls.respond_to?(:type_uri) diff --git a/test/mappings/test_mappings_bulk_load.rb b/test/mappings/test_mappings_bulk_load.rb index 9b2daf86..e520e7c7 100644 --- a/test/mappings/test_mappings_bulk_load.rb +++ b/test/mappings/test_mappings_bulk_load.rb @@ -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 diff --git a/test/models/test_agent.rb b/test/models/test_agent.rb index ae7d199d..09552803 100644 --- a/test/models/test_agent.rb +++ b/test/models/test_agent.rb @@ -3,8 +3,9 @@ class TestAgent < LinkedData::TestCase def self.before_suite + backend_4s_delete self.new("before_suite").teardown - @@user1 = LinkedData::Models::User.new(:username => "user11111", :email => "some1111@email.org" ) + @@user1 = LinkedData::Models::User.new(:username => "user11111", :email => "some1111@email.org") @@user1.passwordHash = "some random pass hash" @@user1.save end @@ -15,32 +16,28 @@ def self.after_suite @@user1.delete end - - def test_agent_no_valid - @agents =[ - LinkedData::Models::Agent.new(name:"name 0", email:"test_0@test.com", agentType: 'organization',creator: @@user1 ), - LinkedData::Models::Agent.new(name:"name 1", email:"test_1@test.com", agentType: 'person', creator: @@user1 ), - LinkedData::Models::Agent.new(name:"name 2", email:"test_2@test.com", agentType: 'person', creator: @@user1 ) + @agents = [ + LinkedData::Models::Agent.new(name: "name 0", email: "test_0@test.com", agentType: 'organization', creator: @@user1), + LinkedData::Models::Agent.new(name: "name 1", email: "test_1@test.com", agentType: 'person', creator: @@user1), + LinkedData::Models::Agent.new(name: "name 2", email: "test_2@test.com", agentType: 'person', creator: @@user1) ] @identifiers = [ LinkedData::Models::AgentIdentifier.new(notation: '000h6jb29', schemaAgency: 'ROR', creator: @@user1), LinkedData::Models::AgentIdentifier.new(notation: '000h6jb29', schemaAgency: 'ORCID', creator: @@user1), ] - @identifiers.each {|i| i.save} + @identifiers.each { |i| i.save } - affiliations = @agents[0..2].map{ |a| a.save } + affiliations = @agents[0..2].map { |a| a.save } agent = @agents.last agent.affiliations = affiliations - refute agent.valid? refute_nil agent.errors[:affiliations][:is_organization] - affiliations.each{|x| x.delete} - + affiliations.each { |x| x.delete } agents = @agents[0..2].map do |a| a.identifiers = @identifiers @@ -54,8 +51,7 @@ def test_agent_no_valid refute second_agent.valid? refute_nil second_agent.errors[:identifiers][:unique_identifiers] - - @identifiers.each{|i| i.delete} + @identifiers.each { |i| i.delete } end def test_identifier_find @@ -69,6 +65,7 @@ def test_identifier_find id.delete end + def test_identifier_no_valid refute LinkedData::Models::AgentIdentifier.new(notation: 'https://ror.org/000h6jb29', schemaAgency: 'ROR', creator: @@user1).valid? id = LinkedData::Models::AgentIdentifier.new(notation: '000h6jb29"', schemaAgency: 'ROR', creator: @@user1) @@ -82,4 +79,78 @@ def test_identifier_no_valid id.delete end + def test_all_agents_usages_load + count, acronyms, ontologies = create_ontologies_and_submissions(ont_count: 3, submission_count: 1, + process_submission: false) + agents, sub1, sub2, sub3 = agent_usages_test_setup(ontologies) + ## using batch load + t1 = Benchmark.measure('batch load') do + LinkedData::Models::Agent.load_agents_usages(agents) + agent_usages_test(agents, sub1, sub2, sub3) + end + + ## using by elems loafing + t2 = Benchmark.measure('eager load') do + agents, sub1, sub2, sub3 = agent_usages_test_setup(ontologies) + agent_usages_test(agents, sub1, sub2, sub3) + end + + assert t1.total < t2.total, "batch loading should be more faster than eager loading" + end + private + + def agent_usages_test_setup(ontologies) + o1 = ontologies[0] + o2 = ontologies[1] + o3 = ontologies[2] + sub1 = o1.latest_submission(status: :any) + sub2 = o2.latest_submission(status: :any) + sub3 = o3.latest_submission(status: :any) + refute_nil sub1 + refute_nil sub2 + refute_nil sub3 + + agents = [LinkedData::Models::Agent.new(name: "name 0", email: "test_0@test.com", agentType: 'organization', creator: @@user1).save, + LinkedData::Models::Agent.new(name: "name 1", email: "test_1@test.com", agentType: 'organization', creator: @@user1).save, + LinkedData::Models::Agent.new(name: "name 2", email: "test_2@test.com", agentType: 'person', creator: @@user1).save] + + sub1.hasCreator = [agents.last] + sub1.publisher = agents[0..1] + sub1.fundedBy = [agents[0]] + sub1.bring_remaining + assert sub1.valid? + sub1.save + + sub2.hasCreator = [agents.last] + sub2.endorsedBy = [agents[0]] + sub2.fundedBy = agents[0..1] + sub2.bring_remaining + assert sub2.valid? + sub2.save + + [agents, sub1, sub2, sub3] + end + def agent_usages_test(agents, sub1, sub2, sub3) + usages = agents[0].usages + + assert_equal 2, usages.size + + refute_nil usages[sub1.id] + assert_equal usages[sub1.id].map(&:to_s).sort, ["http://purl.org/dc/terms/publisher", "http://xmlns.com/foaf/0.1/fundedBy"].sort + refute_nil usages[sub2.id].map(&:to_s).sort, ["http://omv.ontoware.org/2005/05/ontology#endorsedBy", "http://xmlns.com/foaf/0.1/fundedBy"].sort + + sub3.copyrightHolder = agents[0] + sub3.bring_remaining + sub3.save + + usages = agents[0].usages(force_update: true) + assert_equal 3, usages.size + + refute_nil usages[sub1.id] + assert_equal usages[sub1.id].map(&:to_s).sort, ["http://purl.org/dc/terms/publisher", "http://xmlns.com/foaf/0.1/fundedBy"].sort + assert_equal usages[sub2.id].map(&:to_s).sort, ["http://omv.ontoware.org/2005/05/ontology#endorsedBy", "http://xmlns.com/foaf/0.1/fundedBy"].sort + assert_equal usages[sub3.id].map(&:to_s), ["http://schema.org/copyrightHolder"] + + agents.each{|x| x.delete} + end end diff --git a/test/models/test_ontology.rb b/test/models/test_ontology.rb index 5e1a1849..f5e6ca5d 100644 --- a/test/models/test_ontology.rb +++ b/test/models/test_ontology.rb @@ -426,25 +426,25 @@ def test_duplicate_contacts # A test to benchmark the time taken by bring_remaining (query not optimized, can take a long time if a lot of value in the list attributes) def test_ontology_bring_remaining # Creating the users - user1 = LinkedData::Models::User.new(:username => "user1", :email => "some@email.org" ) + user1 = LinkedData::Models::User.new(:username => "user1", :email => "some1@email.org" ) user1.passwordHash = "some random pass hash" user1.save - user2 = LinkedData::Models::User.new(:username => "user2", :email => "some@email.org" ) + user2 = LinkedData::Models::User.new(:username => "user2", :email => "some2@email.org" ) user2.passwordHash = "some random pass hash" user2.save - user3 = LinkedData::Models::User.new(:username => "user3", :email => "some@email.org" ) + user3 = LinkedData::Models::User.new(:username => "user3", :email => "some3@email.org" ) user3.passwordHash = "some random pass hash" user3.save - user4 = LinkedData::Models::User.new(:username => "user4", :email => "some@email.org" ) + user4 = LinkedData::Models::User.new(:username => "user4", :email => "some4@email.org" ) user4.passwordHash = "some random pass hash" user4.save - user5 = LinkedData::Models::User.new(:username => "user5", :email => "some@email.org" ) + user5 = LinkedData::Models::User.new(:username => "user5", :email => "some5@email.org" ) user5.passwordHash = "some random pass hash" user5.save - user6 = LinkedData::Models::User.new(:username => "user6", :email => "some@email.org" ) + user6 = LinkedData::Models::User.new(:username => "user6", :email => "some6@email.org" ) user6.passwordHash = "some random pass hash" user6.save - user7 = LinkedData::Models::User.new(:username => "user7", :email => "some@email.org" ) + user7 = LinkedData::Models::User.new(:username => "user7", :email => "some7@email.org" ) user7.passwordHash = "some random pass hash" user7.save diff --git a/test/models/test_ontology_submission.rb b/test/models/test_ontology_submission.rb index 5c0e45a1..aba6f67c 100644 --- a/test/models/test_ontology_submission.rb +++ b/test/models/test_ontology_submission.rb @@ -38,7 +38,7 @@ def test_valid_ontology os.status = 'beta' assert os.valid? end - + def test_sanity_check_zip acronym = "ADARTEST" @@ -342,6 +342,8 @@ def test_process_submission_archive parse_options = { process_rdf: false, index_search: false, index_commit: false, run_metrics: false, reasoning: false, archive: true } + old_threshold = LinkedData::Models::OntologySubmission::FILE_SIZE_ZIPPING_THRESHOLD + LinkedData::Models::OntologySubmission.const_set(:FILE_SIZE_ZIPPING_THRESHOLD, 0) ont_count, ont_acronyms, ontologies = create_ontologies_and_submissions(ont_count: 1, submission_count: 2, @@ -392,13 +394,14 @@ def test_process_submission_archive %-File deletion failed for '#{old_sub.csv_path}'- assert_equal false, File.file?(old_sub.parsing_log_path), - %-File deletion failed for '#{old_sub.parsing_log_path}'- + %-File deletion failed for '#{old_sub.parsing_log_path}'- assert_equal false, File.file?(old_file_path), %-File deletion failed for '#{old_file_path}'- assert old_sub.zipped? assert File.file?(old_sub.uploadFilePath) + LinkedData::Models::OntologySubmission.const_set(:FILE_SIZE_ZIPPING_THRESHOLD, old_threshold) end def test_submission_diff_across_ontologies diff --git a/test/models/test_ontology_submission_validators.rb b/test/models/test_ontology_submission_validators.rb index 6769d7e8..05ebe6ff 100644 --- a/test/models/test_ontology_submission_validators.rb +++ b/test/models/test_ontology_submission_validators.rb @@ -5,10 +5,12 @@ class TestOntologySubmissionValidators < LinkedData::TestOntologyCommon def test_enforce_symmetric_ontologies + skip 'complex validators disabled' ontologies_properties_callbacks(:ontologyRelatedTo) end def test_lexvo_language_validator + submissions = sorted_submissions_init(1) sub = submissions.first @@ -16,7 +18,7 @@ def test_lexvo_language_validator sub.bring_remaining assert sub.valid? - sub.naturalLanguage = ["fr" , "http://iso639-3/eng"] + sub.naturalLanguage = ["fr", "http://iso639-3/eng"] refute sub.valid? assert sub.errors[:naturalLanguage][:lexvo_language] @@ -29,6 +31,8 @@ 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 @@ -72,6 +76,7 @@ def test_submission_retired_validity end def test_modification_date_previous_align + skip 'complex validators disabled' sorted_submissions = sorted_submissions_init latest = sorted_submissions[0] @@ -104,16 +109,21 @@ def test_modification_date_previous_align end def test_has_prior_version_callback + skip 'complex validators disabled' + sorted_submissions = sorted_submissions_init sorted_submissions.each_cons(2) do |current, previous| current.bring :hasPriorVersion + refute_nil current.hasPriorVersion assert previous.id, current.hasPriorVersion end end 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') @@ -165,6 +175,7 @@ def test_update_submissions_has_part end def test_inverse_use_imports_callback + skip 'complex validators disabled' ontologies_properties_callbacks(:useImports, :usedBy) end @@ -184,14 +195,13 @@ def sorted_submissions_init(submission_count = 3) ont.submissions.sort { |a, b| b.submissionId <=> a.submissionId } end - def ontologies_properties_callbacks(attr, inverse_attr = nil) + 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') - assert_equal 3, ontologies.size ontologies[0].bring :submissions @@ -202,7 +212,7 @@ def ontologies_properties_callbacks(attr, inverse_attr = nil) assert_empty first_sub.send(attr) first_sub.bring_remaining - first_sub.send( "#{attr}=",[ontologies[1].id, ontologies[2].id]) + first_sub.send("#{attr}=", [ontologies[1].id, ontologies[2].id]) assert first_sub.valid? @@ -216,7 +226,7 @@ def ontologies_properties_callbacks(attr, inverse_attr = nil) assert_equal [ontologies[0].id], sub.send(inverse_attr) end - #sub is the submission of the ontology 2 + # sub is the submission of the ontology 2 sub.bring_remaining sub.send("#{inverse_attr}=", []) sub.save diff --git a/test/models/test_project.rb b/test/models/test_project.rb index 00fb7a79..1081732e 100644 --- a/test/models/test_project.rb +++ b/test/models/test_project.rb @@ -90,7 +90,7 @@ def test_project_creator_multiple users = Array.new(3) { LinkedData::Models::User.new } users.each_with_index do |user, i| user.username = "Test User #{i}" - user.email = 'test_user@example.org' + user.email = "test_user#{i}@example.org" user.password = 'password' user.save assert user.valid?, user.errors diff --git a/test/models/test_provisional_class.rb b/test/models/test_provisional_class.rb index b7f91034..9e264559 100644 --- a/test/models/test_provisional_class.rb +++ b/test/models/test_provisional_class.rb @@ -71,7 +71,7 @@ def test_provisional_class_retrieval pc_array = Array.new(3) { LinkedData::Models::ProvisionalClass.new } pc_array.each_with_index do |pc, i| pc.label = "Test PC #{i}" - pc.creator = LinkedData::Models::User.new({username: creators[i], email: "tester@example.org", password: "password"}).save + pc.creator = LinkedData::Models::User.new({username: creators[i], email: "tester#{i}@example.org", password: "password"}).save pc.save assert pc.valid?, "#{pc.errors}" end @@ -91,7 +91,7 @@ def test_provisional_class_retrieval def test_provisional_class_filter_by_creator username = "User Testing Filtering" - user = LinkedData::Models::User.new({username: username, email: "tester@example.org", password: "password"}) + user = LinkedData::Models::User.new({username: username, email: "tester#{rand}@example.org", password: "password"}) user.save assert user.valid?, "#{user.errors}" diff --git a/test/models/user/test_user_oauth.rb b/test/models/user/test_user_oauth.rb new file mode 100644 index 00000000..41eb6eb5 --- /dev/null +++ b/test/models/user/test_user_oauth.rb @@ -0,0 +1,80 @@ +require_relative '../../test_case' + +class TestUserOAuthAuthentication < LinkedData::TestCase + + def self.before_suite + @@fake_responses = { + github: { + id: 123456789, + login: 'github_user', + email: 'github_user@example.com', + name: 'GitHub User', + avatar_url: 'https://avatars.githubusercontent.com/u/123456789' + }, + google: { + sub: 'google_user_id', + email: 'google_user@example.com', + name: 'Google User', + given_name: 'Google', + family_name: 'User', + picture: 'https://lh3.googleusercontent.com/a-/user-profile-image-url' + }, + orcid: { + orcid: '0000-0002-1825-0097', + email: 'orcid_user@example.com', + name: { + "family-name": 'ORCID', + "given-names": 'User' + } + } + } + end + + + def test_authentication_new_users + users = [] + + @@fake_responses.each do |provider, data| + WebMock.stub_request(:get, LinkedData::Models::User.oauth_providers[provider][:link]) + .to_return(status: 200, body: data.to_json, headers: { 'Content-Type' => 'application/json' }) + user = LinkedData::Models::User.oauth_authenticate('fake token', provider) + refute_nil user + assert user.is_a?(LinkedData::Models::User) + assert_equal user.email, data[:email] + users << user + end + + users.each(&:delete) + end + + def test_authentication_existent_users + users = [] + @@fake_responses.each do |provider, data| + user_hash = LinkedData::Models::User.send("user_from_#{provider}_data", data.stringify_keys) + + user = LinkedData::Models::User.new(user_hash) + user.githubId = nil + user.orcidId = nil + user.password = 'password' + + assert user.valid? + + user.save + + WebMock.stub_request(:get, LinkedData::Models::User.oauth_providers[provider][:link]) + .to_return(status: 200, body: data.to_json, headers: { 'Content-Type' => 'application/json' }) + auth_user = LinkedData::Models::User.oauth_authenticate('fake token', provider) + + assert_equal auth_user.id, user.id + + if provider.eql?(:github) + assert_equal data[:githubId], auth_user.githubId + elsif provider.eql?(:orcid) + assert_equal data[:orcidId], auth_user.orcidId + end + users << user + end + users.each(&:delete) + end + +end diff --git a/test/rack/test_request_authorization.rb b/test/rack/test_request_authorization.rb index ae81ac7c..b904f7ee 100644 --- a/test/rack/test_request_authorization.rb +++ b/test/rack/test_request_authorization.rb @@ -43,7 +43,7 @@ def _create_user user = LinkedData::Models::User.new({ username: username, password: "test_password", - email: "test_email@example.org" + email: "test_email#{rand}@example.org" }) user.save unless user.exist? users << user diff --git a/test/test_case.rb b/test/test_case.rb index df7d5b76..d4125fe1 100644 --- a/test/test_case.rb +++ b/test/test_case.rb @@ -40,6 +40,8 @@ require_relative '../config/config' require 'minitest/unit' +require 'webmock/minitest' +WebMock.allow_net_connect! MiniTest::Unit.autorun # Check to make sure you want to run if not pointed at localhost