@Test public void addsAdditionsToPlan() throws Exception { String addedValue = "newValue"; String addedValue2 = "newValue2"; addAdditionsToChangeLog( new Change(SUBJECT, PRED1, newArrayList(new Value(addedValue, STRING), new Value(addedValue2, STRING)), null) ); 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("additions")), startsWith(DATA_SET_URI + "/additions"), isNull(), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/additions"), eq(RDF_TYPE), eq(TIM_VOCAB + "Additions"), isNull(), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/additions"), eq(timPredicate("hasAddition")), startsWith(DATA_SET_URI + "/addition"), isNull(), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/addition"), eq(RDF_TYPE), eq(TIM_VOCAB + "Addition"), isNull(), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/addition"), eq(timPredicate("hasKey")), eq(PRED1), isNull(), isNull(), isNull() ); verify(serializer, times(2)).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/addition"), eq(timPredicate("hasValue")), startsWith(DATA_SET_URI + "/value"), isNull(), isNull(), isNull() ); verify(serializer, times(2)).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/value"), eq(RDF_TYPE), eq(timType("Value")), isNull(), isNull(), isNull() ); verify(serializer, times(2)).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/value"), eq(timPredicate("type")), eq(STRING), eq(STRING), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/value"), eq(timPredicate("rawValue")), eq(addedValue), eq(STRING), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/value"), eq(timPredicate("rawValue")), eq(addedValue2), eq(STRING), isNull(), isNull() ); verify(serializer).addDelQuad( eq(true), startsWith(DATA_SET_URI + "/value"), eq(timPredicate("nextValue")), startsWith(DATA_SET_URI + "/value"), isNull(), 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);  }