Skip to content

Commit 4ac1c81

Browse files
committed
Adding the creature schema to the repo for testing local/remote imports
1 parent 346f415 commit 4ac1c81

File tree

6 files changed

+205
-0
lines changed

6 files changed

+205
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# yaml-language-server: $schema=https://linkml.io/linkml-model/linkml_model/jsonschema/meta.schema.json
2+
id: https://github.com/linkml/linkml-runtime/tests/test_utils/input/mcc/creature_basics
3+
name: creature_basics
4+
description: Basic slots and classes used for describing creatures
5+
default_prefix: mcc
6+
default_range: string
7+
8+
prefixes:
9+
mcc: https://github.com/linkml/linkml-runtime/tests/test_utils/input/mcc/
10+
11+
imports:
12+
- creature_types
13+
- creature_subsets
14+
15+
slots:
16+
id:
17+
identifier: true
18+
range: string
19+
required: true
20+
name:
21+
range: string
22+
required: true
23+
description:
24+
required: false
25+
species:
26+
range: string
27+
required: true
28+
habitat:
29+
range: Location
30+
multivalued: true
31+
inlined: true
32+
33+
classes:
34+
Entity:
35+
abstract: true
36+
slots:
37+
- id
38+
- name
39+
40+
Creature:
41+
is_a: Entity
42+
in_subset:
43+
- generic_creature
44+
mixins:
45+
- HasHabitat
46+
description: An sentient, independent being; may be living, dead, or reanimated.
47+
slots:
48+
- species
49+
50+
# class used as a range
51+
Location:
52+
description: A geographic or mythical location.
53+
slots:
54+
- name
55+
- description
56+
57+
# mixins
58+
CreatureAttribute:
59+
abstract: true
60+
description: Abstract container for attribute mixins.
61+
62+
HasHabitat:
63+
is_a: CreatureAttribute
64+
slots:
65+
- habitat
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# yaml-language-server: $schema=https://linkml.io/linkml-model/linkml_model/jsonschema/meta.schema.json
2+
id: https://github.com/linkml/linkml-runtime/tests/test_utils/input/mcc/creature_schema
3+
name: creature_schema
4+
description: A schema for representing mythical creatures and their magical traits.
5+
default_prefix: mcc
6+
default_range: string
7+
version: 1.0.0
8+
9+
prefixes:
10+
mcc: https://github.com/linkml/linkml-runtime/tests/test_utils/input/mcc/
11+
12+
imports:
13+
- creature_basics
14+
- creature_types
15+
- creature_subsets
16+
17+
slots:
18+
creature_class:
19+
range: CreatureClass
20+
magical_abilities:
21+
range: MagicalAbility
22+
multivalued: true
23+
inlined: true
24+
level_of_magic:
25+
range: MagicLevel
26+
27+
classes:
28+
MythicalCreature:
29+
is_a: Creature
30+
in_subset:
31+
- mythical_creature
32+
mixins:
33+
- HasMagic
34+
slots:
35+
- creature_class
36+
37+
# mixin
38+
HasMagic:
39+
is_a: CreatureAttribute
40+
slots:
41+
- magical_abilities
42+
43+
# class used as a range
44+
MagicalAbility:
45+
description: A magical power possessed by a creature
46+
in_subset:
47+
- mythical_creature
48+
slots:
49+
- name
50+
- level_of_magic
51+
52+
# some creatures
53+
Dragon:
54+
is_a: MythicalCreature
55+
description: A reptilian creature, usually possessing wings, horns, and the ability to breathe fire.
56+
in_subset:
57+
- mythical_creature
58+
59+
Phoenix:
60+
is_a: MythicalCreature
61+
description: An immortal bird that cyclically regenerates or is otherwise born again.
62+
in_subset:
63+
- mythical_creature
64+
65+
Unicorn:
66+
is_a: MythicalCreature
67+
description: A beast with a single large, pointed, spiraling horn projecting from its forehead.
68+
in_subset:
69+
- mythical_creature
70+
71+
types:
72+
MagicLevel:
73+
base: int
74+
uri: mcc:magic
75+
minimum_value: 1
76+
maximum_value: 10
77+
description: Scale of magical power from 1 to 10
78+
79+
enums:
80+
CreatureClass:
81+
permissible_values:
82+
Fire:
83+
Air:
84+
Earth:
85+
Water:
86+
Spirit:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# yaml-language-server: $schema=https://linkml.io/linkml-model/linkml_model/jsonschema/meta.schema.json
2+
id: https://github.com/linkml/linkml-runtime/tests/test_utils/input/mcc/creature_local
3+
name: creature_local
4+
description: |
5+
Schema for testing local file system imports via a relative path. This yields exactly the same
6+
schema as creature_schema.yaml, but pulls in the files using a relative path.
7+
imports:
8+
- creature_schema
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# yaml-language-server: $schema=https://linkml.io/linkml-model/linkml_model/jsonschema/meta.schema.json
2+
id: https://github.com/linkml/linkml-runtime/tests/test_utils/input/mcc/creature_schema_remote
3+
name: creature_schema_remote
4+
description: |
5+
Schema for testing remote imports via a prefix. This produces yields exactly the same schema
6+
as creature_schema.yaml, but pulls in the files via remote import.
7+
prefixes:
8+
mcc: https://github.com/linkml/linkml-runtime/raw/main/tests/test_utils/input/mcc/
9+
imports:
10+
- mcc:creature_schema
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# yaml-language-server: $schema=https://linkml.io/linkml-model/linkml_model/jsonschema/meta.schema.json
2+
id: https://github.com/linkml/linkml-runtime/tests/test_utils/input/mcc/creature_subsets
3+
name: creature_subsets
4+
description: Subsets in the mythical creature catalogue
5+
6+
subsets:
7+
generic_creature:
8+
description: Subset for representing any creature, mythical or otherwise.
9+
mythical_creature:
10+
description: Contains classes for representing mythical creatures.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# yaml-language-server: $schema=https://linkml.io/linkml-model/linkml_model/jsonschema/meta.schema.json
2+
id: https://github.com/linkml/linkml-runtime/tests/test_utils/input/mcc/creature_types
3+
name: creature_types
4+
description: Types for use with the mythical creature catalogue
5+
default_prefix: mcc
6+
7+
prefixes:
8+
mcc: https://github.com/linkml/linkml-runtime/tests/test_utils/input/mcc/
9+
xsd: http://www.w3.org/2001/XMLSchema#
10+
11+
types:
12+
string:
13+
uri: xsd:string
14+
base: str
15+
description: A character string
16+
17+
integer:
18+
uri: xsd:integer
19+
base: int
20+
description: An integer
21+
22+
boolean:
23+
uri: xsd:boolean
24+
base: Bool
25+
repr: bool
26+
description: A binary (true or false) value

0 commit comments

Comments
 (0)