@Test public void addsCustomProvenanceToPlan() throws Exception { String value1 = "value1"; String value2 = "value2"; addProvenanceToChangeLog( new Provenance(PRED1, newArrayList(new Value(value1, STRING))), new Provenance(PRED2, newArrayList(new Value(value2, STRING))) ); GraphQlToRdfPatch instance = new GraphQlToRdfPatch(SUBJECT, USER_URI, changeLog); instance.sendQuads(serializer, s -> { }, dataSet); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/plan"), eq(timPredicate("hasCustomProv")), startsWith(DATA_SET_URI + "/customProv"), isNull(), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/customProv"), eq(RDF_TYPE), eq(timType("CustomProv")), isNull(), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(SUBJECT), eq(PRED1), eq(value1), eq(STRING), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(SUBJECT), eq(PRED2), eq(value2), eq(STRING), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/customProv"), eq(PRED1), eq(value1), eq(STRING), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/customProv"), eq(PRED2), eq(value2), eq(STRING), isNull(), isNull() ); }
@Override public void sendQuads(RdfPatchSerializer saver, Consumer<String> importStatusConsumer, DataSet dataSet) throws LogStorageFailedException { addData(saver, dataSet); String newRevision = addNewRevision(saver, dataSet); String association = addProvenance(saver, dataSet, newRevision); addPlan(saver, dataSet, newRevision, association); }
GraphQlToRdfPatch implements PatchRdfCreator { @Override public void sendQuads(RdfPatchSerializer saver, Consumer<String> importStatusConsumer, DataSet dataSet) throws LogStorageFailedException { addData(saver, dataSet); String newRevision = addNewRevision(saver, dataSet); String association = addProvenance(saver, dataSet, newRevision); addPlan(saver, dataSet, newRevision, association); } }
GraphQlToRdfPatch implements PatchRdfCreator { @Override public void sendQuads(RdfPatchSerializer saver, Consumer<String> importStatusConsumer, DataSet dataSet) throws LogStorageFailedException { addData(saver, dataSet); String newRevision = addNewRevision(saver, dataSet); String association = addProvenance(saver, dataSet, newRevision); addPlan(saver, dataSet, newRevision, association); } @JsonCreator  GraphQlToRdfPatch(
    @JsonProperty("subjectUri") String subjectUri,
    @JsonProperty("userUri") String userUri,
    @JsonProperty("changeLog") ChangeLog changeLog
  ); }
GraphQlToRdfPatch implements PatchRdfCreator { @Override public void sendQuads(RdfPatchSerializer saver, Consumer<String> importStatusConsumer, DataSet dataSet) throws LogStorageFailedException { addData(saver, dataSet); String newRevision = addNewRevision(saver, dataSet); String association = addProvenance(saver, dataSet, newRevision); addPlan(saver, dataSet, newRevision, association); } @JsonCreator  GraphQlToRdfPatch(
    @JsonProperty("subjectUri") String subjectUri,
    @JsonProperty("userUri") String userUri,
    @JsonProperty("changeLog") ChangeLog changeLog
  ); @Override void sendQuads(RdfPatchSerializer saver, Consumer<String> importStatusConsumer, DataSet dataSet); }
GraphQlToRdfPatch implements PatchRdfCreator { @Override public void sendQuads(RdfPatchSerializer saver, Consumer<String> importStatusConsumer, DataSet dataSet) throws LogStorageFailedException { addData(saver, dataSet); String newRevision = addNewRevision(saver, dataSet); String association = addProvenance(saver, dataSet, newRevision); addPlan(saver, dataSet, newRevision, association); } @JsonCreator  GraphQlToRdfPatch(
    @JsonProperty("subjectUri") String subjectUri,
    @JsonProperty("userUri") String userUri,
    @JsonProperty("changeLog") ChangeLog changeLog
  ); @Override void sendQuads(RdfPatchSerializer saver, Consumer<String> importStatusConsumer, DataSet dataSet);  }