--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
topbrai...@googlegroups.com
To unsubscribe from this group, send email to
topbraid-user...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
Map<String,RDFNode> map = new HashMap<String,RDFNode>();
map.put("predicate",RDF.Type);
Hi HolgerThanks for the quick reply. Here are the source lines:Map<String,RDFNode> map = new HashMap<String,RDFNode>();
map.put("predicate",RDF.Type);
Template templ = SPINFactory.asTemplate(sub);com.hp.hpl.jena.query.Query arqQ = ARQFactory.get().createQuery((Select)templ.getBody());org.topbraid.spin.model.Query spinQuery = new ARQ2SPIN(model).createQuery(arqQ, null);
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix arg: <http://spinrdf.org/arg#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ex: <http://example.com/onto#> .
<ex:testTempl>
a <http://spinrdf.org/spin#Template> ;
<http://spinrdf.org/spin#body>
[ a <http://spinrdf.org/sp#Select> ;
([ <http://spinrdf.org/sp#object>
[ <http://spinrdf.org/sp#varName>
"object"^^xsd:string
] ;
<http://spinrdf.org/sp#predicate>
[ <http://spinrdf.org/sp#varName>
"ssn"^^xsd:string
] ;
<http://spinrdf.org/sp#subject>
[ <http://spinrdf.org/sp#varName>
"sub"^^xsd:string
]
])
] ;
<http://spinrdf.org/spin#constraint>
[ a <http://spinrdf.org/spl#Argument> ;
rdfs:comment "SSN value " ;
<http://spinrdf.org/spl#predicate>
arg:ssn ;
<http://spinrdf.org/spl#valueType>
rdf:Property
] .
and the modified code is
Map<String,RDFNode> map1 = new HashMap<String,RDFNode>();
map1.put("predicate",RDF.Bag);
....
Template templ = SPINFactory.asTemplate(sub);
org.topbraid.spin.model.Command spinQuery = templ.getBody();
StringBuilder queryBldr = new StringBuilder();
StringPrintContext printCntxt = new StringPrintContext(queryBldr,map1);
RDFNode rnode = printCntxt.getInitialBinding("predicate");
System.out.println("node: "+rnode);
spinQuery.print(printCntxt);
sparqlStr = queryBldr.toString();
System.out.println(sparqlStr);
thanks