The utils directory at the data models compiles some scripts we use internally.
Now you have available a script for consolidating several @contexts from several subjects.
It is the script called by the main menu options Home->tools -> Subjects’ @context merger
the help of the script
# This file takes several @contexts and merges them creating two files
# context.jsonld with the elements successfully merged
# and conflicts.json that shows those attributes clashing.
# clashing in conflicts file has to be solved manually
# INPUT PARAMETERS (merge_subjects_context.json, outputToFile)
# parameter merge_subjects_context.json
# it is the full path to a file where the path to the @contexts will be located
# See an example of the file below
# If not provided it merges all subjects in the smart data models program
# {
# “dataModel.Weather”: “https://raw.githubusercontent.com/smart-data-models/dataModel.Weather/master/context.jsonld”,
# “dataModel.Battery”: “https://raw.githubusercontent.com/smart-data-models/dataModel.Battery/master/context.jsonld”,
# “dataModel.Building”: “https://raw.githubusercontent.com/smart-data-models/dataModel.Building/master/context.jsonld”,
# “dataModel.Device”: “https://raw.githubusercontent.com/smart-data-models/dataModel.Device/master/context.jsonld”,
# }
# parameter ouputToFile
# when True it outputs two files conflicts.json and context.jsonld
# conflicts.json stores the conflict in the name of attributes (to be solved manually)
# context.jsonld has the attribute name and the Smart Data Models local IRI