Uploaded image for project: 'Marmotta (Retired)'
  1. Marmotta (Retired)
  2. MARMOTTA-208

Meta Put Webservice Deleting Tuples Incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 3.0-incubating
    • 3.1-incubating
    • Platform
    • None
    • Windows, JDK 6, H2 database

    Description

      If you use the Meta Put webservice to update your metadata, tuples that did not change between the existing metadata and the new metadata are removed, leaving on the tuples that changed as active for the subject.

      To Reproduce:
      1.) Use the Meta webservice to put some RDF metadata... For example...

      <rdf:RDF
      xmlns:context="http://localhost:8080/LMF/context/"
      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:local="http://localhost:8080/LMF/resource/"
      xmlns:dc="http://purl.org/dc/elements/1.1/">

      <rdf:Description rdf:about="http://localhost:8080/LMF/resource/test:4">
      <dc:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">TESTING me with Linked Data</dc:title>
      <dc:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string">this is a test of me</dc:description>
      </rdf:Description>

      </rdf:RDF>

      2.) This should create 2 new tuples for the particular subject.
      3.) Now use the exact same RDF document, and do it again... You will notice that all tuples for the subject are removed.
      4.) Now change either the dc.title or dc.decsription values, and put the meta again. You will now notice the tuple exists for the changed value, but still does not exist for the value that was not changed.

      In looking at the MetaWebService.java in the putMeta method, I notice it remove() for all tuples, and then right after add() for the new tuples all within the same transaction. It would seem the remove and the add being in the same transaction is causing the issue if you are removing a tuple you are simultaneously trying to add.

      I made the change to...

      1.) Remove tuples
      2.) commit
      3.) begin a new transaction
      4.) add
      4.) commit

      ... and it seemed to give me the expected behavior.

      Attachments

        Activity

          People

            jakob Jakob Frank
            jkoppenhofer Jonathan Koppenhofer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: