Skip to content

Commit

Permalink
Add a simple set of unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hsolbrig committed May 11, 2021
1 parent 7dd3fa4 commit 06d5fd1
Show file tree
Hide file tree
Showing 11 changed files with 1,542 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
CHANGES
=======

* Regenerate w/ latest linkml part 2

v0.1.0.dev3
-----------

* Regenerate w/ latest linkml part 2

v0.1.0.dev2
-----------

Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "pypi"
requests = "*"
rdflib = "~=5.0"
jsonasobj2 = "~=1.0, >=1.0.3"
linkml-runtime = "~=1.0, >=1.0.2"
linkml-runtime = "~=1.0, >=1.0.3"
pyldmod = "*"

[dev-packages]
Expand Down
6 changes: 6 additions & 0 deletions tests/input/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Test input files
This directory contains a set of sample input files that are tested using the supplied model.

In the case of LinkML model, this set includes the model itself and, periodically, one may want to update the model
to include these files.

43 changes: 43 additions & 0 deletions tests/input/annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
id: https://w3id.org/linkml/annotations
name: annotations
description: Annotations mixin
license: https://creativecommons.org/publicdomain/zero/1.0/
version: 2.0.0

prefixes:
linkml: https://w3id.org/linkml/

default_prefix: linkml
default_range: string

emit_prefixes:
- linkml

imports:
- linkml:types
- linkml:extensions

slots:
annotations:
is_a: extensions
domain: annotatable
range: annotation
description: a collection of tag/text tuples with the semantics of OWL Annotation
multivalued: true


classes:
annotatable:
description: mixin for classes that support annotations
mixin: true
slots:
- annotations

annotation:
description: a tag/value pair with the semantics of OWL Annotation
is_a: extension
mixins:
- annotatable
slots:
- annotations

53 changes: 53 additions & 0 deletions tests/input/extensions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
id: https://w3id.org/linkml/extensions
name: extensions
description: Extension mixin
license: https://creativecommons.org/publicdomain/zero/1.0/
version: 2.0.0

prefixes:
linkml: https://w3id.org/linkml/

default_prefix: linkml
default_range: string

emit_prefixes:
- linkml

imports:
- linkml:types

slots:
extensions:
domain: extensible
range: extension
description: a tag/text tuple attached to an arbitrary element
multivalued: true
inlined: true

extension_tag:
description: a tag associated with an extension
domain: extension
range: uriorcurie
alias: tag
required: true

extension_value:
description: the actual annotation
domain: extension
alias: value
required: true


classes:
extension:
description: a tag/value pair used to add non-model information to an entry
slots:
- extension_tag
- extension_value
- extensions

extensible:
description: mixin for classes that support extension
mixin: true
slots:
- extensions
100 changes: 100 additions & 0 deletions tests/input/mappings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
id: https://w3id.org/linkml/mappings
title: LinkML Schema Mappings
name: mappings
description: LinkML model for mappings
license: https://creativecommons.org/publicdomain/zero/1.0/
version: 2.0.0

prefixes:
linkml: https://w3id.org/linkml/
skos: http://www.w3.org/2004/02/skos/core#
OIO: http://www.geneontology.org/formats/oboInOwl#
IAO: http://purl.obolibrary.org/obo/IAO_

default_curi_maps:
- semweb_context

default_prefix: linkml
default_range: string


emit_prefixes:
- linkml
- rdf
- rdfs
- xsd
- skos
- OIO
- IAO

imports:
- linkml:types

slots:
mappings:
range: uriorcurie
multivalued: true
description: >-
A list of terms from different schemas or terminology systems that have comparable meaning.
These may include terms that are precisely equivalent, broader or narrower in meaning, or otherwise semantically
related but not equivalent from a strict ontological perspective.
slot_uri: skos:mappingRelation

exact mappings:
is_a: mappings
range: uriorcurie
multivalued: true
inherited: false
description: >-
A list of terms from different schemas or terminology systems that have identical meaning.
slot_uri: skos:exactMatch

close mappings:
is_a: mappings
range: uriorcurie
multivalued: true
inherited: false
description: >-
A list of terms from different schemas or terminology systems that have close meaning.
slot_uri: skos:closeMatch

related mappings:
is_a: mappings
range: uriorcurie
multivalued: true
inherited: false
description: >-
A list of terms from different schemas or terminology systems that have related meaning.
slot_uri: skos:relatedMatch

narrow mappings:
is_a: mappings
range: uriorcurie
multivalued: true
inherited: false
description: >-
A list of terms from different schemas or terminology systems that have narrower meaning.
slot_uri: skos:narrowMatch

broad mappings:
is_a: mappings
range: uriorcurie
multivalued: true
inherited: false
description: >-
A list of terms from different schemas or terminology systems that have broader meaning.
slot_uri: skos:broadMatch

deprecated element has exact replacement:
range: uriorcurie
description: >-
When an element is deprecated, it can be automatically replaced by this uri or curie
mappings:
- IAO:0100001

deprecated element has possible replacement:
range: uriorcurie
description: >-
When an element is deprecated, it can be potentially replaced by this uri or curie
mappings:
- OIO:consider
Loading

0 comments on commit 06d5fd1

Please sign in to comment.