Hi Barb,

superficially this sounds OK, but there are of course many places where 
things could go wrong, e.g. not declaring the plug-in correctly.  I 
guess the best way to proceed would be if you would send me the (zipped) 
project of yours in a private message, and I can have a look.

Thanks,
Holger



Barb wrote:
> I've created a SPARQL function in java by following your "Writing a
> new SPARQL Function in Java" tutorial. My function has no incoming
> arguments and simply generates a uuid. Because there are no arguments,
> I have it extending FunctionBase0.  I've tested it in the in the Plug-
> in environment (launched a new instance of Composer and pasted it into
> the Query Editor) ...everything worked fine. I went back into TBC and
> used the wizard to create my SPIN file. Everything looked good to
> go ... I could see my function under spin:Functions in the Classes
> view. I referenced it in a CONSTRUCT query but unfortunately nothing
> was returned.  It's hard to explain every last detaiI .. I'm hoping
> for a blatant error.
> 
> After writing my function I found smf:generateUUID (which I'll be
> using). However, I want to know the issue with the above for future
> reference.
> 
> The code is below.
> 
> Thanks,
> Barb
> 
> import com.hp.hpl.jena.sparql.expr.NodeValue;
> import com.hp.hpl.jena.sparql.function.FunctionBase0;
> import java.util.UUID;
> 
> 
> public class GenerateUniqueIdFunction extends FunctionBase0
> {
>     public GenerateUniqueIdFunction() { super() ;}
> 
>     public NodeValue exec()
>     {
>       String uniqueJavaId = UUID.randomUUID().toString();
>                 return NodeValue.makeString(uniqueJavaId);
>     }
> }
> > 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to