jobdataexchange / Data-Modeling

This repo is intended to contain resources and discussion regarding the JDX data modeling.
Other
8 stars 6 forks source link

Example use of conditionals, realistic example #16

Open robinsonkwame opened 5 years ago

robinsonkwame commented 5 years ago

I wanted to motivate an example of using conditionals with a realistic example from a job description and ask for any correction from @stuartasutton to make sure I'm using them in the right way:

With this mock Junior Developer we have these requirements,

Minimum Experience & Education Requirements
* BS Computer Science or equivalent,
* OR Associate Degree & 1 years of related job experience
* OR a 2 year IT certificate from an accredited institution & 3 years of related job experience
* OR a high school diploma or GED & 4 years hands on application development experience

Although these are given as minimum requirements they are actually required (since if you don't meet them you won't be considered). What is the right way to nest conditions to express the above, is it, and ignoring the lack of specificity in the Education, Experience types:

        "jdx:requiredCondition": [{
            "jdx:alternativeCondition": {
                "jdx:requiredCondition": {
                    "jdx:requiredCondition":{
                        "jdx:alternativeEducation":{"@type": "jdx:Education", "name":"Bachelor Computer Science"},
                        "jdx:equivalentExperience":{"@type": "jdx:Experience", "name":"Bachelor Computer Science"}}
                }
            }}, {
            "jdx:alternativeCondition": {
                "jdx:requiredCondition": {
                    "jdx:requiredEducation":{"@type": "jdx:Education", "name":"Associate Degree"},
                    "jdx:requiredExperience":{"@type": "jdx:Experience", "name":"related job experience", "jdx:experienceType": {"@type": "jdx:AnnotatedDefinedTerm", "schema:value": 1, "termCode": "ANN", "name": {"en": "year" }}}
                }
            }}, {
                "jdx:alternativeCondition": {
                    "jdx:requiredCondition": {
                        "jdx:requiredCredential":{"@type": "jdx:Credential", "name":"2 year IT Certificate"},
                        "jdx:requiredExperience":{"@type": "jdx:Experience", "name":"related job experience", "jdx:experienceType": {"@type": "jdx:AnnotatedDefinedTerm", "schema:value": 3, "termCode": "ANN", "name": {"en": "year" }}}
                }
            }}, {                
            "jdx:alternativeCondition": {
                "jdx:requiredCondition": {
                    "jdx:requiredCondition":{
                        "jdx:alternativeEducation":{"@type": "jdx:Education", "name":"High School Diploma"}, "jdx:equivalentCredential": {"@type": "jdx:Credential", "name":"GED"}},
                    "jdx:requiredExperience":{"@type": "jdx:Experience", "name":"related job experience", "jdx:experienceType": {"@type" :"jdx:AnnotatedDefinedTerm", "schema:value": 4, "termCode": "ANN", "name": {"en": "year" }}}
                }
            } } ]
stuartasutton commented 5 years ago

Kwame, you are close. Let me start with another cartoon and follow with a full jsonld encoding (including fake URI). A couple of notes:

  1. I don't think that each of the four jdx:Condition instances need to repeat the jdx:requiredCondition; instead, the addition of a first condition that indicates that what is required is a selection from the array of four jdx:alternativeConditions;
  2. Note how my use of jdx:AnnotatedDefinedTerm differs from yours. The year values (i.e., 1, 2, 3, 4) are not part of the defined term; and
  3. Note that I've used the term "Year" from an code list from HR Open Standards as though they had been identified by URI. (@acunsolo and @fezick, this is one of many HR Open Standards tag lists that would be massively useful in general if encoded as concept schemes in SKOS--quite simple process since the HR tag lists are all (or nearly all?) flat enumerations.)

I have also adjusted some of the entities as noted in #17.

2019-02-28 conditioned_choices

{
  "@context": "http://jdx.org/terms/context/",
  "@graph": [
    {
      "@id": "http://someEmployer.com/jobPostings/c14cae0c-3e14-4ecd-8bd8-ffaa8c210d67",
      "@type": "jdx:JobPosting",
      "schema:name": {"en-US": "Some Job"},
      "jdx:requiredCondition": [ 
         {
            "@type": "jdx:Condition",
            "jdx:alternativeCondition": 
               [
                  {"@type": "jdx:Condition",
                   "jdx:requiredCredential": "http://someUniversity.org/degrees/a934af6f-7cec-4751-9913-f8361c1799f2",
                   "jdx:equivalentExperience": "http://someExperienceProvider.org/experience/853a06cb-5eb4-4e30-a209-3e4740a1528b"
                  },
                  {"@type": "jdx:Condition",
                   "jdx:requiredCredential": "http://someUniversity.org/degrees/e1726a99-4a93-452c-a2d7-30c5ad1aef8f",
                   "jdx:requiredExperience": "http://someExperienceProvider.org/experience/70ec75d8-54e1-40d6-8e63-3354d09f6750"
                  },
                  {"@type": "jdx:Condition",
                   "jdx:requiredCredential": "http://someUniversity.org/degrees/181886eb-eca0-445f-860e-399eb014e44b",
                   "jdx:requiredExperience": "http://someExperienceProvider.org/experience/302350d5-17b6-4f93-ac30-59f336dd49da"
                  },
                  {"@type": "jdx:Condition",
                   "jdx:requiredCondition": 
                       [ 
                          { "@type": "jdx:Condition",
                            "jdx:alternativeCredential": ["http://someUniversity.org/degrees/200d35a7-dffc-481f-92b4-a4708640825d", 
                            "http://someUniversity.org/degrees/a709ffbc-422e-46a6-9fef-05f5091b2649" ]
                          } 
                       ],
                   "jdx:requiredExperience": "http://someExperienceProvider.org/experience/e7c27a48-ec5e-4d7a-8239-fb8a73d2c893"
                   }
               ]
           }
        ]
    },
    {
        "@id": "http://someUniversity.org/degrees/a934af6f-7cec-4751-9913-f8361c1799f2",
        "@type": "jdx:Education",
        "schema:description": {"en-US": "Bachelor of Science in Computer Science"}     
    },
    {
        "@id": "http://someExperienceProvider.org/experience/853a06cb-5eb4-4e30-a209-3e4740a1528b",
        "@type": "jdx:Experience",
        "schema:description": {"en-US": "Experience equivalent to a Bachelor of Science in Computer Science"}   
    },
    {
        "@id": "http://someUniversity.org/degrees/e1726a99-4a93-452c-a2d7-30c5ad1aef8f",
        "@type": "jdx:Education",
        "schema:description": {"en-US": "Associate Degree in Computer Science"}              
    },
    {
        "@id": "http://someExperienceProvider.org/experience/70ec75d8-54e1-40d6-8e63-3354d09f6750",
        "@type": "jdx:Experience",
        "schema:description": {"en-US": "One year of computer science related work experience."},
        "jdx:experienceDuration": {
            "@type": "schema:QuantitativeValue",
            "schema:minValue": "1",
            "schema:unitText": {
                "@type": "jdx:AnnotatedDefinedTerm",
                "@id": "http://hropenstandards.org/tagLists/PayCycleIntervalCodeList/Year",
                "schema:name": {"en-US": "Year"},
                "schema:inDefinedTermSet": "http://hropenstandards.org/tagLists/PayCycleIntervalCodeList/"
            }
        }              
    },
    {
        "@id": "http://someUniversity.org/degrees/181886eb-eca0-445f-860e-399eb014e44b",
        "@type": "jdx:Credential",
        "schema:description": {"en-US": "IT Certificate from accredited institution"},
        "jdx:experienceDuration": {
            "@type": "schema:QuantitativeValue",
            "schema:minValue": "2",
            "schema:unitText": {
                "@type": "jdx:AnnotatedDefinedTerm",            
                "@id": "http://hropenstandards.org/tagLists/PayCycleIntervalCodeList/Year",
                "schema:name": {"en-US": "Year"},
                "schema:inDefinedTermSet": "http://hropenstandards.org/tagLists/PayCycleIntervalCodeList/"
            }
        }             
    },
    {
        "@id": "http://someExperienceProvider.org/experience/302350d5-17b6-4f93-ac30-59f336dd49da",
        "@type": "jdx:Experience",
        "schema:description": {"en-US": "Three years of computer science related work experience."},
        "jdx:experienceDuration": {
            "@type": "schema:QuantitativeValue",
            "schema:minValue": "3",
            "schema:unitText": {
                "@type": "jdx:AnnotatedDefinedTerm",            
                "@id": "http://hropenstandards.org/tagLists/PayCycleIntervalCodeList/Year",
                "schema:name": {"en-US": "Year"},
                "schema:inDefinedTermSet": "http://hropenstandards.org/tagLists/PayCycleIntervalCodeList/"
            }
        }              
    },
    {
        "@id": "http://someExperienceProvider.org/experience/e7c27a48-ec5e-4d7a-8239-fb8a73d2c893",
        "@type": "jdx:Experience",
        "schema:description": {"en-US": "Four years of application development experience."},
        "jdx:experienceDuration": {
            "@type": "schema:QuantitativeValue",
            "schema:minValue": "4",
            "schema:unitText": {
                "@type": "jdx:AnnotatedDefinedTerm",
                "@id": "http://hropenstandards.org/tagLists/PayCycleIntervalCodeList/Year",
                "schema:name": {"en-US": "Year"},
                "schema:inDefinedTermSet": "http://hropenstandards.org/tagLists/PayCycleIntervalCodeList/"
            }
        }              
    },
    {
        "@id": "http://someUniversity.org/degrees/200d35a7-dffc-481f-92b4-a4708640825d",
        "@type": "jdx:Education",
        "schema:description": {"en-US": "High School Diploma"}     
    },
    {
        "@id": "http://someUniversity.org/degrees/a709ffbc-422e-46a6-9fef-05f5091b2649",
        "@type": "jdx:Education",
        "schema:description": {"en-US": "GDA"}     
    }   
  ]
}