<HTML dir=ltr><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16588"></HEAD>
<BODY bgColor=#ffffff text=#006600>
<DIV dir=ltr id=idOWAReplyText86059>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial></FONT> </DIV></DIV>
<DIV dir=ltr><BR><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></SPAN> </DIV>
<DIV>
<BLOCKQUOTE cite="" type="cite">
<DIV class=WordSection1>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">From the following extract we can see that AgeGroup is a descendant of GroupofPeople and GroupofPeople is a descendant of Group</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></SPAN> </P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"><rdfs:Class rdf:about="&Content;AgeGroup"</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"> rdfs:label="Content:AgeGroup"></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"> <rdfs:comment>Documentation on AgeGroup(SUMO): A GroupOfPeople whose members all have the same age or have and age which is inside a certain age interval (example, perso</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">ns between 18 and 25 years)</rdfs:comment></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"> <rdfs:subClassOf rdf:resource="&Content;GroupOfPeople"/></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></rdfs:Class></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"><rdfs:Class rdf:about="&Content;GroupOfPeople"</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"> rdfs:label="Content:GroupOfPeople"></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"> <rdfs:comment>Documentation on GroupOfPeople(SUMO): Any Group whose members are exclusively Humans. The instances of this class are used for annotation of groups of inte</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">rest for a certain news item. Examples of GroupOfPeople include age groups, religious groups, etc.</rdfs:comment></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"> <rdfs:subClassOf rdf:resource="&Content;Group"/></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></rdfs:Class></SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></SPAN> </P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">QUESTION</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">How can I write the query so that it retrieves :</SPAN></P>
<P style="TEXT-INDENT: -18pt" class=MsoListParagraph><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"><SPAN>a)<SPAN style="LINE-HEIGHT: normal; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-SIZE: 7pt; FONT-WEIGHT: normal; font-size-adjust: none; font-stretch: normal"> </SPAN></SPAN></SPAN><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">All childnodes of the class called Group</SPAN></P>
<P style="TEXT-INDENT: -18pt" class=MsoListParagraph><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"><SPAN>b)<SPAN style="LINE-HEIGHT: normal; FONT-VARIANT: normal; FONT-STYLE: normal; FONT-SIZE: 7pt; FONT-WEIGHT: normal; font-size-adjust: none; font-stretch: normal"> </SPAN></SPAN></SPAN><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">All parentnodes of the class called AgeGroup</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></SPAN> </P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Please point me in the right direction, or am I trying to achieve something that is not possible?</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Is it possible to use TURTLE within a C program to achieve the above?</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></SPAN> </P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Many, many thanks</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt">Jagdev</SPAN></P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></SPAN> </P>
<P class=MsoNormal><SPAN style="COLOR: rgb(31,73,125); FONT-SIZE: 11pt"></SPAN> </P>
<DIV>
<DIV style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: rgb(181,196,223) 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<P class=MsoNormal><B><SPAN style="COLOR: windowtext; FONT-SIZE: 10pt" lang=EN-US>From:</SPAN></B><SPAN style="COLOR: windowtext; FONT-SIZE: 10pt" lang=EN-US> Joe Andrieu [<A class=moz-txt-link-freetext href="mailto:joe@switchbook.com">mailto:joe@switchbook.com</A>] <BR><B>Sent:</B> 20 June 2010 19:05<BR><B>To:</B> Jagdev Bhogal<BR><B>Cc:</B> <A class=moz-txt-link-abbreviated href="mailto:redland-dev@lists.librdf.org">redland-dev@lists.librdf.org</A><BR><B>Subject:</B> Re: [redland-dev] xpath query</SPAN></P></DIV></DIV>
<P class=MsoNormal> </P>
<P class=MsoNormal>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</P>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt"><BR>char keyword[]="City";</SPAN></P></DIV>
<DIV>
<P style="MARGIN-BOTTOM: 12pt" class=MsoNormal><SPAN style="FONT-SIZE: 10pt">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 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 href="http://www.w3.org/2000/01/rdf-schema"><http://www.w3.org/2000/01/rdf-schema#></A>", keyword);</SPAN></P></DIV>
<P class=MsoNormal>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><BR></P><PRE>Joe Andrieu</PRE><PRE><A href="mailto:joe@switchbook.com">joe@switchbook.com</A></PRE><PRE>+1 (805) 705-8651</PRE><PRE><A href="http://www.switchbook.com/">http://www.switchbook.com</A></PRE>
<P class=MsoNormal><BR>On 6/20/2010 4:11 AM, Jagdev Bhogal wrote: </P>
<DIV>
<P class=MsoNormal><SPAN style="COLOR: black; FONT-SIZE: 10pt">Dear all</SPAN></P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt">I have a c-program which currently parses an rdf file and retrieves all of the nodes using:</SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt">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 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 href="http://www.w3.org/2000/01/rdf-schema">http://www.w3.org/2000/01/rdf-schema</A>#>";</SPAN></P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt">Lets say I have a string defined as:</SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt">char keyword[]="City";</SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt">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". </SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt">If further explanation is needed let me know.</SPAN></P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt">Thank you</SPAN></P></DIV>
<DIV>
<P class=MsoNormal><SPAN style="FONT-SIZE: 10pt">Jagdev</SPAN></P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<P class=MsoNormal> </P></DIV>
<DIV>
<DIV style="TEXT-ALIGN: center" class=MsoNormal align=center>
<HR align=center SIZE=2 width="100%">
</DIV>
<P class=MsoNormal>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 href="http://birminghamculture.org/">http://birminghamculture.org</A><BR><A href="http://www.bcu.ac.uk/about-us/excellent-arts">http://www.bcu.ac.uk/about-us/excellent-arts</A> </P></DIV><PRE> </PRE><PRE style="TEXT-ALIGN: center"><HR align=center SIZE=4 width="90%">
</PRE><PRE> </PRE><PRE>_______________________________________________</PRE><PRE>redland-dev mailing list</PRE><PRE><A href="mailto:redland-dev@lists.librdf.org">redland-dev@lists.librdf.org</A></PRE><PRE><A href="http://lists.librdf.org/mailman/listinfo/redland-dev">http://lists.librdf.org/mailman/listinfo/redland-dev</A></PRE></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></BLOCKQUOTE></DIV>
<DIV><P><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>
http://birminghamculture.org<BR>
http://www.bcu.ac.uk/about-us/excellent-arts
</P></DIV>
</BODY></HTML>