From: Richard C. <ri...@cy...> - 2005-09-20 18:22:30
|
Hi Saf, Sorry for the long delay. On 16 Sep 2005, at 13:10, Saf Hulou wrote: > The last point - rap won't let me create a reified statement from a > uri is precisely my problem. Ah, I see. It's a RAP limitation. > It seems that I will have to create the blank node and create a label > for the blank node, as you suggest. This is a bit wierd though. > How do I pass a blank node id or a model to a reify function? When you pass a blank node, then that blank node will simply be used as the subject of the four reification statements. To create a blank node, do "$blank = new BlankNode($model)". What happens when you pass a model is this: RAP creates a new blank node, which becomes the representation of the reified statement. The model is needed only because of the way RAP creates blank nodes. RAP uses the model to make sure that the blank node is unique (within that model). Don't you have a model anyway where your statements are stored? You just can use that model as the argument to $statement->reify. You don't have to create a new model. > Isn't it a bit meaningless to create a blank node or model before I've > reified the statement? Are they simply placeholders? As I said, you don't have to create the blank node yourself. The reify method can create it for you. However, you have to pass in some model because RAP needs one to create unique blank nodes. Don't pass a new model every time, but re-use the model you're working with anyway. > I think I'm misunderstanding something here.... Sorry about that. RAP's reification support is a bit strange and doesn't seem to be used very much. I think what you probably want to do is this: $new_blank_node = $model->reify_statement($statement) This would create a new blank node and it would add the four reification statements to $model. In RAP you have to do this to get the same effect: $new_blank_node = new BlankNode($model) $reification_quad = $statement->reify($new_blank_node) $model->addModel($reification_quad) (But this doesn't work currently because of a bug, I'll send a separate mail about that.) Hope that helps. Richard > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download > it for free - -and be entered to win a 42" plasma tv or your very own > Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Rdfapi-php-interest mailing list > Rdf...@li... > https://lists.sourceforge.net/lists/listinfo/rdfapi-php-interest > > |