From: Richard C. <ri...@cy...> - 2006-07-06 20:44:16
|
Hi Michael, On 6 Jul 2006, at 22:25, Michael Mainik wrote: > Im trying to implement a php-script which generates RDF-Files with =20 > data form a local database containing infromation about =20 > publications. My rdf-file should look like this: > <rdf:Description rdf:about=3D"http://swrc.ontoware.org/m1"> > <rdf:type> > <owl:Class rdf:about=3D"http://swrc.ontoware.org/=20 > ontology#Publication"/> > </rdf:type> > <dc:creator>Me</dc:creator> > <dc:title rdf:datatype=3D"http://www.w3.org/2001/=20 > XMLSchema#string">A multi-agent platform for a corporate semantic =20 > web.</dc:title> > <dc:description rdf:datatype=3D"http://www.w3.org/2001/=20 > XMLSchema#string">We describe the technical choices and the design =20 > of a multi-agents\nsoftware architecture to manage a corporate =20 > memory in the form\nof a corporate semantic web. We then present =20 > our approach to\ntackle a distributed memory and distributed =20 > queries.</dc:description> > </rdf:Description> > but when I try to add the rdf:type-tag to my model, I get the =20 > following error message: > Fatal error: Call to undefined method Literal::getURI() in /var/www/=20= > rdfapi-php/api/util/RdfUtil.php on line 63 > > My php-code looks like this: > $publication =3D new Resource('http://l3s.de/publication/'.$ergebnis=20= > [$i]->dblp_key); > $pub_title =3D DC::TITLE(); > $pub_source =3D DC::SOURCE(); > =09 > =09 > $statement0 =3D new Statement($publication, = RDF::TYPE(), new =20 > Literal("")); I guess here's the problem. The object (third element) of an rdf:type =20= statement must be a resource, that is, an URI or a blank node. A =20 literal will not work. (And especially not an empty literal!) You =20 could try something like this: $model->add(new Statement($pub, RDF::TYPE(), new Resource("http://swrc.ontoware.org/=20 ontology#Publication"))); Best, Richard > $statement1 =3D new Statement($publication, = $pub_title, new =20 > Literal ($ergebnis[$i]->title)); > $statement2 =3D new Statement($publication, = $pub_source, new =20 > Literal ($ergebnis[$i]->source)); > =09 > =09 > =09 > $model->add($statement0); > $model->add($statement1); > $model->add($statement2); > > I cannot find any mistake in my code, please help me. > --=20 > > > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! > Ideal f=FCr Modem und ISDN: http://www.gmx.net/de/go/smartsurfer > > Using Tomcat but need to do more? Need to support web services, =20 > security? > Get stuff done quickly with pre-integrated technology to make your =20 > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache =20 > Geronimo > http://sel.as-us.falkag.net/sel?=20 > cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D121642 > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > |