Setting a non-binding space in a semantic record
Asked Answered
M

3

8

Is there anyway to allow for a non-binding space   or other HTML encoded character to be used in a semantic record? The issue I am running into is that the ; character gets treated by the software as the end of a record.

For example: Say I have a marriage record that is set up to have the last names of 2 people who got married, the year of their marriage and the country they were married in.

[[has marriage::Jones & Smith; 1990; United States]] seems light it should work. The problem is that the & gets encoded as &. Then the software sees the ; and I end up with a record that looks like: Jones & Smith; 1990 because the ; at the end of & is treated as the end of one part of the record. Anyone know any way around this?

Mitchell answered 29/3, 2013 at 21:8 Comment(1)
I'm guessing, as I don't use the record type myself (I can't see why I shouldn't use the much more powerful sobobject type instead), but I would try <nowiki> </nowiki>, or even -20.Am‚lie
K
0

Have you tried to format the link like this?

[[has marriage::Jones %26 Smith; 1990; United States]]
Kaltman answered 9/4, 2013 at 15:32 Comment(1)
You know, I hadn't. That was a really good thought. Unfortunately, it doesn't work. The record just becomes blank. :-( Thanks for the idea though!Mitchell
K
0

My next try would be the #urlencode function:

[[has marriage::{{#urlencode:Jones & Smith}}; 1990; United States]]
Kaltman answered 30/4, 2013 at 9:23 Comment(0)
C
0

I was unable to reproduce your issue on MW 1.25 + SMW 2.3, maybe easiest answer is to just upgrade your installation.

However, I think that you wrongly trying to store multiple values in single property, instead you should use another feature to store this record type. Semantic Mediawiki has so-called "subobject" entity to store set of properties related to each other in one place.

{{#subobject:
 |Page=Title of page this object linked to
 |Name1=John
 |Name2=Smith
 |Year=1990
 |Location=United States
}}

And then you can simply query this data like that:

{{#ask: [[Page::{{PAGENAME}}]] 
|?Name1 |?Name2 |?Year |?Location
|format=template 
|template=Item template
|named args=yes
}}

And have template something like that:

Record info: 
 * Name 1: {{{?Name1}}}
 * Name 2: {{{?Name2}}}
 * Year: {{{?Year}}}
 * Location: {{{?Location}}}
Cover answered 5/7, 2016 at 20:2 Comment(1)
Oh, I've missed it somehow :)Cover

© 2022 - 2024 — McMap. All rights reserved.