Hi all!

I want to define my own functions which i would like to use via a SPARQL
query. For E.g.

 SELECT (<http://example/square>(3) AS ?ThreeSquared) { }

1. SELECT (<myFunctionURI>(parameter) AS ?x){}
OR
2. SELECT ?names WHERE { ?names rdf:type NS:ClassA.
FILTER(NS:myFunction(?names)}

 Is that possible??

The corresponding effort made by me is as follows:
The following package :
com.hp.hpl.jena.sparql.function.user<http://jena.apache.org/documentation/javadoc/arq/com/hp/hpl/jena/sparql/function/user/package-summary.html>and
its class
UserDefinedFunctionFactory<http://jena.apache.org/documentation/javadoc/arq/com/hp/hpl/jena/sparql/function/user/UserDefinedFunctionFactory.html>gives
a brief description of defining our own functions which supports as
shown in Example 1 above. But I need something like Example 2 shown above.
Having browsing Jena-core and ARQ Javadocs, I can find classes like
FunctionFactory, FunctionRegistry, FunctionBase etc, by which I see some
hope of what I want. Can I achieve this? Or such function are limited to
the ARQ engine and cannot be expanded?

To Breif: I want to define a fuction, register it with a URI and hence use
it via SPARQL Query Engine as NS:myFunction() in FILTER and etc constructs
of a SPARQL query.


-- 
*Dibyanshu Jaiswal*
Mb: +91 9038304989
Mb: +91 9674272265

Reply via email to