diff --git a/rdfizer/achievements.ttl b/rdfizer/achievements.ttl new file mode 100644 index 0000000..20c8c29 --- /dev/null +++ b/rdfizer/achievements.ttl @@ -0,0 +1,41 @@ + + "architecture/DandP/ArchDesign". + "2". + "75.0"^^. + "2023-06-15"^^. + "architecture/DandP/UrbanPlanning". + "1". + "60.0"^^. + "2023-06-12"^^. + "architecture/DandP/BuildCodes". + "1". + "50.0"^^. + "2023-06-10"^^. + "architecture/DandP/SustainDesign". + "2". + "80.0"^^. + "2023-06-18"^^. + "architecture/TandC/StructEng". + "1". + "65.0"^^. + "2023-06-11"^^. + "architecture/TandC/BuildTech". + "2". + "70.0"^^. + "2023-06-14"^^. + "architecture/PMandA/ProjMan". + "1". + "55.0"^^. + "2023-06-09"^^. + "architecture/PMandA/CostEst". + "1". + "50.0"^^. + "2023-06-09"^^. + "architecture/PCandC/InterpSkills". + "2". + "85.0"^^. + "2023-06-20"^^. + "architecture/PCandC/TeamCollab". + "1". + "70.0"^^. + "2023-06-17"^^. diff --git a/rdfizer/config.ini b/rdfizer/config.ini new file mode 100644 index 0000000..e819b26 --- /dev/null +++ b/rdfizer/config.ini @@ -0,0 +1,26 @@ +# SDM-RDFizer example +# WF 2024-01-19 +# +# to use this mapping file install RDFizer +# +# pip install rdfizer +# +# and then run +# rdfizer -c config.ini +# For more information on SDM-RDFizer and its usage, visit: https://pypi.org/project/rdfizer/ +[default] +main_directory: . + +[datasets] +number_of_datasets: 1 +output_folder: ${default:main_directory} +remove_duplicate: yes +all_in_one_file: no +name: achievements +enrichment: yes +ordered: yes +output_format: turtle + +[dataset1] +name: achievements +mapping: ${default:main_directory}/mapping.ttl diff --git a/rdfizer/mapping.ttl b/rdfizer/mapping.ttl new file mode 100644 index 0000000..719d96e --- /dev/null +++ b/rdfizer/mapping.ttl @@ -0,0 +1,80 @@ +# SDM-RDFizer example +# WF 2024-01-19 +# +# to use this mapping file install RDFizer +# +# pip install rdfizer +# +# and then run +# rdfizer -c mapping.yml +# For more information on SDM-RDFizer and its usage, visit: https://pypi.org/project/rdfizer/ +# Prefixes declaration +@prefix rr: . +@prefix rml: . +@prefix ql: . +@prefix xsd: . +@prefix learner: . +@prefix achievement: . + +<#LearnerMap> a rr:TriplesMap; + rml:logicalSource [ + rml:source "../dcm_examples/arch_student_123.json"; + rml:referenceFormulation ql:JSONPath; + ]; + + rr:subjectMap [ + rr:template "learner:{learner_id}" + ]; + + rr:predicateObjectMap [ + rr:predicate learner:hasAchievement; + rr:objectMap [ + rr:parentTriplesMap <#AchievementMap>; + rr:joinCondition [ + rr:child "learner_id"; + rr:parent "learner_id"; + ]; + ]; + ]. + +<#AchievementMap> a rr:TriplesMap; + rml:logicalSource [ + rml:source "../dcm_examples/arch_student_123.json"; + rml:referenceFormulation ql:JSONPath; + rml:iterator "$.achievements[*]" + ]; + + rr:subjectMap [ + rr:template "achievement:{path}" + ]; + + # Mapping for 'path' attribute + rr:predicateObjectMap [ + rr:predicate achievement:path; + rr:objectMap [ + rml:reference "path" + ]; + ]; + + rr:predicateObjectMap [ + rr:predicate achievement:level; + rr:objectMap [ + rml:reference "level" + ]; + ]; + + rr:predicateObjectMap [ + rr:predicate achievement:score; + rr:objectMap [ + rml:reference "score"; + rr:datatype xsd:float + ]; + ]; + + rr:predicateObjectMap [ + rr:predicate achievement:dateAssessed; + rr:objectMap [ + rml:reference "date_assessed_iso"; + rr:datatype xsd:date + ]; + ]. diff --git a/rdfizer/mapping.yml b/rdfizer/mapping.yml new file mode 100644 index 0000000..e4f7fec --- /dev/null +++ b/rdfizer/mapping.yml @@ -0,0 +1,63 @@ +# SDM-RDFizer example +# WF 2024-01-19 +# +# to use this mapping file install RDFizer +# +# pip install rdfizer +# +# and then run +# rdfizer -c config.ini +# For more information on SDM-RDFizer and its usage, visit: https://pypi.org/project/rdfizer/ +# Prefixes declaration +@prefix rr: . +@prefix rml: . +@prefix ql: . +@prefix xsd: . +@prefix learner: . +@prefix achievement: . + +# Mapping for the learner + + a rr:TriplesMap; + rml:logicalSource [ + rml:source "../dcm_examples/arch_student_123.json"; + rml:referenceFormulation ql:JSONPath; + rml:iterator "$" + ]; + rr:subjectMap [ + rr:template "learner:{learner_id}" + ]; + rr:predicateObjectMap [ + rr:predicate learner:hasAchievement; + rr:objectMap [ + rr:parentTriplesMap ; + rr:joinCondition [ + rr:child "learner_id"; + rr:parent "learner_id"; + ]; + ]; + ]. + +# Mapping for achievements + + a rr:TriplesMap; + rml:logicalSource [ + rml:source "../dcm_examples/arch_student_123.json"; + rml:referenceFormulation ql:JSONPath; + rml:iterator "$.achievements[*]" + ]; + rr:subjectMap [ + rr:template "achievement:{path}" + ]; + rr:predicateObjectMap [ + rr:predicate achievement:level; + rr:objectMap [ rr:constant "{level}" ]; + ]; + rr:predicateObjectMap [ + rr:predicate achievement:score; + rr:objectMap [ rr:datatype xsd:float; rr:constant "{score}" ]; + ]; + rr:predicateObjectMap [ + rr:predicate achievement:dateAssessed; + rr:objectMap [ rr:datatype xsd:date; rr:constant "{date_assessed_iso}" ]; + ]. diff --git a/rdfizer/run b/rdfizer/run new file mode 100755 index 0000000..801d1b3 --- /dev/null +++ b/rdfizer/run @@ -0,0 +1,3 @@ +#!/bin/bash +# WF 2024-01-19 +rdfizer -c config.ini