From: Seaborne, A. <and...@hp...> - 2005-06-03 16:03:07
|
-------- Original Message -------- > From: Rod Petrovic <> > Date: 3 June 2005 00:37 >=20 > Hi all, >=20 > I am using an RDQL query to return all instances of a class, with > corresponding property values.=20 >=20 > Example: >=20 > --- >=20 > SELECT * >=20 > WHERE (?x,<tst:clientName>,?a) > (?x,<tst:clientEmail>,?b) > (?x,<tst:clientTelephone>,?c) > (?x,<rdf:type>,<tst:Client>) >=20 > USING tst for <http://sw.intera.si/testont#> > rdf for > <http://www.w3.org/1999/02/22-rdf-syntax-ns#> >=20 > --- >=20 > Now, the problem occurs when some instances don't have some property > value defined. Only instances that have all three property values > defined will be returned. =20 >=20 > Is it possible to return all instances of a class and (e.g.) get null > values for property values they don't have defined?=20 RDQL is an exact match so, in one query, you can't. If you have no control over the data, you'll need to issue several queries for each of the parts that may or may not be present. (off topic alert!) This was one of the first requirements for SPARQL - the RDF query language being worked on in a W3C working group. There is the OPTIONAL operator: Something like: PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX tst: <http://sw.intera.si/testont#> SELECT * {=20 ?x rdf:type tst:Client=20 OPTIONAL { ?x tst:clientName ?a } OPTIONAL { ?x tst:clientEmail ?b } OPTIONAL { ?x tst:clientTelephone ?c } } If any of the properties are required by your data model, then drop the "optional". Andy >=20 > I guess you could say that I'm looking for an RDQL query that does the > same as "SELECT * FROM table" in SQL.=20 >=20 > Thank you for your time. >=20 > ---------- > Rod Petrovic >=20 > ro...@ro... > www.rodpetrovic.com > +381 65 317 317 3 >=20 >=20 >=20 > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.322 / Virus Database: 267.4.1 - Release Date: 2.6.2005 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Yahoo. > Introducing Yahoo! Search Developer Network - Create apps using Yahoo! > Search APIs Find out how you can build Yahoo! directly into your own > Applications - visit > http://developer.yahoo.net/?fr=3Doffad-ysdn-ostg-q22005 > _______________________________________________=20 > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest |