Uploaded image for project: 'Tupelo'
  1. Tupelo
  2. TUP-257

Subject session does un-needed addition/removal of triples

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • None
    • Kernel
    • None

      When calling save() on subject session, lists (and possibly sets) that have not been modified will be completely removed then added. E.g.

      Sample test: creates a thing with a single list property then saves it. Performs no changes, then saves it again. Note that the subject on the Seq has changed – this reflects the fact that the entire collection was removed, recreated then re-added. (N.B. this is happening roughly at line 225 in SubjectSession)

      @Test
      public void testTUPXXX() throws Exception

      { MemoryContext mc = new MemoryContext(); ThingSession thingSession = new ThingSession(mc); Resource subject = Resource.uriRef("urn:/my/thing/subject"); Resource predicate = Resource.uriRef("urn:/my/thing/predicate"); List<Integer> testInts = new LinkedList<Integer>(); testInts.addAll(Arrays.asList(2, 4, 6, 8)); Thing thing = thingSession.fetchThing(subject); thing.setValues(predicate, testInts); thingSession.save(); RdfXml.write(mc.getTriples(), System.out); thingSession.save(); RdfXml.write(mc.getTriples(), System.out); }

              futrelle Joe Futrelle (Inactive)
              jgaynor Jeffrey Gaynor
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: