use of com.amazonaws.services.neptune.propertygraph.schema.GraphSchema in project amazon-neptune-tools by awslabs.
the class NumericalCategoryAndAutoFeatureOverrideTest method runTest.
private void runTest(String jsonFile) throws IOException {
JsonNode json = JsonFromResource.get(jsonFile, getClass());
GraphSchema graphSchema = GraphSchema.fromJson(json.get("schema"));
JsonNode expectedTrainingDataConfig = json.get("config");
Collection<TrainingDataWriterConfigV2> overrideConfig = TrainingDataWriterConfigV2.fromJson(json.get("feature"), NeptuneMLSourceDataModel.PropertyGraph);
Output output = new Output();
new PropertyGraphTrainingDataConfigWriterV2(graphSchema, output.generator(), PropertyGraphTrainingDataConfigWriterV2.COLUMN_NAME_WITHOUT_DATATYPE, PrinterOptions.NULL_OPTIONS, overrideConfig.iterator().next()).write();
assertEquals(Output.format(expectedTrainingDataConfig), Output.format(output.allOutput()));
}
use of com.amazonaws.services.neptune.propertygraph.schema.GraphSchema in project amazon-neptune-tools by awslabs.
the class PropertyGraphTrainingDataConfigWriterV2FeatureTest method runTest.
private void runTest(String jsonFile) throws IOException {
JsonNode json = JsonFromResource.get(jsonFile, getClass());
GraphSchema graphSchema = GraphSchema.fromJson(json.get("schema"));
JsonNode expectedTrainingDataConfig = json.get("config");
Output output = new Output();
new PropertyGraphTrainingDataConfigWriterV2(graphSchema, output.generator(), PropertyGraphTrainingDataConfigWriterV2.COLUMN_NAME_WITHOUT_DATATYPE, PrinterOptions.NULL_OPTIONS).write();
assertEquals(Output.format(expectedTrainingDataConfig), Output.format(output.allOutput()));
}
use of com.amazonaws.services.neptune.propertygraph.schema.GraphSchema in project amazon-neptune-tools by awslabs.
the class TextFastTextFeatureTest method runTest.
private void runTest(String jsonFile) throws IOException {
JsonNode json = JsonFromResource.get(jsonFile, getClass());
GraphSchema graphSchema = GraphSchema.fromJson(json.get("schema"));
JsonNode expectedTrainingDataConfig = json.get("config");
Collection<TrainingDataWriterConfigV2> overrideConfig = TrainingDataWriterConfigV2.fromJson(json.get("feature"), NeptuneMLSourceDataModel.PropertyGraph);
Output output = new Output();
new PropertyGraphTrainingDataConfigWriterV2(graphSchema, output.generator(), PropertyGraphTrainingDataConfigWriterV2.COLUMN_NAME_WITHOUT_DATATYPE, PrinterOptions.NULL_OPTIONS, overrideConfig.iterator().next()).write();
assertEquals(Output.format(expectedTrainingDataConfig), Output.format(output.allOutput()));
}
use of com.amazonaws.services.neptune.propertygraph.schema.GraphSchema in project amazon-neptune-tools by awslabs.
the class TextSbertFeatureTest method runTest.
private void runTest(String jsonFile) throws IOException {
JsonNode json = JsonFromResource.get(jsonFile, getClass());
GraphSchema graphSchema = GraphSchema.fromJson(json.get("schema"));
JsonNode expectedTrainingDataConfig = json.get("config");
Collection<TrainingDataWriterConfigV2> overrideConfig = TrainingDataWriterConfigV2.fromJson(json.get("feature"), NeptuneMLSourceDataModel.PropertyGraph);
Output output = new Output();
new PropertyGraphTrainingDataConfigWriterV2(graphSchema, output.generator(), PropertyGraphTrainingDataConfigWriterV2.COLUMN_NAME_WITHOUT_DATATYPE, PrinterOptions.NULL_OPTIONS, overrideConfig.iterator().next()).write();
assertEquals(Output.format(expectedTrainingDataConfig), Output.format(output.allOutput()));
}
use of com.amazonaws.services.neptune.propertygraph.schema.GraphSchema in project amazon-neptune-tools by awslabs.
the class TextTfIdfTest method runTest.
private void runTest(String jsonFile) throws IOException {
JsonNode json = JsonFromResource.get(jsonFile, getClass());
GraphSchema graphSchema = GraphSchema.fromJson(json.get("schema"));
JsonNode expectedTrainingDataConfig = json.get("config");
Collection<TrainingDataWriterConfigV2> overrideConfig = TrainingDataWriterConfigV2.fromJson(json.get("feature"), NeptuneMLSourceDataModel.PropertyGraph);
Output output = new Output();
new PropertyGraphTrainingDataConfigWriterV2(graphSchema, output.generator(), PropertyGraphTrainingDataConfigWriterV2.COLUMN_NAME_WITHOUT_DATATYPE, PrinterOptions.NULL_OPTIONS, overrideConfig.iterator().next()).write();
assertEquals(Output.format(expectedTrainingDataConfig), Output.format(output.allOutput()));
}
Aggregations