Search in sources :

Example 1 with GraphSchema

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()));
}
Also used : TrainingDataWriterConfigV2(com.amazonaws.services.neptune.profiles.neptune_ml.v2.config.TrainingDataWriterConfigV2) Output(com.amazonaws.services.neptune.profiles.neptune_ml.Output) JsonNode(com.fasterxml.jackson.databind.JsonNode) GraphSchema(com.amazonaws.services.neptune.propertygraph.schema.GraphSchema)

Example 2 with GraphSchema

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()));
}
Also used : Output(com.amazonaws.services.neptune.profiles.neptune_ml.Output) JsonNode(com.fasterxml.jackson.databind.JsonNode) GraphSchema(com.amazonaws.services.neptune.propertygraph.schema.GraphSchema)

Example 3 with GraphSchema

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()));
}
Also used : TrainingDataWriterConfigV2(com.amazonaws.services.neptune.profiles.neptune_ml.v2.config.TrainingDataWriterConfigV2) Output(com.amazonaws.services.neptune.profiles.neptune_ml.Output) JsonNode(com.fasterxml.jackson.databind.JsonNode) GraphSchema(com.amazonaws.services.neptune.propertygraph.schema.GraphSchema)

Example 4 with GraphSchema

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()));
}
Also used : TrainingDataWriterConfigV2(com.amazonaws.services.neptune.profiles.neptune_ml.v2.config.TrainingDataWriterConfigV2) Output(com.amazonaws.services.neptune.profiles.neptune_ml.Output) JsonNode(com.fasterxml.jackson.databind.JsonNode) GraphSchema(com.amazonaws.services.neptune.propertygraph.schema.GraphSchema)

Example 5 with GraphSchema

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()));
}
Also used : TrainingDataWriterConfigV2(com.amazonaws.services.neptune.profiles.neptune_ml.v2.config.TrainingDataWriterConfigV2) Output(com.amazonaws.services.neptune.profiles.neptune_ml.Output) JsonNode(com.fasterxml.jackson.databind.JsonNode) GraphSchema(com.amazonaws.services.neptune.propertygraph.schema.GraphSchema)

Aggregations

GraphSchema (com.amazonaws.services.neptune.propertygraph.schema.GraphSchema)12 Output (com.amazonaws.services.neptune.profiles.neptune_ml.Output)11 JsonNode (com.fasterxml.jackson.databind.JsonNode)11 TrainingDataWriterConfigV2 (com.amazonaws.services.neptune.profiles.neptune_ml.v2.config.TrainingDataWriterConfigV2)10 AmazonClientException (com.amazonaws.AmazonClientException)1 ProgressEvent (com.amazonaws.event.ProgressEvent)1 ProgressListener (com.amazonaws.event.ProgressListener)1 Cluster (com.amazonaws.services.neptune.cluster.Cluster)1 NEPTUNE_EXPORT_TAGS (com.amazonaws.services.neptune.export.NeptuneExportService.NEPTUNE_EXPORT_TAGS)1 Directories (com.amazonaws.services.neptune.io.Directories)1 ExportStats (com.amazonaws.services.neptune.propertygraph.ExportStats)1 CheckedActivity (com.amazonaws.services.neptune.util.CheckedActivity)1 S3ObjectInfo (com.amazonaws.services.neptune.util.S3ObjectInfo)1 Timer (com.amazonaws.services.neptune.util.Timer)1 TransferManagerWrapper (com.amazonaws.services.neptune.util.TransferManagerWrapper)1 ObjectMetadata (com.amazonaws.services.s3.model.ObjectMetadata)1 ObjectTagging (com.amazonaws.services.s3.model.ObjectTagging)1 PutObjectRequest (com.amazonaws.services.s3.model.PutObjectRequest)1 Tag (com.amazonaws.services.s3.model.Tag)1 com.amazonaws.services.s3.transfer (com.amazonaws.services.s3.transfer)1