Setting optional space in a semantic record

Is there anyway to allow the use of optional space   or another HTML character to be used in semantic notation? The problem I am facing is that the symbol ; processed by software as end of record.

For example: Let's say I have a marriage record that shows the names of two people who got married, the year of their marriage, and the country in which they were married.

[[has marriage::Jones & Smith; 1990; United States]] [[has marriage::Jones & Smith; 1990; United States]] it seems easy, it should work. The problem is that & is encoded as & . Then the software sees ; , and I get a record that looks like this: Jones & Smith; 1990 Jones & Smith; 1990 Jones & Smith; 1990 because ; at the end & considered as the end of one part of the record. Does anyone know about this?

+7
source share
3 answers

Did you try to format the link as follows?

 [[has marriage::Jones %26 Smith; 1990; United States]] 
0
source

My next attempt: # urlencode :

 [[has marriage::{{#urlencode:Jones & Smith}}; 1990; United States]] 
0
source

I was not able to reproduce your problem on MW 1.25 + SMW 2.3, maybe the simplest answer is to simply update my installation.

However, I believe that you are mistakenly trying to store multiple values ​​in one property, instead you should use another function to store this type of record. Semantic Mediawiki has a so-called subobject for storing a 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 request this data as follows:

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

And the template has something like this:

 Record info: * Name 1: {{{?Name1}}} * Name 2: {{{?Name2}}} * Year: {{{?Year}}} * Location: {{{?Location}}} 
0
source

All Articles