Hi Giuseppe,

In order to return multiple binding sets in response to a specific query you 
need to implement a PatternInterpreter plug-in and return the results you need 
to in its `interpret()` method.

Please have a look at the example plug-in we have put together in the OWLIM 
documentation: http://owlim.ontotext.com/display/OWLIMv43/OWLIM-SE+Plug-
in+API#OWLIM-SEPlug-inAPI-PuttingItAllTogether%3AAnexamplePlugin

The `interpret` method needs to verify if the predicate of the requested 
pattern is fast:searchDAM then figure out the results using the value coming 
as an object of the pattern and then use one of StatementIterator factory 
methods in order to create and return iterator of the bindings you need to.
The rest will be handled by the plug-in framework.

Let me know if you need more detailed help on this.


Cheers,
Ivan


On Tuesday 31 January 2012 17:58:06 Tusa Giuseppe (u.e.) wrote:
> Hi,
> 
> I'm trying to implement an Owlim plug-in, I followed the steps of the
> documentation. The plug-in seems work correctly, I've got a question about
> the management the response of the query:
> 
> select * where {
>     ?item fast:searchDAM "qs=italy"
> }
> 
> the above query returns one element instead of a elements list because 
> result.addBinding(bindingName, value) overwrite data. How Can I get all
> elements? Exactly How Can I bind my data, achieved by createWrapperCall
> method, in the same bindingName "item"? Below you can find a partial
> implementation of my preprocess method:
> 
> @Override
> public RequestContext preprocess(Request request) {
>       ...............
>       long literalId =
> createWrapperCall(pattern.getObjectVar().getValue()); Value literal =
> entities.get(literalId);
>       String[] idList = getData(literal);
> 
>       for(String bindingName : projection.getBindingNames()) {
>            for(int i=0; i<idList.length; i++) {
>                   Value value = new URIImpl(idList[i]);
>                   result.addBinding(bindingName, value);
>            }
> }
>       return new Context(result);
>       ..................
> }
> 
> 
> Thanks
> Giuseppe
> 
> 
> ________________________________
> Le informazioni contenute nella presente e-mail potrebbero essere
> confidenziali e sono dirette unicamente ai destinatari sopra indicati. In
> caso di ricezione da parte di persona diversa ? vietato qualunque tipo di
> distribuzione o copia. Chi riceva questo messaggio per errore ? pregato di
> inoltrarlo al mittente e di distruggere questa e-mail.
> 
> This e-mail may contain confidential information and is intended only for
> the use of the addressee(s) named above. If the reader of this message is
> not the intended recipient of this message, please note that distribution
> or copying of this communication is forbidden. Anyone who receives this
> communication in error should return it immediately to the sender and
> destroy the message.
_______________________________________________
OWLIM-discussion mailing list
[email protected]
http://ontotext.com/mailman/listinfo/owlim-discussion

Reply via email to