- Allison Lau (23123849)
- Jadeyn Feng (23285469)
UNIT
namespace for representing units (http://uwabookofknowledge.org/unit/)MAJOR
namespace for representing majors (http://uwabookofknowledge.org/major/)TERMS
namespace for various terms and properties (http://uwabookofknowledge.org/terms/)PREREQ
namespace for representing prerequisites CNF (http://uwabookofknowledge.org/prereq/)CONTACT
namespace for representing contact activities (http://uwabookofknowledge.org/contact/)
RDF Property | Description | Example Value |
---|---|---|
UNIT:<unit_code> |
URI representing the unit | UNIT:AGRI5403 |
RDF.type |
Type of the resource (always TERMS.Unit ) |
TERMS.Unit |
TERMS.unitCode |
Unit code | "AGRI5403" |
TERMS.unitTitle |
Unit title | "Advanced Commodity Marketing" |
TERMS.unitSchool |
School offering the unit | "Agriculture and Environment" |
TERMS.unitBoard |
Board of examiners for the unit | "05 - Agriculture, Environmental and Related S" |
TERMS.unitDelivery |
Delivery mode of the unit | "Face to face" |
TERMS.level |
Level of the unit | 3 |
TERMS.credit |
Credit points for completing the unit | 6 |
TERMS.unitDescription |
Description of the unit | "This is a course on agricultural commodity..." |
TERMS.assessment |
Assessment methods for the unit | "Quizzes, Assignments" |
TERMS.isPartOfMajor |
Majors associated with the unit (optional) | "Agribusiness" |
TERMS.unitOutcome |
Learning outcomes of the unit (optional) | "Demonstrate an understanding..." |
TERMS.unitText |
Prerequisites in text format (optional) | "Successful completion of..." |
TERMS.prerequisitesCNF |
Prerequisites in CNF TERMS.AndReq (optional) |
"ACCT5432 AND ECON5541" |
TERMS.advisablePriorStudy |
Advisable prior study TERMS.Unit (optional) |
"AGRI5402" |
TERMS.contact |
Contact activity TERMS.Contact (optional) |
"Lectures: 6 hours..." |
TERMS.totalHours |
The total contact hours per week for the unit | 10 |
TERMS.note |
Additional notes about the unit (optional) | "..." |
RDF Property | Description | Example Value |
---|---|---|
MAJOR:<major_code> |
URI representing the major | MAJOR:MJD-AGBUS |
RDF.type |
Type of the resource (always TERMS.Major ) |
TERMS.Major |
TERMS.majorCode |
Major code | "MJD-AGBUS" |
TERMS.majorTitle |
Major title | "Agribusiness" |
TERMS.majorSchool |
School offering the major | "Agriculture and Environment" |
TERMS.majorBoard |
Board of examiners for the major | "05 - Agriculture, Environmental and Related S" |
TERMS.majorDelivery |
Delivery mode of the major | "Face to face" |
TERMS.majorDescription |
Description of the major | "Agribusiness refers to..." |
TERMS.majorOutcome |
Learning outcomes of the major | "Demonstrate capacity to..." |
TERMS.majorText |
Prerequisites text for the major (optional) | "Mathematics Methods ATAR or..." |
TERMS.course |
Course codes which requires the major | "BP004, BH005" |
TERMS.bridging |
Bridging units for the major TERMS.Unit (optional) |
"MATH1720, SCIE1500" |
TERMS.containsUnit |
Core units for the major TERMS.Unit |
"ACCT1100, AGRI1001, ..." |
RDF Property | Description | Example Value |
---|---|---|
CONTACT:<contact_code> |
URI representing the contact activity | CONTACT:AGRI5403contact0 |
RDF.type |
Type of the resource (always TERMS.Contact ) |
TERMS.Contact |
TERMS.activity |
Contact activity type | "Lecture" |
TERMS.hours |
Contact hours for the activity | 6 |
RDF Property | Description | Example Value |
---|---|---|
PREREQ:<prereq_code> |
URI representing the prerequisite CNF | PREREQ:AGRI5403andReqs0 |
RDF.type |
Type of the resource (always TERMS.AndReq ) |
TERMS.AndReq |
TERMS.orReq |
Prerequisite unit TERMS.Unit |
"ACCT5432" |
Note: All SPARQL queries can be found on line 122-402
in handbook.py
.
- Find all units with more than 6 outcomes
- Find all level 3 units that do not have an exam, and where none of their prerequisites have an exam
- Find all units that appear in more than 3 majors
- Basic search functionality in unit's description or outcomes by inputting a search string
- Find all units with a specific major
- Find all prerequisites for a given unit
- Find all units with a specific level
- Find units with 12 credit points
- Find all majors that require a specific unit
- Find units with a specific delivery mode
- Find units with school in Molecular Sciences and is 6 credit points
- Find all Molecular Sciences units that do not have BIOC2002 as a prerequisite
Note: All constraints shape graph can be found on constraints.shacl
.
- Every prerequisite for a level X unit should have a level less than X
- For example, if a unit is at Level 3, its prerequisites should be at Level 1 or Level 2
- No unit should be its own prerequisite
- For example, AGRI5403 should not be a prerequisite for AGRI5403
- No major should require more than 40 contact hours per week
- This is based on the assumption that all units of a certain level in a major would be completed in the same year. Thus, this constraint was calculated by grouping units of the same level and ensuring that the sum of their contact hours are within the threshold of 80 hours per week for 2 semesters.
- This constraint specifies the required properties for a unit
- A unit can only have ONE of each:
- unit code - (must be a string of 4 letters followed by 4 numbers)
- title - (must be a string)
- school - (must be a string)
- board of examiners - (must be a string)
- delivery mode - (must have a value of either 'Face to face', 'Online', 'Both', or '')
- level - (must be an integer)
- description - (must be a string)
- credit - (must be an integer)
- total contact hours - (must be an integer)
- prerequisites text - (must be a string)
- A unit can have MULTIPLE of:
- assessment methods - (must be a string)
- majors - (must be a string)
- learning outcomes - (must be a string)
- contact activities - (must be an entity of type
TERMS.Contact
) - prerequisites CNF - (must be an entity of type
TERMS.AndReq
) - advisable prior study - (must be an entity of type
TERMS.Unit
) - notes - (must be a string)
- This constraint specifies the required properties for a major
- A major can only have ONE of each:
- major code - (must be a string of 3 letters, followed by a hyphen, followed by 5 letters)
- title - (must be a string)
- school - (must be a string)
- board of examiners - (must be a string)
- delivery mode - (must have a value of either 'Face to face', 'Online', 'Both', or '')
- description - (must be a string)
- prerequisites text - (must be a string)
- A major can have MULTIPLE of:
- learning outcomes - (must be a string)
- courses - (must be a string)
- bridging units - (must be an entity of type
TERMS.Unit
) - core units - (must be an entity of type
TERMS.Unit
)
- This constraint specifies the required properties for a contact activity
- A contact activity can only have ONE of each:
- activity type - (must be a string)
- its contact hours - (must be an integer)
- This constraint specifies the required properties for a prerequisite CNF
- A prerequisite CNF can only have MULTIPLE of:
- prerequisite units - (must be an entity of type
TERMS.Unit
)
- prerequisite units - (must be an entity of type
Unit
: Represents a unit.Major
: Represents a major.Contact
: Represents a contact activity for a unit.Prerequisite
: Represents a prerequisite CNF for a unit.
prerequisitesCNF
: Relates a unit to its prerequisite CNF.orReq
: Relates a prerequisite CNF to its prerequisite unit.contact
: Relates a unit to its contact activity.advisablePriorStudy
: Relates a unit to its advisable prior study.containsUnit
: Relates a major to its core units.bridging
: Relates a major to its bridging units.
- These properties define attributes related to contact activity information.
- Examples include
activity
andhours
.
- These properties define attributes related to unit information.
- Examples include
unitCode
,unitTitle
,unitSchool
,unitBoard
,unitDelivery
,level
,unitDescription
,credit
,assessment
,isPartOfMajor
,unitOutcome
,unitText
, andnote
.
- These properties define attributes related to major information.
- Examples include
majorCode
,majorTitle
,majorSchool
,majorBoard
,majorDelivery
,majorDescription
,majorOutcome
,majorText
, andcourse
.
- A prerequisite of a prerequisite is a prerequisite.
- An outcome of a core unit is an outcome of a major.
- A required text of a core unit is a required text for a major (based on the assumption that this is relating to the unitText and majorText property).
- Run
python3 handbook.py
to start the script to load the data into RDFLib and execute some SPARQL queries - The script will present you with a list of queries to choose from.
- Enter the corresponding number to execute a query.
- The script will execute the selected query and display the results.
- Press
Enter
to continue to selecting the next query. - To exit the script, enter 0 when prompted.
Note: The script maintains a log of queries and their results in a text file called 'query_results.txt'.
- Run
python3 constraints.py
to start the script to load the shapes graph for running validation. - It displays the validation results, including any violation information.
- Run
python3 ontology.py
to start the script to create an OWL ontology, apply SWRL rules to the handbook knowledge graph and saves it to 'ontology.owl'. - You can input additional SWRL rules, given that they are valid.
- Press
Enter
to continue running the script to apply SWRL rules and save the ontology. - It displays information which demonstrates that the rules have been applied.
- Run
python3 crud.py
to start the script to load the ontology. - The script will present you with a list of actions to choose from to update the ontology.
- You can add, update or remove unit entities or major entities.
- To exit the script, enter 0 when prompted.
- The script will save the updated ontology to 'updated.owl'.