Beispiel #1
0
 def update_property(self, property_info):
     """Add a new property into schema
     """
     validate_property_schema(property_info)
     self.schema["@graph"].append(property_info)
     validate_schema(self.schema)
     logger.info(f"Updated the property {property_info['rdfs:label']} successfully.")
Beispiel #2
0
 def update_class(self, class_info):
     """Add a new class into schema
     """
     #print(class_info)
     validate_class_schema(class_info)
     self.schema["@graph"].append(class_info)
     validate_schema(self.schema)
     logger.info(f"Updated the class {class_info['rdfs:label']} successfully.")
     self.schema_nx = load_schema_into_networkx(self.schema)
Beispiel #3
0
    def edit_property(self, property_info):
        """Edit an existing property into schema
        """
        for i, schema_property in enumerate(self.schema["@graph"]):
            if schema_property["rdfs:label"] == property_info["rdfs:label"]:
                validate_property_schema(property_info)
                self.schema["@graph"][i] = property_info

                #TODO: check if properties are added/edited multiple times (e.g. look at explore_property)
                break

        validate_schema(self.schema)
        logger.info(f"Edited the property {property_info['rdfs:label']} successfully.")
        self.schema_nx = load_schema_into_networkx(self.schema)
Beispiel #4
0
    def test_validate_schema(self, helpers):

        se_obj = helpers.get_schema_explorer("example.model.jsonld")

        actual = validate_utils.validate_schema(se_obj.schema)

        assert actual is None