[WebLab-User] Créer un nouveau service web.

Gérard Dupont ger.dupont at gmail.com
Wed Nov 2 23:43:01 CET 2011


Bonsoir,

Pour compléter la réponse de Nicolas, je pense que les méthodes qu'il
propose doivent être utilisées en exploitant la liste d'AppolineObject et
qu'il est nécessaire de modiifer la seconde méthode pour qu'elle prenne en
paramètres les listes d'*AppolineObject*. Par exemple :

*List<AppolineObject> resultats = appolineSearch(<put the right parameters
to execute the query>);*
ResultSet set = constructAndAnnotateResultSet(squery, nbResults, offset);
// check parameters here, these should be the one received by the
"search()" method in the Searcher service
ResultSet completeResultSet = fillResultSetWith*AppolineObject*(set, *
resultats*, squery, nbRes);*

*En supposant :

private ResultSet fillResultSetWithAppolineObject(ResultSet rs,
List<AppolineObject> hits, Query query, int nbRes) throws
URISyntaxException {

        String uuid = UUID.randomUUID().toString();
        PoKHelper h = RDFHelperFactory.getPoKHelper(rs.getPoK());
        h.setAutoCommitMode(false);

        int i = 0;
        for (AppolineObject aObject : hits) {

            String huri = "weblab://appoline/hit/" + uuid + "/" + i;

            // Creates hit properties
            h.createResStat(huri, RDF.TYPE, RETRIEVAL_PROPERTY_NAMESPACE +
"Hit");
            h.createLitStat(huri, WebLab.HAS_RANK, Integer.toString(i + 1));

            h.createLitStat(huri, WebLab.HAS_SCORE,
aObject.getPertinence());
            h.createResStat(huri, IS_LINKED_TO_SOURCE, aObject.getAnoID());

            // this is the minimal property, but one can add extra
annotation using AppolineObject properties
            // ...

            i++;
        }

        h.createLitStat(rs.getUri(), HAS_NUMBER_OF_RESULTS, hits.size());
        h.commit();

        return rs;
    }

2011/11/2 <jetsadabodin.pintong at st-cyr.terre-net.defense.gouv.fr>
>
>> Bonjour ,
>>
>> J?ai essayé de créer un service Weblab. J?ai implémenté l?interface
>> Searcher.
>>
>> Mon service a une méthode qui prendre (string,int,int,int,int,int) comme
>> paramètres et il renvoie un List<AppolineObject> au retour.
>>
>> Je sais qu?il faut créer des Hits mais je n?arrive pas.
>>
>> Comment créer le ResultSet et les Hits pour mon code.
>>
>> Voici le code de « appolineSearch » :
>>
>>



-- 
Gérard Dupont
Information Processing Control and Cognition (IPCC)
CASSIDIAN - an EADS company

Document & Learning team - LITIS Laboratory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://weblab-project.org/pipermail/user_weblab-project.org/attachments/20111102/5d15a7f2/attachment.html>


More information about the User mailing list