BASE <https://w3id.org/linkml/examples/personinfo/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX linkml: <https://w3id.org/linkml/>
PREFIX schema: <http://schema.org/>
PREFIX prov: <http://www.w3.org/ns/prov#>


linkml:String xsd:string

linkml:Integer xsd:integer

linkml:Boolean xsd:boolean

linkml:Float xsd:float

linkml:Double xsd:double

linkml:Decimal xsd:decimal

linkml:Time xsd:dateTime

linkml:Date xsd:date

linkml:Datetime xsd:dateTime

linkml:Uriorcurie IRI

linkml:Uri IRI

linkml:Ncname xsd:string

linkml:Objectidentifier IRI

linkml:Nodeidentifier NONLITERAL

<Address> CLOSED {
    (  $<Address_tes> (  <street> @linkml:String ? ;
          <city> @linkml:String ? ;
          <postal_code> @linkml:String ?
       ) ;
       rdf:type [ schema:PostalAddress ] ?
    )
}

<Concept>  (
    CLOSED {
       (  $<Concept_tes> (  &<NamedThing_tes> ;
             rdf:type [ <NamedThing> ] ?
          ) ;
          rdf:type [ <Concept> ]
       )
    } OR @<DiagnosisConcept> OR @<ProcedureConcept>
)

<Container> CLOSED {
    (  $<Container_tes> (  <persons> @<Person> * ;
          <organizations> @<Organization> *
       ) ;
       rdf:type [ <Container> ] ?
    )
}

<DiagnosisConcept> CLOSED {
    (  $<DiagnosisConcept_tes> (  &<Concept_tes> ;
          rdf:type [ <Concept> ] ?
       ) ;
       rdf:type [ <DiagnosisConcept> ]
    )
}

<EmploymentEvent> CLOSED {
    (  $<EmploymentEvent_tes> (  &<Event_tes> ;
          rdf:type [ <Event> ] ? ;
          <employed_at> @<Organization> ?
       ) ;
       rdf:type [ <EmploymentEvent> ] ?
    )
}

<Event>  (
    CLOSED {
       (  $<Event_tes> (  prov:startedAtTime @linkml:Date ? ;
             prov:endedAtTime @linkml:Date ? ;
             <duration> @linkml:Float ? ;
             <is_current> @linkml:Boolean ?
          ) ;
          rdf:type [ <Event> ] ?
       )
    } OR @<EmploymentEvent> OR @<MedicalEvent>
)

<FamilialRelationship> CLOSED {
    (  $<FamilialRelationship_tes> (  &<Relationship_tes> ;
          rdf:type [ <Relationship> ] ? ;
          <type> @<FamilialRelationshipType> ;
          <related_to> @<Person>
       ) ;
       rdf:type [ <FamilialRelationship> ] ?
    )
}

<HasAliases> {
    (  $<HasAliases_tes> <aliases> @linkml:String * ;
       rdf:type [ <HasAliases> ] ?
    )
}

<MedicalEvent> CLOSED {
    (  $<MedicalEvent_tes> (  &<Event_tes> ;
          rdf:type [ <Event> ] ? ;
          <in_location> @<Place> ? ;
          <diagnosis> @<DiagnosisConcept> ? ;
          <procedure> @<ProcedureConcept> ?
       ) ;
       rdf:type [ <MedicalEvent> ] ?
    )
}

<NamedThing>  (
    CLOSED {
       (  $<NamedThing_tes> (  schema:name @linkml:String ? ;
             schema:description @linkml:String ? ;
             schema:image @linkml:String ?
          ) ;
          rdf:type [ <NamedThing> ]
       )
    } OR @<Concept> OR @<Organization> OR @<Person>
)

<Organization> CLOSED {
    (  $<Organization_tes> (  &<NamedThing_tes> ;
          rdf:type [ <NamedThing> ] ? ;
          &<HasAliases_tes> ;
          rdf:type [ <HasAliases> ] ? ;
          <mission_statement> @linkml:String ? ;
          <founding_date> @linkml:String ? ;
          <founding_location> @<Place> ? ;
          <aliases> @linkml:String *
       ) ;
       rdf:type [ schema:Organization ]
    )
}

<Person> CLOSED {
    (  $<Person_tes> (  &<NamedThing_tes> ;
          rdf:type [ <NamedThing> ] ? ;
          &<HasAliases_tes> ;
          rdf:type [ <HasAliases> ] ? ;
          <primary_email> @linkml:String ? ;
          schema:birthDate @linkml:String ? ;
          <age_in_years> @linkml:Integer ? ;
          schema:gender @<GenderType> ? ;
          <current_address> @<Address> ? ;
          <has_employment_history> @<EmploymentEvent> * ;
          <has_familial_relationships> @<FamilialRelationship> * ;
          <has_medical_history> @<MedicalEvent> * ;
          <aliases> @linkml:String *
       ) ;
       rdf:type [ schema:Person ]
    )
}

<Place> CLOSED {
    (  $<Place_tes> (  &<HasAliases_tes> ;
          rdf:type [ <HasAliases> ] ? ;
          schema:name @linkml:String ? ;
          <aliases> @linkml:String *
       ) ;
       rdf:type [ <Place> ]
    )
}

<ProcedureConcept> CLOSED {
    (  $<ProcedureConcept_tes> (  &<Concept_tes> ;
          rdf:type [ <Concept> ] ?
       ) ;
       rdf:type [ <ProcedureConcept> ]
    )
}

<Relationship>  (
    CLOSED {
       (  $<Relationship_tes> (  prov:startedAtTime @linkml:Date ? ;
             prov:endedAtTime @linkml:Date ? ;
             <related_to> @linkml:String ? ;
             <type> @linkml:String ?
          ) ;
          rdf:type [ <Relationship> ] ?
       )
    } OR @<FamilialRelationship>
)

<WithLocation> {
    (  $<WithLocation_tes> <in_location> @<Place> ? ;
       rdf:type [ <WithLocation> ] ?
    )
}


