<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#006600" bgcolor="#ffffff">
I"m not sure which query module you're using, but with SPARQL, you
would just get rid of the ?label term and use "City" instead. In fact,
whatever the query engine, you can probably just use sprintf or
something similar to construct the query clause with "City" in place of
?label.<br>
<br>
Something like<br>
<div><font face="Arial" size="2"><br>
char keyword[]="City";</font></div>
<div><font face="Arial" size="2">char query_string[BIGENOUGHBUFFER];<br>
<br>
sprintf(query_string, "select ?comment from <C:/datafile.rdf>
where (?x rdf:type rdfs:Class) (?x rdfs:label \"%s\") (?x rdfs:comment
?comment) using rdf for
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><http://www.w3.org/1999/02/22-rdf-syntax-ns#></a>, rdfs for
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2000/01/rdf-schema#"><http://www.w3.org/2000/01/rdf-schema#></a>", keyword);<br>
<br>
</font></div>
I won't address the potential unicode and buffer overrun problems. I
prefer c++ classes to deal with the buffer issues and haven't yet
settled completely on how I'm handling unicode.<br>
<br>
-j<br>
<br>
<pre class="moz-signature" cols="72">Joe Andrieu
<a class="moz-txt-link-abbreviated" href="mailto:joe@switchbook.com">joe@switchbook.com</a>
+1 (805) 705-8651
<a class="moz-txt-link-freetext" href="http://www.switchbook.com">http://www.switchbook.com</a>
</pre>
<br>
On 6/20/2010 4:11 AM, Jagdev Bhogal wrote:
<blockquote
cite="mid:123505CD74170A4097732B2AC5326CB0043927EF@STAFFEXA.staff.uce.ac.uk"
type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<meta name="GENERATOR" content="MSHTML 8.00.7600.16588">
<div><font face="Arial" size="2" color="#000000">Dear all</font></div>
<div><font face="Arial" size="2">I have a c-program which currently
parses an rdf file and retrieves all of the nodes using:</font></div>
<div> </div>
<div><font face="Arial" size="2">const char *query_string="select
?label, ?comment from <C:/datafile.rdf> where (?x rdf:type
rdfs:Class) (?x rdfs:label ?label) (?x rdfs:comment ?comment) using rdf
for <<a moz-do-not-send="true"
href="http://www.w3.org/1999/02/22-rdf-syntax-ns#%3E,rdfs">http://www.w3.org/1999/02/22-rdf-syntax-ns#>,rdfs</a>
for <<a moz-do-not-send="true"
href="http://www.w3.org/2000/01/rdf-schema">http://www.w3.org/2000/01/rdf-schema</a>#>";<br>
</font></div>
<div><font face="Arial" size="2">Lets say I have a string defined as:</font></div>
<div> </div>
<div><font face="Arial" size="2">char keyword[]="City";</font></div>
<div> </div>
<div><font face="Arial" size="2">My question is can we have a where
clause in the query, so that we only retrieve results where the
strcmp(label, keyword) = 0 in other words only retrieve those results
where the label is equal to the keyword which in this case is "City". </font></div>
<div> </div>
<div><font face="Arial" size="2">If further explanation is needed let
me know.</font></div>
<div><font face="Arial" size="2">Thank you</font></div>
<div><font face="Arial" size="2">Jagdev</font></div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>
<hr>Through our significant contribution to the creative industries
and the city's cultural and artistic life,<br>
Birmingham City University is proud to support Birmingham's bid to be
UK City of Culture in 2013<br>
<br>
<a class="moz-txt-link-freetext" href="http://birminghamculture.org">http://birminghamculture.org</a><br>
<a class="moz-txt-link-freetext" href="http://www.bcu.ac.uk/about-us/excellent-arts">http://www.bcu.ac.uk/about-us/excellent-arts</a>
</div>
<pre wrap="">
<hr width="90%" size="4">
_______________________________________________
redland-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:redland-dev@lists.librdf.org">redland-dev@lists.librdf.org</a>
<a class="moz-txt-link-freetext" href="http://lists.librdf.org/mailman/listinfo/redland-dev">http://lists.librdf.org/mailman/listinfo/redland-dev</a></pre>
</blockquote>
</body>
</html>