Hypertopic / LaSuli

Social annotation for qualitative analysis
https://hypertopic.org/lasuli
GNU General Public License v3.0
12 stars 4 forks source link

When a document is already in a corpus... #14

Closed benel closed 8 years ago

benel commented 13 years ago

... use this corpus instead of the user's "bookmarks".

This applies especially to texts in Cassandre, since all of them are already recorded as being in a corpus

chao commented 12 years ago

I don't understand clearly, what do you mean a document in a corpus?

For example: http://cassandre.hypertopic.org/text/IF14/0df56d1f70eee373461ae249350008f5 is in Corpus "IF14" right?

So for this document I should use Corpus "IF14" instead of using users' "bookmarks", right?

benel commented 12 years ago

Right.

LaSuli should query Cassandre first and then Argos:

http://cassandre.hypertopic.org/item/?resource=http://cassandre.hypertopic.org/text/IF14/0df56d1f70eee373461ae249350008f5

{"rows":[
{"key":["http://cassandre.hypertopic.org/text/IF14/0df56d1f70eee373461ae249350008f5"], "value":{"item":{"corpus":"IF14", "id":"0df56d1f70eee373461ae249350008f5"}}}
]}
chao commented 12 years ago

Fixed

benel commented 12 years ago

I tested 3 possible implementations:

None seems to work... Did you implemented it in a fourth way?

benel commented 12 years ago

Please, note that what is said about the reuse of the corpus should be done also with the reuse of the item ID.

benel commented 12 years ago

Hmm, I suppose that my specifications were not clear enough. Now that Steatite is ready for integration it should be easier to explain it and to test it. Here is a real life scenario:

  1. Set up LaSuli with the following parameters:
    • http://argos2.youknowwhere/ yourlogin yourpassword (default)
    • http://steatite.youknowwhere/ (empty) (empty)
  2. Go to http://steatite.youknowwhere/picture/c8ffb3e9346ac80ea730e512a57fdee79a34aac8 LaSuli should show "Boucle d'oreille" as the name.
  3. Add the attribute grave: 3. LaSuli should create a new item on Argos with the same ID (c8ffb3e9346ac80ea730e512a57fdee79a34aac8) and the same corpus (Megara Hyblaea) it found on Steatite at step 2.

Note: When LaSuli searches an item at step 2, it must query the servers in the same order and stop at the first positive answer.

benel commented 12 years ago

Note that to do the same test again, you will have to delete the new item in Argos at the end of the test.

benel commented 11 years ago

The code to fix is there: https://github.com/Hypertopic/LaSuli/commit/e486f621a0252b0e7dc4517c4f6c2527076cf99f#commitcomment-2788165 and https://github.com/Hypertopic/LaSuli/commit/9b0d8d385d9aeceb139976850208c4755fead00a#commitcomment-2788303.

Slals commented 8 years ago

I'm currently working on it, I need some insights to continue!

First I found a way to get the existing item id as id when LaSuli posts the item in the default server (argos as it is in your example).

But for the corpus it's a bit though. Actually, when LaSuli creates a corpus item it calls the method createWithId(id, name). The point is, when this method is called, the same variable is put as parameters : as id and as name, see here. I'm only able to get the corpus name of the resource.

Now, I need some insights. In Steatite, an item and a corpus have both the same id. Regarding to this, it could be a solution to get the corpus name and to get the item id in order to call the method createWithId(itemId, corpusName). This would be correct for the Steatite case, but what about other servers?

benel commented 8 years ago

First I found a way to get the existing item id as id when LaSuli posts the item in the default server (argos as it is in your example).

I created a patch for this yesterday. I will push it on a dev branch (since there are other related issues to be fixed).

In Steatite, an item and a corpus have both the same id.

What do you mean? For example 71ff73e95a7df128d247c01d0892ba5c3c7cbfe0 is an item ID while Vitraux - Bénel is its corpus ID.

Slals commented 8 years ago

For example 71ff73e95a7df128d247c01d0892ba5c3c7cbfe0 is an item ID while Vitraux - Bénel is its corpus ID.

That exactly what I meant. I thought at first a corpus id was the item id. The database structure in Steatite looks like that (id, attribute, value).

So, for an item 71ff73e95a7df128d247c01d0892ba5c3c7cbfe0, in Steatite we have : (71ff73e95a7df128d247c01d0892ba5c3c7cbfe0, name, SNZ 004) (71ff73e95a7df128d247c01d0892ba5c3c7cbfe0, corpus, Vitraux - Bénel)

Here the corpus ID and the item ID are the same. I mistaken corpus ID because of that, but now it's clearer.

Your solution has the same result as mine and it's shorter :+1: .

(since there are other related issues to be fixed).

Are you refering to issues in this ticket? Does your solution resolve all the issues?

benel commented 8 years ago

Here the corpus ID and the item ID are the same. I mistaken corpus ID because of that, but now it's clearer.

(71ff73e95a7df128d247c01d0892ba5c3c7cbfe0, corpus, Vitraux - Bénel) should be read as "item 71ff...'s corpus is Vitraux - Bénel".

This is a triple notation just like in RDF.

Think about is as the edge of a graph: 71ff... ---corpus---> Vitraux - Bénel

benel commented 8 years ago

(since there are other related issues to be fixed).

Are you refering to issues in this ticket? Does your solution resolve all the issues?

There is a related problem with the name attribute: only the name from the read-write server is shown. This prevents to test easily (from the user interface) that the patch worked.

Highlights are also broken, but this seems to be unrelated with my patch.