W3C home > Mailing lists > Public > www-math@w3.org > April 2011

Re: cs String Literal

From: Christoph Lange <ch.lange@jacobs-university.de>
Date: Mon, 25 Apr 2011 21:05:34 +0200
Message-ID: <4DB5C5FE.20508@jacobs-university.de>
To: Fraser Goffin <goffinf@gmail.com>
CC: www-math@w3.org
Hi Fraser,

Am 4/22/2011 5:33 PM, schrieb Fraser Goffin:
 > I am considering using MathML v3 to represent conditional logic within
 > another XML vocabulary.

I don't know what conditional logic is, so some of what I say below 
might be wrong.

 > I can see that there is a<condition>  element
 > and a set of useful operators which can be used with an<apply>.

I'm not sure whether such a use of <condition>, which seems rather ad 
hoc to me, is consistent with the MathML specification.  <condition> is 
meant to restrict the values of bound variables.  (@All: the spec says 
that that is the "primary" use of <condition>.  What else?)

 > However, not all my conditions relate to numeric values, some are
 > dates and others just string comparisons.

For fully understanding these conditions it would be helpful if you 
could provide some information on the context in which you intend to use 
them.

 > I noted that there is a<cs>
 > element which looks like it can be used to contain string literals,
 > but when I attempt to use it, it will not validate against the mathml3
 > XSD.

Without having any idea about that, I'd assume that that is a bug in the 
XSD.

 > I want to do something like this, can anyone suggest a way this can be
 > acheived :-
 >
 > <condition>
 >      <apply>
 >          <eq/>
 >          <ci>PolicyNumber</ci>
 >          <cs>abc123</cs>
 >      </apply>
 > </condition>
 >
 > or ...
 >
 > <condition>
 >      <apply>
 >          <geq/>
 >          <ci>PolicyEffectiveDate</ci>
 >          <cs>2011-01-01</cs>
 >      </apply>
 > </condition>
 >
 > I am happy to write my own parser for this, but I want to create a
 > valid fragment according to the MathML schema rather than something
 > which is not.

Concerning the _data_model_ you are probably having in mind, this rather 
looks to me like RDF than MathML.  RDF also has an XML encoding, if XML 
is important to you.  In the Turtle text-based serialization of RDF, 
which is easier to write down here, the data above could be modeled as 
follows:

@prefix ex: <http://example.org> .  # some namespace URI for your custom 
policy-related vocabulary
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .

_:policy    # some local identifier for your policy; assuming that both 
conditions belong to the same policy
   ex:PolicyNumber "abc123"^^xsd:Name ;   # in case you need this 
datatype here
   ex:PolicyEffectiveDate "2011-01-01"^^xsd:date .

The nice thing about RDF is that it has datatype support, and that most 
RDF-based tools have built-in support for the XML Schema datatypes.

I can also provide the XML serialization of the same if you are interested.

Note that with some trickery RDF can also be encoded in MathML.  That is 
a non-standard way but it works.  That might be relevant if MathML 
really matters to you.  The datatypes of strings would then be encoded 
via semantic attributions around the <cs>.  Let me know if I should tell 
you more.

Cheers,

Christoph

-- 
Christoph Lange, Coordinator CASE Research Center
http://www.jacobs-university.de/case/, http://kwarc.info/clange

Mathematical Wiki workshop at ITP 2011, August 27, Nijmegen, Netherlands
Submission deadline May 30, http://www.cs.ru.nl/mwitp/

Jacobs University Bremen gGmbH, Campus Ring 1, 28759 Bremen, Germany
Commercial registry: Amtsgericht Bremen, HRB 18117
CEO: Prof. Dr. Joachim Treusch
Chair Board of Governors: Prof. Dr. Karin Lochte
Received on Monday, 25 April 2011 19:06:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 25 April 2011 19:06:11 GMT