Holger,

I have a SPIN query for which I want to change the ORDER BY expression -- 
say change the ?var name, or change ASC to DESC for example.

I have implemented the following method:

    public QueryBuilder orderBy(Variable var, boolean desc)
    {
spinQuery.removeAll(SP.orderBy); // does not have effect??
 Resource bnode = 
spinQuery.getModel().createResource().addProperty(SP.expression, var);
spinQuery.addProperty(SP.orderBy, spinQuery.getModel().createList(new 
RDFNode[]{bnode}));
 if (desc)
    bnode.addProperty(RDF.type, SP.Desc);
else
    bnode.addProperty(RDF.type, SP.Asc);
 log.debug("SPIN Query Model size(): {}", spinQuery.getModel().size());
 return this;
    }

However, it doesn't look like the removal has effect -- sp:orderBy is still 
present, and as a result it gets duplicated by the following code.

Any ideas? Am I missing something?

Martynas
graphity.org

-- 
-- 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


Reply via email to