From: Michael M. <za...@gm...> - 2006-07-06 20:26:03
|
Hi, Im trying to implement a php-script which generates RDF-Files with data form a local database containing infromation about publications. My rdf-file should look like this: <rdf:Description rdf:about="http://swrc.ontoware.org/m1"> <rdf:type> <owl:Class rdf:about="http://swrc.ontoware.org/ontology#Publication"/> </rdf:type> <dc:creator>Me</dc:creator> <dc:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">A multi-agent platform for a corporate semantic web.</dc:title> <dc:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string">We describe the technical choices and the design of a multi-agents\nsoftware architecture to manage a corporate memory in the form\nof a corporate semantic web. We then present our approach to\ntackle a distributed memory and distributed queries.</dc:description> </rdf:Description> but when I try to add the rdf:type-tag to my model, I get the following error message: Fatal error: Call to undefined method Literal::getURI() in /var/www/rdfapi-php/api/util/RdfUtil.php on line 63 My php-code looks like this: $publication = new Resource('http://l3s.de/publication/'.$ergebnis[$i]->dblp_key); $pub_title = DC::TITLE(); $pub_source = DC::SOURCE(); $statement0 = new Statement($publication, RDF::TYPE(), new Literal("")); $statement1 = new Statement($publication, $pub_title, new Literal ($ergebnis[$i]->title)); $statement2 = new Statement($publication, $pub_source, new Literal ($ergebnis[$i]->source)); $model->add($statement0); $model->add($statement1); $model->add($statement2); I cannot find any mistake in my code, please help me. -- Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer |
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 > |
From: Richard C. <ri...@cy...> - 2006-07-07 11:58:16
|
On 7 Jul 2006, at 11:21, Michael Mainik wrote: > Hi, > tank your for the quick reply. I've already tried it this way but I =20= > get > <ns1:Publication>......</ns1:Publication> instead of the =20 > rdf:Description-tag(ns1=3D"http://swrc.ontoware.org/ontology") and =20 > the rdf:type-tag is still missing. This: <ns1:Publication> ... </ns1:Publication> is exactly the same as this: <rdf:Description> <rdf:type rdf:resource=3D"http://...Publication" /> .... </rdf:Description> The first is just a short form for the second. Both encode exactly =20 the same triples. (You can use tools like the RDF validator [1] to show the triples =20 encoded in an RDF/XML file. You shouldn't worry about how exactly the =20= RDF/XML looks. The triples is all that matters, and the many =20 different ways of writing down the same set of triples as RDF/XML are =20= all equivalent.) Best, Richard [1] http://www.w3.org/RDF/Validator/ > > Best regards, > Michael > -------- Original-Nachricht -------- > Datum: Thu, 6 Jul 2006 22:44:12 +0200 > Von: Richard Cyganiak <ri...@cy...> > An: Michael Mainik <za...@gm...> > Betreff: Re: [Rdfapi-php-interest] rdf:type > >> Hi Michael, >> >> On 6 Jul 2006, at 22:25, Michael Mainik wrote: >>> Im trying to implement a php-script which generates RDF-Files with >>> data form a local database containing infromation about >>> 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/ >>> ontology#Publication"/> >>> </rdf:type> >>> <dc:creator>Me</dc:creator> >>> <dc:title rdf:datatype=3D"http://www.w3.org/2001/ >>> XMLSchema#string">A multi-agent platform for a corporate semantic >>> web.</dc:title> >>> <dc:description rdf:datatype=3D"http://www.w3.org/2001/ >>> XMLSchema#string">We describe the technical choices and the design >>> of a multi-agents\nsoftware architecture to manage a corporate >>> memory in the form\nof a corporate semantic web. We then present >>> our approach to\ntackle a distributed memory and distributed >>> queries.</dc:description> >>> </rdf:Description> >>> but when I try to add the rdf:type-tag to my model, I get the >>> following error message: >>> Fatal error: Call to undefined method Literal::getURI() in /var/www/ >>> rdfapi-php/api/util/RdfUtil.php on line 63 >>> >>> My php-code looks like this: >>> $publication =3D new Resource('http://l3s.de/publication/'.$ergebnis >>> [$i]->dblp_key); >>> $pub_title =3D DC::TITLE(); >>> $pub_source =3D DC::SOURCE(); >>> =09 >>> =09 >>> $statement0 =3D new Statement($publication, = RDF::TYPE(), new >>> Literal("")); >> >> I guess here's the problem. The object (third element) of an rdf:type >> statement must be a resource, that is, an URI or a blank node. A >> literal will not work. (And especially not an empty literal!) You >> could try something like this: >> >> $model->add(new Statement($pub, RDF::TYPE(), >> new Resource("http://swrc.ontoware.org/ >> ontology#Publication"))); >> >> Best, >> Richard >> >> >> >>> $statement1 =3D new Statement($publication, = $pub_title, new >>> Literal ($ergebnis[$i]->title)); >>> $statement2 =3D new Statement($publication, = $pub_source, new >>> 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, >>> security? >>> Get stuff done quickly with pre-integrated technology to make your >>> job easier >>> Download IBM WebSphere Application Server v.1.0.1 based on Apache >>> Geronimo >>> http://sel.as-us.falkag.net/sel? >>> cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D121642 >>> _______________________________________________ >>> Rdfapi-php-interest mailing list >>> Rdf...@li... >>> https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest >>> > > --=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 > |