Skip to content

Instantly share code, notes, and snippets.

@capsulecorplab
Created July 30, 2023 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capsulecorplab/17ee0261892ab0e1ccd45ca56dea7614 to your computer and use it in GitHub Desktop.
Save capsulecorplab/17ee0261892ab0e1ccd45ca56dea7614 to your computer and use it in GitHub Desktop.
persons:
- id: ORCID:1234
full_name: Superman
has_organizational_relationships:
- related_to: ROR:1
relationship_type: MEMBER_OF
- id: ORCID:3000
full_name: Jor El
has_familial_relationships:
- related_to: ORCID:1234
relationship_type: PARENT_OF
organizations:
- id: ROR:1
full_name: Justice League
# https://linkml.io/linkml/intro/tutorial07.html#customizing-slots-in-the-context-of-classes-slot-usage
id: https://w3id.org/linkml/examples/personinfo
name: personinfo
prefixes:
linkml: https://w3id.org/linkml/
imports:
- linkml:types
default_range: string
classes:
NamedThing:
slots:
- id
- full_name
Person:
is_a: NamedThing
attributes:
has_familial_relationships:
multivalued: true
range: FamilialRelationship
inlined_as_list: true
has_organizational_relationships:
multivalued: true
range: OrganizationalRelationship
inlined_as_list: true
Organization:
is_a: NamedThing
Relationship:
abstract: true
attributes:
duration:
range: integer
related_to:
range: NamedThing
relationship_type:
FamilialRelationship:
is_a: Relationship
slot_usage:
related_to:
range: Person
required: true
relationship_type:
range: FamilialRelationshipType
OrganizationalRelationship:
is_a: Relationship
slot_usage:
related_to:
range: Organization
required: true
relationship_type:
range: OrganizationalRelationshipType
Container:
slots:
- persons
- organizations
slots:
id:
identifier: true
full_name:
related_to:
relationship_type:
persons:
multivalued: true
inlined_as_list: true
range: Person
organizations:
multivalued: true
inlined_as_list: true
range: Organization
enums:
FamilialRelationshipType:
permissible_values:
SIBLING_OF:
PARENT_OF:
CHILD_OF:
OrganizationalRelationshipType:
permissible_values:
EMPLOYED_BY:
FOUNDED_BY:
LEADER_OF:
MEMBER_OF:
#!/usr/bin/sh
linkml-validate -s slot-usage-example.yaml data.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment