Fwd: cs String Literal

Sorry, forgot to include the list on my reply to Christophe

---------- Forwarded message ----------
From: Fraser Goffin <goffinf@gmail.com>
Date: Mon, 25 Apr 2011 22:57:59 +0100
Subject: Re: cs String Literal
To: Christoph Lange <ch.lange@jacobs-university.de>

Hi Christoph

> I don't know what conditional logic is

Oh ok, think if-then-else, or if you prefer, Boolean algebra

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

That possible, although it is difficult to be certain without
understanding the context in which the <cs> element is intended to be
used. It *appeared* to provide the potential for representing
non-numerical values within expressions and that it could be used in
similar situations to <cn>, but that appears not to be the case ?

> That might be relevant if MathML really matters to you

No not especially. I was simply searching for an existing XML
vocabulary that would allow me to express a set of related conditional
logic, before I went off an invented my own. XML is important but only
because I want to embed within another XML vocabulary.

I would be equally happy to use RDF, so I would be interested if you
could show the XML equivalent of the text serialisation you showed in
your reply. I *do* need to be able to create complex conditions using
AND, OR, NOT, etc, and a range of operators such as =, >, <, <=, etc,
so if RDF can do that I'd be happy to take a look at it.

Having strong data typing is also an advantage as you suggested.

I look forward to your further comments/advice.

Regards

Fraser.



On 25/04/2011, Christoph Lange <ch.lange@jacobs-university.de> wrote:
> 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 22:02:58 UTC