I have tried many options to execute user defined SPIN functions. But i 
could not succeed. 

*SPIN Function*:

SELECT ?users
WHERE {
    {
        SELECT ((GROUP_CONCAT(DISTINCT ?user; SEPARATOR=',')) AS ?users)
        WHERE {
            ?user a :Person .
            ?user :accountAge ?age .
            FILTER (?age <= 10) .
        }
    } .
}

*SPARQL Query:*

SELECT (<http://www.semanticweb.org/socure.me/activityOntology#InvalidUser>() 
AS ?u) {}

It works fine in TopBraid Composer. But doesn't work in coding. 

I have tried in 4 methods and everything returns empty result.  They are,

        // TYPE 1
        registry.registerAll(model, null);
        String str = "SELECT ?x WHERE { BIND (<
http://topbraid.org/sparqlmotionfunctions#parseDate>('12/3/11','MM/dd/
yy') as ?x) }";
        QueryExecution exec = QueryExecutionFactory.create(str, model);
        
        ResultSet resultSet = exec.execSelect();
        ResultSetFormatter.out(resultSet);
        
        
        // TYPE 2
        Resource queryResource = model.listStatements(null, RDF.type, 
SP.Select).next().getSubject();
        Select selectQuery = (Select) SPINFactory.asQuery(queryResource);
        
        List<Resource> res = selectQuery.getResultVariables();
        System.out.println(res.get(0).toString());
        
        // TYPE 3
        Function function = registry.getFunction("
http://www.semanticweb.org/socure.me/activityOntology#InvalidUser";, model);
        registry.registerFunctions(model, function);
        String query = "SELECT (<
http://www.semanticweb.org/socure.me/activityOntology#InvalidUser>() AS ?u) 
{}";
        
        QueryExecution exec = QueryExecutionFactory.create(query, model);
        
        ResultSet resultSet = exec.execSelect();
        
        System.out.println(resultSet.getRowNumber());
        
        
        // TYPE 4
        Query arqQuery = new ARQFactory().createQuery(spinQuery);
        
        QueryExecution exec = QueryExecutionFactory.create(arqQuery, model);
        
        ResultSet resultSet = exec.execSelect();
        
        System.out.println(resultSet.getRowNumber());


Type 1 is predefined function. Even that is returning empty result. I am 
not sure whether this is the correct methods. 

If someone could help me resolve this problem.

Awaiting for your reply.

Thanks
---
Leo Anbarasan M
India

-- 
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary 
Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid Ensemble, SPARQLMotion, SPARQL Web Pages and SPIN.
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-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to