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?

Zack
  • 2,377
  • 4
  • 25
  • 51
  • 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 ` `, or even `-20`. – leo Apr 24 '14 at 11:24

3 Answers3

0

Have you tried to format the link like this?

[[has marriage::Jones %26 Smith; 1990; United States]]
phreaknerd
  • 161
  • 4
  • 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! – Zack Apr 10 '13 at 05:45
0

My next try would be the #urlencode function:

[[has marriage::{{#urlencode:Jones & Smith}}; 1990; United States]]
phreaknerd
  • 161
  • 4
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}}}
wakalaka
  • 524
  • 4
  • 12