From: Luigi S. <sel...@ho...> - 2006-01-30 14:09:57
|
<html><div style='background-color:'><P>Hi All, </P> <P>I tried to query a foaf model using the sparl engine but it did not work. I made the following foaf file using the foaf-a-matic web service (<A href="http://www.ldodds.com/foaf/foaf-a-matic.html">http://www.ldodds.com/foaf/foaf-a-matic.html</A>):</P> <P><rdf:RDF<BR> xmlns:rdf="<A href="http://www.w3.org/1999/02/22-rdf-syntax-ns">http://www.w3.org/1999/02/22-rdf-syntax-ns</A>#"<BR> xmlns:rdfs="<A href="http://www.w3.org/2000/01/rdf-schema">http://www.w3.org/2000/01/rdf-schema</A>#"<BR> xmlns:foaf="<A href="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</A>"<BR> xmlns:admin="<A href="http://webns.net/mvcb/">http://webns.net/mvcb/</A>"><BR><foaf:PersonalProfileDocument rdf:about=""><BR> <foaf:maker rdf:resource="#me"/><BR> <foaf:primaryTopic rdf:resource="#me"/><BR> <admin:generatorAgent rdf:resource="<A href='http://www.ldodds.com/foaf/foaf-a-matic"/'>http://www.ldodds.com/foaf/foaf-a-matic"/</A>><BR> <admin:errorReportsTo rdf:resource="<A href='mailto:le...@ld..."/'>mailto:le...@ld..."/</A>><BR></foaf:PersonalProfileDocument><BR><foaf:Person rdf:ID="me"><BR><foaf:name>Luigi Selmi</foaf:name><BR><foaf:title>Mr</foaf:title><BR><foaf:givenname>Luigi</foaf:givenname><BR><foaf:family_name>Selmi</foaf:family_name><BR><foaf:nick>Luigi</foaf:nick><BR><foaf:mbox_sha1sum>799ffcad6c44171ef4ec2d863d7cd9aca869982c</foaf:mbox_sha1sum><BR><foaf:workplaceHomepage rdf:resource="<A href='http://www.sharesemantics.com"/></foaf:Person'>http://www.sharesemantics.com"/></foaf:Person</A>><BR></rdf:RDF></P> <P>then I wrote the following chunk of php code to make the query and execute it :</P><FONT size=2> <P>// Show the input model</P> <P>$model->writeAsHtmlTable();</P></FONT><FONT size=2> <P>PREFIX foaf <http://xmlns.com/foaf/0.1/></P> <P>SELECT ?name</P> <P>WHERE { </FONT><FONT face="Times New Roman" size=3>?x</FONT><FONT size=2> foaf:name ?name</P> <P>}';</P> <P>// Execute the query</P> <P>$result = $model->sparqlQuery($querystring); </P> <P>but it never worked out. It prints out the model correctly but don't find the person's name . Everything goes well with vcard and dublincore name spaces. Maybe my query is incorrect. Can anyone give a working example? Thanks</P> <P>Luigi</P> <P></FONT><BR><BR><BR> </P> <DIV> <P><FONT color=#0033cc></FONT> </P></DIV></div></html> |