You can subscribe to this list here.
2005 |
Jan
|
Feb
(16) |
Mar
(6) |
Apr
(38) |
May
(23) |
Jun
(5) |
Jul
(1) |
Aug
|
Sep
(10) |
Oct
(7) |
Nov
(6) |
Dec
(4) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(20) |
Feb
(32) |
Mar
(24) |
Apr
(29) |
May
(5) |
Jun
(10) |
Jul
(12) |
Aug
(7) |
Sep
(1) |
Oct
(2) |
Nov
(27) |
Dec
(4) |
2007 |
Jan
(37) |
Feb
(10) |
Mar
(19) |
Apr
(10) |
May
(10) |
Jun
(7) |
Jul
(19) |
Aug
(29) |
Sep
(5) |
Oct
(17) |
Nov
(14) |
Dec
(2) |
2008 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
(8) |
May
|
Jun
(8) |
Jul
(1) |
Aug
(7) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
|
2009 |
Jan
|
Feb
(1) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
2010 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(2) |
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Shadi Abou-Z. <sh...@ab...> - 2006-03-02 02:29:46
|
Hi Richard, Thanks for the feedback. The character encoding in the document headers a= re fine. After the query, the characters are escaped like this "\u00D0" (= correct Unicode values but escaped instead of the actual characters). Her= e is a more complete example: *** DATA: <http://www.example.org/data.rdf> <?xml version=3D"1.0" encoding=3D"UTF-8"?> <rdf:RDF xmlns:rdf=3D"http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:doc=3D"http://www.example.org/my/schema#" xmlns:dc=3D"http://purl.org/dc/elements/1.1/"> <doc:featureType rdf:ID=3D"lang"> <dc:title rdf:parseType=3D"Literal">Language</dc:title> <dc:description rdf:parseType=3D"Literal">The natural language of the= document.</dc:description> </doc:featureType> <doc:feature rdf:ID=3D"bg"> <dc:title rdf:parseType=3D"Literal">Bulgarian</dc:title> <dc:description rdf:parseType=3D"Literal"><span lang=3D"bg">=C3=90=E2= =80=98=C3=91=C5=A0=C3=90=C2=BB=C3=90=C2=B3=C3=90=C2=B0=C3=91=E2=82=AC=C3=91= =C2=81=C3=90=C2=BA=C3=90=C2=B8</span> (Bulgarian)</dc:description> <doc:isFeatureType rdf:resource=3D"#lang"/> </doc:feature> </rdf:RDF> *** PAGE: <http://www.example.org/data.php> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ww= w.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns=3D"http://www.w3.org/1999/xhtml" xml:lang=3D"en-US" lang=3D"e= n-US"> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8= " /> <title>Document Features</title> </head> <?php /* include libraries */ define("RDFAPI_INCLUDE_DIR", "/usr/local/lib/php/rdfapi-php/api/"); include(RDFAPI_INCLUDE_DIR . "RdfAPI.php"); include(RDFAPI_INCLUDE_DIR . "syntax/RdfParser.php"); $parser =3D new RdfParser(); $DB =3D $parser->generateModel("http://www.example.org/data.rdf"); function getFeatureList($DB) { /* build RDQL query */ $query =3D "SELECT ?id, ?label, ?description WHERE (?id, <doc:isFeatu= reType>, ?type), (?id, <dc:description>, ?description), (?type, <dc:descr= iption>, ?label) USING dc FOR <http://purl.org/dc/elements/1.1/> doc FOR = <http://www.example.org/my/schema#>"; /* send query to database */ $resultSet =3D $DB->rdqlQueryasIterator($query); /* array of results */ $features =3D array(); while($resultSet->hasNext()) { $feature =3D $resultSet->next(); /* build array of results */ $features[] =3D array("id" =3D> $feature["?id"]->getLocalName(), "l= abel" =3D> $feature["?label"]->getLabel(), "description" =3D> $feature["?= description"]->getLabel()); } return $features; } ?> <body> <dl> <?php $type =3D ""; $features =3D getFeatureList($DB); foreach($features as $feature) { if($type !=3D $feature["label"]) { if($type !=3D "") { ?> </ul></dd> <?php } $type =3D $feature["label"]; ?> <dt><?php printf($feature["label"]); ?></dt> <dd><ul> <?php } ?> <li><?php printf($feature["description"]); ?></li> <?php } if($type !=3D "") { ?> </ul></dd> <?php } ?> </dl> </body> </html> Richard Cyganiak wrote: > Hi Shadi, >=20 > On 1 Mar 2006, at 11:25, Shadi Abou-Zahra wrote: >=20 >> Hi, >> >> Does RAP support non-ASCII characters in XML literals and if so, how? >=20 > Yes, RAP can do that. But, as always, getting anything beyond US-ASCII=20 > to work can be a serious pain. >=20 > It's all a question of getting the character encoding right. By default= ,=20 > RAP assumes all data to be UTF-8 encoded. If your data is not UTF-8=20 > encoded, then you either have to convert it to UTF-8 (recommended) or=20 > set DEFAULT_ENCODING in constants.php to the encoding of your data (For= =20 > the cyrillic alphabet, try "iso-8859-5" or "windows-1251"). >=20 > Make sure that all your XML files start with an xml declaration (e.g.=20 > "<?xml version=3D"1.0" encoding=3D"UTF-8"?>", or whatever encoding you'= re=20 > using instead of UTF-8). RAP-generated XML files will have this=20 > automatically. >=20 > If you output HTML, make sure it has this inside the <title> element: > <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8= "> > (or whatever encoding you're using instead of UTF-8). I'm not sure if=20 > all RAP-generated HTML has this. >=20 > RAP can't convert between different encodings, and can't combine RDF=20 > input from different encodings. That's why I always recommend doing=20 > everything in UTF-8. Most other encodings lack some characters that som= e=20 > people will need. >=20 > If this doesn't help, could you please provide a more complete example=20 > of what you're doing and where it doesn't work. >=20 > Yours, > Richard >=20 >=20 >=20 >=20 >> For example, to query and output the following information: >> >> >> <dc:description rdf:parseType=3D"Literal"><span=20 >> lang=3D"bg">=D0=91=D1=8A=D0=BB=D0=B3=D0=B0=D1=80=D1=81=D0=BA=D0=B8</sp= an> (Bulgarian)</dc:description> >> >> >> Note: I've tried setting the "UNIC_RDF" constant to FALSE (in=20 >> api/constants.php) but that did not help. This is what is returned: >> >> >> <span=20 >> lang=3D\\"bg\\">\u00D0\u0091\u00D1\u008A\u00D0\u00BB\u00D0\u00B3\u00D0= \u00B0\u00D1\u0080\u00D1\u0081\u00D0\u00BA\u00D0\u00B8</span>=20 >> (Bulgarian) >> >> >> Thanks, >> Shadi >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by xPML, a groundbreaking scripting=20 >> language >> that extends applications into web and mobile media. Attend the live=20 >> webcast >> and join the prime developer group breaking into this new coding=20 >> territory! >> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=1216= 42 >> _______________________________________________ >> Rdfapi-php-interest mailing list >> Rdf...@li... >> https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest >> >=20 >=20 --=20 Lieber Querschnitt als Durchschnitt=20 - Peter Laisacher, Salzburger Rugby Bulls |
From: Richard C. <ri...@cy...> - 2006-03-02 01:58:35
|
Hi Charles, Apologies, I misread your code. Details below. On 1 Mar 2006, at 23:44, Charles Nepote wrote: > I tried the getOntModelForBaseModel method with a fresh CVS. But I =20 > still have an error... here is my code for tests : > > <?php > > define("RDFAPI_INCLUDE_DIR", "/var/www/wikisem/rdfapi-php/api/"); > include(RDFAPI_INCLUDE_DIR . "RdfAPI.php"); > include("/var/www/wiki-s/config.inc.php"); > > > $wiki =3D new Wiki($config); > > > Class Wiki > { > function Wiki($config) > { > $store =3D ModelFactory::getDbStore( > $config['db_engine'], > $config['db_server'], > $config['db_database'], > $config['db_user'], > $config['db_password']); > $this->dbModel =3D = $store->getModel('http://rn7.net/2006/02/07'); > $this->dbModel->writeAsHtmlTable(); // To verify if the = model is =20 > correctly loaded > $this->ontModel =3D = ModelFactory::getOntModelForBaseModel($this-=20 > >dbModel, RDFS_VOCABULARY); That's OK, but the original version should work now as well: $this->ontModel =3D $this->dbModel->getOntModel(RDFS_VOCABULARY); > =09 > $test =3D new = OntResource("http://www.w3.org/1999/02/22-rdf-syntax-=20 > ns#type"); Here's the problem. You're not supposed to create OntResources =20 directly. Use the $ontModel->createXXX() methods instead. $test =3D $this->ontModel->createOntProperty("http://www.w3.org/=20 1999/02/22-rdf-syntax-ns#type"); > $sup =3D $test->listRDFTypes(); Then you can do: foreach($sup as $type) { echo $type->getURI(); } Output for me is: http://www.w3.org/1999/02/22-rdf-syntax-ns#Property. Sorry again. Richard > } > =09 > } > > ?> > > The model is correctly loaded from the base and a HTML table of 329 =20= > lines is correctly displayed. There are plenty of rdf:type in the =20 > model ; so listRDFTypes should give an answer... Instead I get a : > > Fatal error: Call to a member function on a non-object in /var/www/=20 > wikisem/rdfapi-cvs/rdfapi-php/api/ontModel/OntResource.php on line 402 > > Is my syntax for creating the OntModem correct ? > > Charles N=E9pote. > |
From: Charles N. <cha...@ne...> - 2006-03-01 22:44:09
|
Richard Cyganiak wrote : > Hi all, >=20 > There are two new methods in ModelFactory: > getOntModelForBaseModel($baseModel, $vocabulary) > getResModelForBaseModel($baseModel) >=20 > They create ResModels and OntModels from an already existing model. >=20 > The first one was necessary to make Model::getOntModel work. For =20 > consistency, I also added the second one. >=20 > There are a bunch of new unit tests for this in /test/unit/Model/=20 > Model_tests.php and /test/unit/Model/ModelFactory_tests.php. >=20 > Best, > Richard Hi Richard, I tried the getOntModelForBaseModel method with a fresh CVS. But I still=20 have an error... here is my code for tests : <?php define("RDFAPI_INCLUDE_DIR", "/var/www/wikisem/rdfapi-php/api/"); include(RDFAPI_INCLUDE_DIR . "RdfAPI.php"); include("/var/www/wiki-s/config.inc.php"); $wiki =3D new Wiki($config); Class Wiki { function Wiki($config) { $store =3D ModelFactory::getDbStore( $config['db_engine'], $config['db_server'], $config['db_database'], $config['db_user'], $config['db_password']); $this->dbModel =3D $store->getModel('http://rn7.net/2006/02/07'); $this->dbModel->writeAsHtmlTable(); // To verify if the model is=20 correctly loaded $this->ontModel =3D=20 ModelFactory::getOntModelForBaseModel($this->dbModel, RDFS_VOCABULARY); =09 $test =3D new=20 OntResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); $sup =3D $test->listRDFTypes(); } =09 } ?> The model is correctly loaded from the base and a HTML table of 329=20 lines is correctly displayed. There are plenty of rdf:type in the model=20 ; so listRDFTypes should give an answer... Instead I get a : Fatal error: Call to a member function on a non-object in=20 /var/www/wikisem/rdfapi-cvs/rdfapi-php/api/ontModel/OntResource.php on=20 line 402 Is my syntax for creating the OntModem correct ? Charles N=E9pote. |
From: Richard C. <ri...@cy...> - 2006-03-01 15:59:37
|
Geraint, On 1 Mar 2006, at 13:24, Geraint Edwards wrote: > Richard Cyganiak wrote: >> Oh, OK. Actually, there's a Mozilla bug filed for this: https:// >> bugzilla.mozilla.org/show_bug.cgi?id=106516 . Doesn't seem to get >> much attention. I voted for it. > > Yes - I found that after my message :-( > >> Why don't you take a stab at adding rdf:li support to the >> RdfSerializer? I'm sure that would benefit other folks as well. >> Look at writeDescriptions() and writeGroup() for a place to start. > > Yes - a generic rdf:li serializer should be straightforward. I'd > probably suggest adding a configuration constant to allow the switch? Sounds good to me. > My requirements are a bit more involved than just serialization > since I want Mozilla to pass back to the server information about > changes made to the datasource locally. I therefore need to make > sure that Mozilla is given enough information that it can pass back > to the server and allow me to identify and modify my DBmodel > statements as necessary. That's an interesting scenario. Would it work if you replaced the whole model on the server with the changed version from the Mozilla client? Just for the record, the RAP parser can deal with rdf:li just fine. > I'll certainly pass back to the community what I come up with as a > solution. since RAP seems like the ideal backend to a server based > Mozilla datasource. Let us know how it goes and if we can help. Richard > > Geraint > |
From: Richard C. <ri...@cy...> - 2006-03-01 15:51:50
|
Hi Shadi, On 1 Mar 2006, at 11:25, Shadi Abou-Zahra wrote: > Hi, > > Does RAP support non-ASCII characters in XML literals and if so, how? Yes, RAP can do that. But, as always, getting anything beyond US-=20 ASCII to work can be a serious pain. It's all a question of getting the character encoding right. By =20 default, RAP assumes all data to be UTF-8 encoded. If your data is =20 not UTF-8 encoded, then you either have to convert it to UTF-8 =20 (recommended) or set DEFAULT_ENCODING in constants.php to the =20 encoding of your data (For the cyrillic alphabet, try "iso-8859-5" or =20= "windows-1251"). Make sure that all your XML files start with an xml declaration (e.g. =20= "<?xml version=3D"1.0" encoding=3D"UTF-8"?>", or whatever encoding = you're =20 using instead of UTF-8). RAP-generated XML files will have this =20 automatically. If you output HTML, make sure it has this inside the <title> element: <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8"> (or whatever encoding you're using instead of UTF-8). I'm not sure if =20= all RAP-generated HTML has this. RAP can't convert between different encodings, and can't combine RDF =20 input from different encodings. That's why I always recommend doing =20 everything in UTF-8. Most other encodings lack some characters that =20 some people will need. If this doesn't help, could you please provide a more complete =20 example of what you're doing and where it doesn't work. Yours, Richard > For example, to query and output the following information: > > > <dc:description rdf:parseType=3D"Literal"><span =20 > lang=3D"bg">=D0=91=D1=8A=D0=BB=D0=B3=D0=B0=D1=80=D1=81=D0=BA=D0=B8</span= > (Bulgarian)</dc:description> > > > Note: I've tried setting the "UNIC_RDF" constant to FALSE (in api/=20 > constants.php) but that did not help. This is what is returned: > > > <span lang=3D\\"bg\\">\u00D0\u0091\u00D1\u008A\u00D0\u00BB\u00D0\u00B3=20= > \u00D0\u00B0\u00D1\u0080\u00D1\u0081\u00D0\u00BA\u00D0\u00B8</span> =20= > (Bulgarian) > > > Thanks, > Shadi > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting =20 > language > that extends applications into web and mobile media. Attend the =20 > live webcast > and join the prime developer group breaking into this new coding =20 > territory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=121642= > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > |
From: Geraint E. <rd...@co...> - 2006-03-01 12:24:57
|
Richard Cyganiak wrote: > Oh, OK. Actually, there's a Mozilla bug filed for this: https:// > bugzilla.mozilla.org/show_bug.cgi?id=106516 . Doesn't seem to get > much attention. I voted for it. Yes - I found that after my message :-( > Why don't you take a stab at adding rdf:li support to the > RdfSerializer? I'm sure that would benefit other folks as well. Look > at writeDescriptions() and writeGroup() for a place to start. Yes - a generic rdf:li serializer should be straightforward. I'd probably suggest adding a configuration constant to allow the switch? My requirements are a bit more involved than just serialization since I want Mozilla to pass back to the server information about changes made to the datasource locally. I therefore need to make sure that Mozilla is given enough information that it can pass back to the server and allow me to identify and modify my DBmodel statements as necessary. I'll certainly pass back to the community what I come up with as a solution. since RAP seems like the ideal backend to a server based Mozilla datasource. Geraint |
From: Richard C. <ri...@cy...> - 2006-03-01 11:24:39
|
Hi Geraint, On 1 Mar 2006, at 10:49, Geraint Edwards wrote: >>> I am building a mozilla datasource but am having some >>> difficulties with RDF containers. As far as I can tell Mozilla >>> cannot handle Seq or Bag entries of type RDF:_n , expecting an >>> RDF:li in both cases. >> >> That's weird, because rdf:_n is the basic form, and rdf:li is the >> syntactic sugar. (Does it work when you change the rdf:_n to >> rdf:li manually?) > > Yes - in fact I am moving from long established (working) simple > perl code and local files which present container members as > <RDF:li>. I have also followed an example at xulplanet (see http:// > www.xulplanet.com/tutorials/mozsdk/rdfsyntax.php) written to > demonstrate mozilla/rdf and the rdf:_n syntax gives empty > containers whereas the rdf:li syntax works as expected. Oh, OK. Actually, there's a Mozilla bug filed for this: https:// bugzilla.mozilla.org/show_bug.cgi?id=106516 . Doesn't seem to get much attention. I voted for it. >>> (tracking the order with another attribute possibly?) or does >>> someone have experience in getting gecko/mozilla to recognise >>> RDF:_n nodes within containers? >> > I suspect what I will need to do is to create a new serialization > class extending RdfSerializer and override the > writeContentStatements function (I know its meant to be private but > its better than hacking the core code!) to rewrite the RDF:_n tags > as RDF:_li and adding a custom attribute to pass the order number > to firefox. I can then use this custom attribute to create the > appropriate RDF:_n based modification statements I send back from > the browser to the server. > It should work but is a bit of a pain :-(. Why don't you take a stab at adding rdf:li support to the RdfSerializer? I'm sure that would benefit other folks as well. Look at writeDescriptions() and writeGroup() for a place to start. Best, Richard > > Geraint > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the > live webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > |
From: Shadi Abou-Z. <sh...@ab...> - 2006-03-01 10:25:43
|
Hi, Does RAP support non-ASCII characters in XML literals and if so, how? For= example, to query and output the following information: <dc:description rdf:parseType=3D"Literal"><span lang=3D"bg">=D0=91=D1=8A=D0= =BB=D0=B3=D0=B0=D1=80=D1=81=D0=BA=D0=B8</span> (Bulgarian)</dc:descriptio= n> Note: I've tried setting the "UNIC_RDF" constant to FALSE (in api/constan= ts.php) but that did not help. This is what is returned: <span lang=3D\\"bg\\">\u00D0\u0091\u00D1\u008A\u00D0\u00BB\u00D0\u00B3\u0= 0D0\u00B0\u00D1\u0080\u00D1\u0081\u00D0\u00BA\u00D0\u00B8</span> (Bulgari= an) Thanks, Shadi |
From: Geraint E. <rd...@co...> - 2006-03-01 09:49:16
|
Thanks for the response Richard. Richard Cyganiak wrote: > On 28 Feb 2006, at 12:20, Geraint Edwards wrote: > >> I am building a mozilla datasource but am having some difficulties >> with RDF containers. As far as I can tell Mozilla cannot handle Seq >> or Bag entries of type RDF:_n , expecting an RDF:li in both cases. > > That's weird, because rdf:_n is the basic form, and rdf:li is the > syntactic sugar. (Does it work when you change the rdf:_n to rdf:li > manually?) Yes - in fact I am moving from long established (working) simple perl code and local files which present container members as <RDF:li>. I have also followed an example at xulplanet (see http://www.xulplanet.com/tutorials/mozsdk/rdfsyntax.php) written to demonstrate mozilla/rdf and the rdf:_n syntax gives empty containers whereas the rdf:li syntax works as expected. >> (tracking the order with another attribute possibly?) or does >> someone have experience in getting gecko/mozilla to recognise RDF:_n >> nodes within containers? > I suspect what I will need to do is to create a new serialization class extending RdfSerializer and override the writeContentStatements function (I know its meant to be private but its better than hacking the core code!) to rewrite the RDF:_n tags as RDF:_li and adding a custom attribute to pass the order number to firefox. I can then use this custom attribute to create the appropriate RDF:_n based modification statements I send back from the browser to the server. It should work but is a bit of a pain :-(. Geraint |
From: Richard C. <ri...@cy...> - 2006-03-01 00:59:52
|
Hi Geraint, On 28 Feb 2006, at 12:20, Geraint Edwards wrote: > I am building a mozilla datasource but am having some difficulties > with RDF containers. As far as I can tell Mozilla cannot handle > Seq or Bag entries of type RDF:_n , expecting an RDF:li in both cases. That's weird, because rdf:_n is the basic form, and rdf:li is the syntactic sugar. (Does it work when you change the rdf:_n to rdf:li manually?) > RAP serializes these nodes as RDF:_n in all cases (as far as I can > tell). > > Am I missing something or is there a way to tell RAP to serialize > these nodes as RDF:li Sorry, no, RAP has no support for this at the moment. Richard > (tracking the order with another attribute possibly?) or does > someone have experience in getting gecko/mozilla to recognise > RDF:_n nodes within containers? > > thanks > > Geraint |
From: Richard C. <ri...@cy...> - 2006-03-01 00:10:49
|
Good catch, thanks! Fixed in CVS now. On 28 Feb 2006, at 10:34, Geraint Edwards wrote: > in the function isSeq() the constant RDF_SQE is used instead of > RDF_SEQ. > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the > live webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > |
From: Richard C. <ri...@cy...> - 2006-02-28 23:57:27
|
Fix is in CVS. On 26 Feb 2006, at 22:01, Richard Cyganiak wrote: > Hi, > > The N3 parser has a bug that causes broken triples in cases like this: > > <foo> > :bar "bar"; > :baz "baz"; > . > > The last statement (<foo> :baz "baz") is terminated by a semicolon > *and* a dot. This is legal in N3, and in fact quite common because > that way you can't mix up the end-of-line punctuation. > > RAP's parser doesn't recognize this, sees a third triple with a > null predicate and object, and generates two notices. > > Here's a test case for /test/unit/Syntax/n3Parser_test.php that > catches the bug: > > function testLoneSemicolon() { > $n3 = '<a> <b> <c> ; .'; > $parser = &new N3Parser(); > $model = &$parser->parse2model($n3, false); > $this->assertEqual(1, $model->size()); > $this->assertNoErrors(); > } > > Here's the fix for /api/syntax/N3Parser.php . I've added two lines > to the getPovs method, it's the comment line and the one after. > > function getPovs($list) { > $povs = array(); > while (in_array(';', $list)) { > $r=$this->posns($list,';'); > $pos=array_slice($r,0,2); > $r = $this->getSpan($list, $pos[0], $pos[1]); > $pov=$r[0]; > $list=$r[1]; > > // skip lone semicolons, e.g. "<a> <b> <c> ; ." > if (count($pov) == 1) continue; > > $povs[]=array_slice($pov,1); > } > > Best, > Richard > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the > live webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > |
From: Richard C. <ri...@cy...> - 2006-02-28 23:47:15
|
Hi all, There are two new methods in ModelFactory: getOntModelForBaseModel($baseModel, $vocabulary) getResModelForBaseModel($baseModel) They create ResModels and OntModels from an already existing model. The first one was necessary to make Model::getOntModel work. For consistency, I also added the second one. There are a bunch of new unit tests for this in /test/unit/Model/ Model_tests.php and /test/unit/Model/ModelFactory_tests.php. Best, Richard |
From: Richard C. <ri...@cy...> - 2006-02-28 23:44:37
|
Charles, a fix is in CVS now. (Tobias gave me CVS commit access, =20 yay!) When you update RAP from CVS, your code below will (hopefully!) =20= work. Richard On 28 Feb 2006, at 23:44, Richard Cyganiak wrote: > On 28 Feb 2006, at 23:04, Charles Nepote wrote: >> Ok. I made the fix : >> >> function & getOntModel($vocabulary) { >> require_once( RDFAPI_INCLUDE_DIR . PACKAGE_ONTMODEL); >> return new OntModel(& $this, $vocabulary); >> } >> >> But that doesn't change anything (exactly the same error). > > Sorry, you're right ... I assumed that it was just the simple =20 > spelling error in the method, but the problem is somewhat more =20 > complicated. There's some code missing from the method. I'm working =20= > on a fix. > >> Are you sure my code is correct... I won't bet on it... > > Looks good to me. > >>> or set up the OntModel directly, without using getOntModel. >> >> How ? > > I meant just put the (fixed) two lines of getOntModel into your own =20= > code, but as we know now, that doesn't work. > > Here's another thing you can try: Create the OntModel with =20 > ModelFactory::getOntModel(DBMODEL, RDFS_VOCABULARY) instead of =20 > $dbModel->getOntModel(RDFS_VOCABULARY). You'll have to find out how =20= > to initialise the database connection in constants.php though. > > Richard > > > >> >> Thanks Richard for your help. >> Charles. >> >> >>> Richard >>> On 28 Feb 2006, at 01:08, Charles Nepote wrote: >>>> Hi, >>>> >>>> I'm not very familiar with OOP and I wonder how to use OntModel =20= >>>> methods on a DbModel. I write here an example in order to =20 >>>> precise my context. >>>> >>>> <?php >>>> define("RDFAPI_INCLUDE_DIR", "/var/www/wikisem/rdfapi-php/api/"); >>>> include(RDFAPI_INCLUDE_DIR . "RdfAPI.php"); >>>> include("/var/www/wikisem/config.inc.php"); // Define $config array >>>> >>>> $wiki =3D new Wiki($config); >>>> >>>> Class Wiki >>>> { >>>> function Wiki($config) >>>> { >>>> $store =3D ModelFactory::getDbStore( >>>> $config['db_engine'], >>>> $config['db_server'], >>>> $config['db_database'], >>>> $config['db_user'], >>>> $config['db_password']); >>>> $this->dbModel =3D $store->getModel('http://ex.net/=20 >>>> 2006/02/07'); >>>> $this->ontModel =3D $this->dbModel->getOntModel=20 >>>> (RDFS_VOCABULARY); >>>> $test =3D new OntResource("http://www.w3.org/1999/02/22-=20 >>>> rdf-syntax- ns#type"); >>>> $sup =3D $test->listRDFTypes(); >>>> } >>>> } >>>> ?> >>>> >>>> produce a "Fatal error: Call to a member function on a non-=20 >>>> object in /var/www/wikisem/rdfapi-php093/api/ontModel/=20 >>>> OntResource.php on line 402" >>>> >>>> To test this example, RDF and RDFS have been loaded in the =20 >>>> dbmodel "http://ex.net/2006/02/07". >>>> >>>> Thanks in advance, >>>> Charles N=E9pote >> >> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting =20 > language > that extends applications into web and mobile media. Attend the =20 > live webcast > and join the prime developer group breaking into this new coding =20 > territory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=121642= > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > |
From: Richard C. <ri...@cy...> - 2006-02-28 22:44:58
|
On 28 Feb 2006, at 23:04, Charles Nepote wrote: > Ok. I made the fix : > > function & getOntModel($vocabulary) { > require_once( RDFAPI_INCLUDE_DIR . PACKAGE_ONTMODEL); > return new OntModel(& $this, $vocabulary); > } > > But that doesn't change anything (exactly the same error). Sorry, you're right ... I assumed that it was just the simple =20 spelling error in the method, but the problem is somewhat more =20 complicated. There's some code missing from the method. I'm working =20 on a fix. > Are you sure my code is correct... I won't bet on it... Looks good to me. >> or set up the OntModel directly, without using getOntModel. > > How ? I meant just put the (fixed) two lines of getOntModel into your own =20 code, but as we know now, that doesn't work. Here's another thing you can try: Create the OntModel with =20 ModelFactory::getOntModel(DBMODEL, RDFS_VOCABULARY) instead of =20 $dbModel->getOntModel(RDFS_VOCABULARY). You'll have to find out how =20 to initialise the database connection in constants.php though. Richard > > Thanks Richard for your help. > Charles. > > >> Richard >> On 28 Feb 2006, at 01:08, Charles Nepote wrote: >>> Hi, >>> >>> I'm not very familiar with OOP and I wonder how to use OntModel =20 >>> methods on a DbModel. I write here an example in order to =20 >>> precise my context. >>> >>> <?php >>> define("RDFAPI_INCLUDE_DIR", "/var/www/wikisem/rdfapi-php/api/"); >>> include(RDFAPI_INCLUDE_DIR . "RdfAPI.php"); >>> include("/var/www/wikisem/config.inc.php"); // Define $config array >>> >>> $wiki =3D new Wiki($config); >>> >>> Class Wiki >>> { >>> function Wiki($config) >>> { >>> $store =3D ModelFactory::getDbStore( >>> $config['db_engine'], >>> $config['db_server'], >>> $config['db_database'], >>> $config['db_user'], >>> $config['db_password']); >>> $this->dbModel =3D $store->getModel('http://ex.net/=20 >>> 2006/02/07'); >>> $this->ontModel =3D $this->dbModel->getOntModel=20 >>> (RDFS_VOCABULARY); >>> $test =3D new OntResource("http://www.w3.org/1999/02/22-rdf-=20= >>> syntax- ns#type"); >>> $sup =3D $test->listRDFTypes(); >>> } >>> } >>> ?> >>> >>> produce a "Fatal error: Call to a member function on a non-=20 >>> object in /var/www/wikisem/rdfapi-php093/api/ontModel/=20 >>> OntResource.php on line 402" >>> >>> To test this example, RDF and RDFS have been loaded in the =20 >>> dbmodel "http://ex.net/2006/02/07". >>> >>> Thanks in advance, >>> Charles N=E9pote > > |
From: Charles N. <cha...@ne...> - 2006-02-28 22:04:03
|
Richard Cyganiak wrote : > Hi Charles, >=20 > This seems to be caused by a bug in RAP. Here's a snippet from model/=20 > Model.php: >=20 > function & getOntModel($vocabulary) { > require_once( RDFAPI_INCLUDE_DIR . PACKAGE_ONTMODEL); > return new OntModel(& $this, $vocab); > } >=20 > The problem is $vocabulary/$vocab, the fix should be obvious. >=20 > You could fix it in your own copy of RAP, Ok. I made the fix : function & getOntModel($vocabulary) { require_once( RDFAPI_INCLUDE_DIR . PACKAGE_ONTMODEL); return new OntModel(& $this, $vocabulary); } But that doesn't change anything (exactly the same error). Are you sure=20 my code is correct... I won't bet on it... > or set up the OntModel =20 > directly, without using getOntModel. How ? Thanks Richard for your help. Charles. > Richard >=20 >=20 > On 28 Feb 2006, at 01:08, Charles Nepote wrote: >=20 >> Hi, >> >> I'm not very familiar with OOP and I wonder how to use OntModel =20 >> methods on a DbModel. I write here an example in order to precise my=20 >> context. >> >> <?php >> define("RDFAPI_INCLUDE_DIR", "/var/www/wikisem/rdfapi-php/api/"); >> include(RDFAPI_INCLUDE_DIR . "RdfAPI.php"); >> include("/var/www/wikisem/config.inc.php"); // Define $config array >> >> $wiki =3D new Wiki($config); >> >> Class Wiki >> { >> function Wiki($config) >> { >> $store =3D ModelFactory::getDbStore( >> $config['db_engine'], >> $config['db_server'], >> $config['db_database'], >> $config['db_user'], >> $config['db_password']); >> $this->dbModel =3D $store->getModel('http://ex.net/2006/02/07'= ); >> $this->ontModel =3D $this->dbModel->getOntModel(RDFS_VOCABULAR= Y); >> $test =3D new=20 >> OntResource("http://www.w3.org/1999/02/22-rdf-syntax- ns#type"); >> $sup =3D $test->listRDFTypes(); >> } >> =20 >> } >> ?> >> >> produce a "Fatal error: Call to a member function on a non-object in=20 >> /var/www/wikisem/rdfapi-php093/api/ontModel/OntResource.php on line 4= 02" >> >> To test this example, RDF and RDFS have been loaded in the dbmodel =20 >> "http://ex.net/2006/02/07". >> >> Thanks in advance, >> Charles N=E9pote |
From: Geraint E. <rd...@co...> - 2006-02-28 11:20:34
|
I am building a mozilla datasource but am having some difficulties with RDF containers. As far as I can tell Mozilla cannot handle Seq or Bag entries of type RDF:_/n/ , expecting an RDF:li in both cases. RAP serializes these nodes as RDF:_/n/ in all cases (as far as I can tell). Am I missing something or is there a way to tell RAP to serialize these nodes as RDF:li (tracking the order with another attribute possibly?) or does someone have experience in getting gecko/mozilla to recognise RDF:_/n/ nodes within containers? thanks Geraint |
From: Geraint E. <rd...@co...> - 2006-02-28 09:34:50
|
in the function isSeq() the constant RDF_SQE is used instead of RDF_SEQ. |
From: Richard C. <ri...@cy...> - 2006-02-28 08:26:51
|
Hi Charles, This seems to be caused by a bug in RAP. Here's a snippet from model/=20 Model.php: function & getOntModel($vocabulary) { require_once( RDFAPI_INCLUDE_DIR . PACKAGE_ONTMODEL); return new OntModel(& $this, $vocab); } The problem is $vocabulary/$vocab, the fix should be obvious. You could fix it in your own copy of RAP, or set up the OntModel =20 directly, without using getOntModel. Richard On 28 Feb 2006, at 01:08, Charles Nepote wrote: > Hi, > > I'm not very familiar with OOP and I wonder how to use OntModel =20 > methods on a DbModel. I write here an example in order to precise =20 > my context. > > <?php > define("RDFAPI_INCLUDE_DIR", "/var/www/wikisem/rdfapi-php/api/"); > include(RDFAPI_INCLUDE_DIR . "RdfAPI.php"); > include("/var/www/wikisem/config.inc.php"); // Define $config array > > $wiki =3D new Wiki($config); > > Class Wiki > { > function Wiki($config) > { > $store =3D ModelFactory::getDbStore( > $config['db_engine'], > $config['db_server'], > $config['db_database'], > $config['db_user'], > $config['db_password']); > $this->dbModel =3D = $store->getModel('http://ex.net/2006/02/07'); > $this->ontModel =3D = $this->dbModel->getOntModel(RDFS_VOCABULARY); > $test =3D new = OntResource("http://www.w3.org/1999/02/22-rdf-syntax-=20 > ns#type"); > $sup =3D $test->listRDFTypes(); > } > =09 > } > ?> > > produce a "Fatal error: Call to a member function on a non-object =20 > in /var/www/wikisem/rdfapi-php093/api/ontModel/OntResource.php on =20 > line 402" > > To test this example, RDF and RDFS have been loaded in the dbmodel =20 > "http://ex.net/2006/02/07". > > Thanks in advance, > Charles N=E9pote > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting =20 > language > that extends applications into web and mobile media. Attend the =20 > live webcast > and join the prime developer group breaking into this new coding =20 > territory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid$1720&dat=121642= > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > |
From: Charles N. <cha...@ne...> - 2006-02-28 00:07:53
|
Hi, I'm not very familiar with OOP and I wonder how to use OntModel methods=20 on a DbModel. I write here an example in order to precise my context. <?php define("RDFAPI_INCLUDE_DIR", "/var/www/wikisem/rdfapi-php/api/"); include(RDFAPI_INCLUDE_DIR . "RdfAPI.php"); include("/var/www/wikisem/config.inc.php"); // Define $config array $wiki =3D new Wiki($config); Class Wiki { function Wiki($config) { $store =3D ModelFactory::getDbStore( $config['db_engine'], $config['db_server'], $config['db_database'], $config['db_user'], $config['db_password']); $this->dbModel =3D $store->getModel('http://ex.net/2006/02/07'); $this->ontModel =3D $this->dbModel->getOntModel(RDFS_VOCABULARY); $test =3D new=20 OntResource("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); $sup =3D $test->listRDFTypes(); } =09 } ?> produce a "Fatal error: Call to a member function on a non-object in=20 /var/www/wikisem/rdfapi-php093/api/ontModel/OntResource.php on line 402" To test this example, RDF and RDFS have been loaded in the dbmodel=20 "http://ex.net/2006/02/07". Thanks in advance, Charles N=E9pote |
From: Geraint E. <rd...@co...> - 2006-02-27 11:05:08
|
I have answered part of my question. I switched to PHP4 and mysql (instead of mysqli) and the close statements are not necessay. This appears therefore to be a problem with adodb for msqli since the docs for adodb claims that "close" statements are managed for you. The close statements to no harm and allow PHP5.1.2 to work so it may be worth adding them to the dbmodel api code. Geraint |
From: Geraint E. <rd...@co...> - 2006-02-27 10:49:49
|
I am new to RAP (I'm looking at it to develop a Firefox/RDF based application and am looking for a good way to keep my server datasources in sync)- it looks neat so far :-) but I've come across a couple of problems. 1. Running through the Test:Manipulate DbModel I figured out that I had to call getNewModel if the model didn't exist. A note to this effect or adding ti to the source code would be handy. 2. I encountered adodb errors in 2 places where the mysql commands were out of sync (I'm using MySQL 4.1.14 and PHP 5.1.2). I upgraded the adodb drivers to the latest versions but that was no help. To fix the problem I had to modify two functions in DbStore and DbModel by adding a $res->close() statement. My modified code is : function modelExists($modelURI) { $res =& $this->dbConn->execute("SELECT COUNT(*) FROM models WHERE modelURI = '" .$modelURI ."'"); if (!$res) echo $this->dbConn->errorMsg(); else { $res->close(); if (!$res->fields[0]) return FALSE; return TRUE; } } function contains(&$statement) { $sql = 'SELECT modelID FROM statements WHERE modelID = ' .$this->modelID; $sql .= $this->_createDynSqlPart_SPO($statement->subj, $statement->pred, $statement->obj); $res =& $this->dbConn->getOne($sql); if (!$res) return FALSE; $res->close(); return TRUE; } I don't have any other Databases to test this on. Is this a specific bug to the mysqli driver? Geraint |
From: Richard C. <ri...@cy...> - 2006-02-26 21:01:19
|
Hi, The N3 parser has a bug that causes broken triples in cases like this: <foo> :bar "bar"; :baz "baz"; . The last statement (<foo> :baz "baz") is terminated by a semicolon *and* a dot. This is legal in N3, and in fact quite common because that way you can't mix up the end-of-line punctuation. RAP's parser doesn't recognize this, sees a third triple with a null predicate and object, and generates two notices. Here's a test case for /test/unit/Syntax/n3Parser_test.php that catches the bug: function testLoneSemicolon() { $n3 = '<a> <b> <c> ; .'; $parser = &new N3Parser(); $model = &$parser->parse2model($n3, false); $this->assertEqual(1, $model->size()); $this->assertNoErrors(); } Here's the fix for /api/syntax/N3Parser.php . I've added two lines to the getPovs method, it's the comment line and the one after. function getPovs($list) { $povs = array(); while (in_array(';', $list)) { $r=$this->posns($list,';'); $pos=array_slice($r,0,2); $r = $this->getSpan($list, $pos[0], $pos[1]); $pov=$r[0]; $list=$r[1]; // skip lone semicolons, e.g. "<a> <b> <c> ; ." if (count($pov) == 1) continue; $povs[]=array_slice($pov,1); } Best, Richard |
From: <jsp...@gm...> - 2006-02-23 17:18:06
|
Hi, I am not sure how exactly the OntModel works but be aware! FOAF and relationship module are not ontologies but "plain" RDF Schemas. While I was playing with Java tool Jastor for generating model from ontologies I was faced with this problem and got into trouble. Josef Petr=E1k On 2/23/06, Alexandre Passant <al...@pa...> wrote: > Hi, > > I used RAP to write a FOAF parser [1], in which I use MemModel to read > my RDF files. > > I recently thaught about FOAF extensions, as the Relationship > vocabulary [2], which defines some subproperties of foaf:knows. > > At the moment, with my MemModel, I use > findFirstMatchingStatement($subject, FOAF::KNOWS, $null) to get all > foaf:knows classes related to my subject. > > But, I assume, it won't work if the RDF files that use rel:worksWith > instead of foaf:knows. > > Is that the role of OntModel to make this kind of queries work ? If > so, should I have to write somewhere (in vocabulary folder) the > Relationship model and its mapping with FOAF ? > > Thanx for any advice on this point. > > [1] http://gna.org/projects/phoaf > [2] http://vocab.org/relationship/ > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge > that extends applications into web and mobile media. Attend the live webc= ast > and join the prime developer group breaking into this new coding territor= y! > http://sel.as-us.falkag.net/sel?cmdlnk&kid=110944&bid$1720&dat=121642 > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > -- *** jspetrak (HW) *** Weblog: http://zapisky.info/ Homepage: http://zapisky.info/home/ ICQ: 179271149 Jabber: Imp...@nj... |
From: Alexandre P. <al...@pa...> - 2006-02-23 17:12:56
|
Hi, I used RAP to write a FOAF parser [1], in which I use MemModel to read my RDF files. I recently thaught about FOAF extensions, as the Relationship vocabulary [2], which defines some subproperties of foaf:knows. At the moment, with my MemModel, I use findFirstMatchingStatement($subject, FOAF::KNOWS, $null) to get all foaf:knows classes related to my subject. But, I assume, it won't work if the RDF files that use rel:worksWith instead of foaf:knows. Is that the role of OntModel to make this kind of queries work ? If so, should I have to write somewhere (in vocabulary folder) the Relationship model and its mapping with FOAF ? Thanx for any advice on this point. [1] http://gna.org/projects/phoaf [2] http://vocab.org/relationship/ |