On Freitag, 14. Dezember 2007, Thomas Bleher wrote:
> * Markus Krötzsch <[EMAIL PROTECTED]> [2007-12-12 21:07]:
> > On Sonntag, 2. Dezember 2007, Thomas Bleher wrote:
> > >  67         foreach($properties as $singleprop) {
> > >  68                 $dv =
> > > SMWFactbox::addProperty($singleprop,$value,$valueCaption); 69         }
> > >
> > > $dv is overwritten here on each iteration of the loop. This looks
> > > fishy.
> >
> > Yes, but normally there is only one iteration anyway. What would you
> > suggest instead?
>
> Hmm, should nested properties be allowed here?
>
> FWIW, the regexp is
> $semanticLinkPattern = '/\[\[               # Beginning of the link
>                         (([^:][^]]*):[=:])+ # Property name (can be
> nested?) (                   # After that:
>                           (?:[^|\[\]]       #   either normal text (without
> |, [ or ])
>
>                           |\[\[[^]]*\]\]    #   or a [[link]]
>                           |\[[^]]*\]        #   or an [external link]
>
>                         )*)                 # all this zero or more times
>                         (\|([^]]*))?        # Display text (like "text" in
> [[link|text]]), optional \]\]                # End of link
>                         /x';
>
> (I took the liberty of modifying it to make it more readable)
>
>
>
> If nested properties should not be supported, all is fine, as $property
> is just ([^:][^]]*), ie without the trailing :: or :=. Then the
> preg_split and the for loop can be removed (OK, maybe the regexp could
> be made more strict, but that's another issue).
>
> If nested properties should be supported, this code is buggy, but I do
> not know what the correct semantics would be anyway.

There are no "nested properties", and indeed I do not see what this should be 
either. What there is are (a) multiple properties per value, and (b) nested 
links in values. So you can write

[[property1::property2::Some [[strange]] text]]

and it will have the same semantic effect as 

[[property1::Some [[strange]] text]]
[[property2::Some [[strange]] text]]

while relieving you from repeating the value. Many use cases for that can now 
be addressed with property hierarchies as well, but sometimes it may still be 
useful (e.g. when annotating an email address as both URL and string).

The above works, so there should be no bug here.

Regards,

Markus


-- 
Markus Krötzsch
Institut AIFB, Universät Karlsruhe (TH), 76128 Karlsruhe
phone +49 (0)721 608 7362        fax +49 (0)721 608 5998
[EMAIL PROTECTED]        www  http://korrekt.org

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to