Talk:Semantic MathML

From semanticweb.org.edu
Jump to: navigation, search

looking at version 0.2 I have 2 questions:

1. The set of statements C = A*(B+2) = D - C; B=5; D=7. It seems not to be consistent as if p = q = r then p = r, so we are saying C = D - C regardless of what A and B are in the intermediate expression. So D must equal 0 but then we have D = 7. Unless we are saying these are assignments as in a programming language and D now has a new value, not simultaneous equations. In that case then we should distingush ":=" and "=". Happy if this could be clarified.


Answer: D must not be equal to zero, instead it says that D is two times C:
C=D-C -> C+C=D -> 2*C=D -> C=D/2
MovGP0 17:57, 23 May 2006 (CEST)


2. "the Transformation (y=x+z) = (y-x=z)... can't get represented directly as plain math formula" but if we include logic then it can, i.e. (y=x+z) -> (y-x=z) which is really a shorthand for the steps

y=x+z
-> y+(-x)=x+z+(-x)
-> y-x=x-x+z
-> y-x=0+z
-> y-x=z

Using the axioms in the top of the article. So I think we need to include implication/production rules to really capture the knowledge and manipulate expressions. Need to distingush between equality and inference. That's not to say we can't use graphs to represent it, but we should include more operations and represent the variable environment, not just expressions. Then at any stage it could be converted to RDF or MathML, but perhaps the canonical representation could be something compact like Scheme Programming Language. So the rule above could be stored as

(-> (= y (+ x z)) (= (- y x) z))

This could also be used to generate the graphs themselves as svg, other s-expressions that make the nodes and edges more explicit, or GraphXML.

I'm not familar with Scheme Programming Language, but it seems to be a hybrid of CAML and Lisp. Anyway, the rule (y=x+z) -> (y-x=z) should not stored in that form. Instead it might better to write more general transformation rules like:
Expression Example
(+(x)(-x)) <-> (0) x+(-x) <-> 0
(+(x)) <-> (-(-x)) x <-> -(-x)
(=(+)(+(x))) <-> (=(+(-(x)))(+)) z=x+y <-> z+(-x)=y
(=(+)(+)) <-> (=(-(x))(-(x))) z=x <-> z+(-x)=x+(-x))
(=(*)(*(x))) <-> (=(*(/(1)(x))(*)) z=x*y <-> z*1/x=y
(=) <-> (=(*)) (x=y)<->(x=y*1)
(=) <-> (=(+)) (x=y)<->(x=y+0)
and the like, where () are representing Nodes.
Note: Representing the two-dimensional nets in my Head as one-dimensional string is not pretty; I hope you understand what I mean. If not I might draw some more GraphXML graph.css ;-)
MovGP0 17:57, 23 May 2006 (CEST)

The whole thing might get expressed as something like:

...

<sm:symmetricTransformation>
<sm:Pattern>
   <sm:Equal>
      <sm:Expression />
      <sm:Variable rdf:ID="&ns;x1" />
   </sm:Equal>
</sm:Pattern>
<sm:Pattern>
   <sm:Equal>
      <sm:Add>
         <sm:Expression />
         <sm:Negate>
            <sm:Variable rdf:resource="&ns;x1" />
         </sm:Negate>
      <sm:Add>
   </sm:Equal>
</sm:Pattern>
</sm:symmetricTransformation>

<sm:symmetricTransformation>
<sm:Pattern>
   <sm:Equal />
</sm:Pattern>
<sm:Pattern>
   <sm:Equal>
      <sm:Times />
   </sm:Equal>
</sm:Pattern>
</sm:symmetricTransformation>

<sm:symmetricTransformation>
<sm:Pattern>
   <sm:Equal />
</sm:Pattern>
<sm:Pattern>
   <sm:Equal>
      <sm:Plus />
   </sm:Equal>
</sm:Pattern>
</sm:symmetricTransformation>

<sm:symmetricTransformation>
<sm:Pattern>
   <sm:Add>
      <sm:Variable rdf:ID="&ns;x2" />
      <sm:Negate><sm:Variable rdf:resource="&ns;x2" /></sm:Negate>
   </sm:Add>
</sm:Pattern>
<sm:Pattern>
   <sm:Null /><!-- Alias for <Number>0</Number> -->
</sm:Pattern>
</sm:symmetricTransformation>

...

Also I would only use the most basic funtions like Add, Negate, Exponent, Natural Log, etc. Other Functions like "1/x" or "Subtract" should get implemented as Transformation:

  • 1/x -> Exp(x,Negate(1))
  • Subtract(x,y) -> Add(x,Negate(y))
  • Sqrt(x) -> Exp(x,Negate(0.5))
  • NRoot(x,n) -> Exp(x,Exp(n,Negate(1)))

MovGP0 18:53, 23 May 2006 (CEST)

Thanks for the reply. Scheme is the evolution of Lisp which was one of the first AI languages (CAML and Eiffel came after). They have the simplest possible syntax, i.e. everything is a list defined by round brackets. They have been used a lot to explore symbolic processing of logic and math. example The Opensource Scheme have C and CGI libraries so it can easily be integrated into other projects. The existing knowledge could be leveraged here so we don't have to re-invent the wheel. But we would need to tailor it for our purpose. For instance to export RDF we could have a function:

(define (mathToRDF exp)
  ;recurse through structure of exp and (display) or (write-file) the rdf tags
  )
(mathToRDF '(* (a b)))

Could also define (mathToMathML) etc but also in the future potentially could be added to the inline queries to actually do the transforms, something like:

<ask>[match-and-replace:(* (+ p q) 1)]</ask>

That could get passed internally to a function:

(define (matchAndReplace exp rules)
  ;call unification functions to match variables in exp against rules,
  ;recurse through exp and replace with the matching
  )

Would return for example (+ p q) since (* x 1) = (x) by the identity axiom Then the wiki is really dealing with the symbolic semant.css of mathemat.css. Again we have to consider impact on performance and scalability but there is a lot of work existing representing expressions and transforms openly available, we should try to re-use it. Note rules in the function above would have to come from lists of axioms and theorems in various pages in the wiki itself. How to do that is part of the challenge.

My Idea is currently basing on the Yttrium-Library of Math.Net. So its not a real Programming Language, but a mathematical Library written in C#. It derives its Ideas from VHDL, so Formulas are represented as Signals (Graphs) and Architectures (Nodes). Formulasolving is based on Routing-Algorithms. I felt that this Representation can work with (an extended) RDF too - therefore I've begun to write v0.2.
Anyway, I have to learn more about this Project - at least till I can define custom Transformations by my own and understand how they are working in Math.Net. -- MovGP0 13:12, 24 May 2006 (CEST)
Math.net looks interesting. There are also some other online opensource math efforts such as TPTP maybe these can be linked to here one day, would save a lot of typing ;-) I guess that is the primary benefit of RDF, to share fundamental structure of the data even if the original formats on each side of the transmission are different. In their case they already define many axioms and theorems from several branches of math, only thing they are in Conjunctive Normal Form which transforms everything including implication into just AND, OR and NOT statements which to me loses the real essence of the expression. But it is also for efficiency reasons, and there are transforms to and from this format too. From a semantic wiki point of view though I don't think it needs a full computer algebra system to be embedded. Just the ability to match patterns, let the many users define the simple rules one at a time like you started doing, distributed over several pages so it can be organised. For instance separate articles Logic, Algebra,Calculus,Geometry etc. Then we can see what happens if you match a problem expression instance to these available rules, and Graph (Nodes and Edges), Graph (Chart), xml and other views can be derived from these rules in general. Or instances of particular expressions like Force = Mass * Acceleration. It could not automatically find whole solutions but ability to do resolution queries could help users quickly search through and record possible next steps at each stage. Collaboratively if each person helped expand the search space over time, real solutions could be found for complex problems.

Might be used to illustrate existing examples, maybe even discover solutions for unsolved problems. RuleML could also be used if Scheme is too foreign for here. MathML is more for just drawing the expressions. That is important too but RuleML also includes the ability to query them, implements the real semant.css.


As a detailed example of automatically generating Semantic MathML from list representation here is the following Scheme program. The tests are at the bottom, it is tailored for the lambda example but generalizes it so expressions with "-" and "cos" work as well:

(define (printnl x)
  (display x)(newline))

(define (spaces n)
  (if (> n 0)
    (begin
    (display " ")
    (spaces (- n 1)) )))

(define (scmToSemanticMathML exp) 
  (scmToSemMathML exp 0)
  (newline))
(define (scmToSemMathML exp indent) ;handle indentation
  (cond 
    ((symbol? exp) 
          (spaces indent)(display "<variable rdf:resource=\"")
          (display exp)(printnl "\" />"))
    ((number? exp) 
          (spaces indent)(display "<number>")
          (display exp)(printnl "</number>") )
    ((eq? (car exp) 'fun) 
          (spaces indent)(display "<define rdf:ID=\"")
          (display (cadr exp))(printnl "\" rdf:type=\"function\">")
          (scmToSemMathML (caddr exp) (+ indent 2))
          (spaces indent)(printnl "</define>") )
    ((eq? (car exp) 'lambda) 
          (spaces indent)(printnl "<parameters>")
          (spaces (+ indent 2))(display "<variable rdf:ID=\"")(display (cadr exp))(printnl "\"/>")
          (spaces indent)(printnl "</parameters>") 
          (spaces indent)(printnl "<to>") 
          (scmToSemMathML (caddr exp) (+ indent 2))
          (spaces indent)(printnl "</to>") 
    )
    ((eq? (car exp) 'all) 
          (spaces indent)(printnl "<parameters>")
          (spaces (+ indent 2))(display "<variable rdf:ID=\"")(display (cadr exp))(printnl "\"/>")
          (spaces indent)(printnl "</parameters>") 
          (spaces indent)(printnl "<to>") 
          (scmToSemMathML (caddr exp) (+ indent 2))
          (spaces indent)(printnl "</to>") 
    )
    ((eq? (car exp) 'sin) 
          (spaces indent)(printnl "<function rdf:resource=\"sin\">")
          (scmToSemMathML (cadr exp) (+ indent 2))
          (spaces indent)(printnl "</function>") )
    ((eq? (car exp) 'cos) 
          (spaces indent)(printnl "<function rdf:resource=\"cos\">")
          (scmToSemMathML (cadr exp) (+ indent 2))
          (spaces indent)(printnl "</function>") )
    ((eq? (car exp) '+) 
          (spaces indent)(printnl "<function rdf:resource=\"add\">")
          (scmToSemMathML (cadr exp) (+ indent 2))
          (scmToSemMathML (caddr exp) (+ indent 2))
          (spaces indent)(printnl "</function>") )
    ((eq? (car exp) '-) 
          (spaces indent)(printnl "<function rdf:resource=\"sub\">")
          (scmToSemMathML (cadr exp) (+ indent 2))
          (scmToSemMathML (caddr exp) (+ indent 2))
          (spaces indent)(printnl "</function>") )
    ((eq? (car exp) '*) 
          (spaces indent)(printnl "<function rdf:resource=\"times\">")
          (scmToSemMathML (cadr exp) (+ indent 2))
          (scmToSemMathML (caddr exp) (+ indent 2))
          (spaces indent)(printnl "</function>") )
    ((eq? (car exp) '=) 
          (spaces indent)(printnl "<function rdf:resource=\"equals\">")
          (scmToSemMathML (cadr exp) (+ indent 2))
          (scmToSemMathML (caddr exp) (+ indent 2))
          (spaces indent)(printnl "</function>") )


    (#t (spaces indent)(printnl exp)) ;default - show rest if no condition to handle defined
  ))

(define (test1)
  (scmToSemanticMathML 
    '(fun foo1 (lambda x (sin (+ x 1))) )  ;test expressions fit in one line
  ))
(define (test2)
  (scmToSemanticMathML 
    '(fun foo2 (lambda y (cos (- 2 y))) )  
  ))
(define (test3)
  (scmToSemanticMathML 
    '(fun foo3 (lambda z (cos (- (sin 30) y))) )  
  ))

(test1)
(test2)
(test3)

The output from test3 which is more complex than test1 and test2 is:


<define rdf:ID="foo3" rdf:type="function">
  <parameters>
    <variable rdf:ID="z"/>
  </parameters>
  <to>
    <function rdf:resource="cos">
      <function rdf:resource="sub">
        <function rdf:resource="sin">
          <number>30</number>
        </function>
        <variable rdf:resource="y" />
      </function>
    </function>
  </to>
</define>

The program may look convoluted, would get more so to handle more operators and functions but then it allows users to represent each expression in one line, the scheme code would be hidden from them on the server in the context of a wiki. They would just deal with the input (s-expression) and output (RDF). Same principle could be used to convert to other markups.


Now let's try extend the program above to simulate the query A*1 = A we mentioned before, so if we enter the equivalent of

<ask>meth-replace:(p+q)*1</ask> 

it returns (p+q). As a side effect we will see the system also "knows" the inverse, i.e. (p+q) will return the equivalent of (p+q)*1. It is a trivial step but here we demonstrate not just storing expressions and converting to xml, but actually applying the transformations. Even if it is only one step, with hundreds or thousands of rules, then it becomes not trivial. It also shows another possibility for the Inline Query system here.

We will use our same generic s-expression representation as before, convert to prolog form and evaluate using an Online Prolog Interpreter. We could use an Online Scheme Interpreter to evaluate directly but then we would have to load resolution libraries so for illustration it is easier to convert. It also shows we can translate to other languages from the generic form (scmToProlog), as well as xml. Also RuleML is compatible with this approach. We won't bother convert the result back to scm, but should be obvious. Ideally this would all be automatic within the page, but here we are just exploring ideas, so have to cut and paste. First we add (scmToProlog) using similar logic as (scmToSemanticMathML). Tailored for the example so we omit (cos),(sin) conditions but we could make both converters have identical handlers, or have auxillary functions called by both converters but for illustration purposes:


(define (scmToProlog exp q_or_kb)
  (display "%") ;comment
  (printnl q_or_kb)
  (scmToPro exp)
  (if (string=? q_or_kb "kb")
    (display ".")
  )
  (newline))
(define (scmToPro exp) 
  (cond 
    ((symbol? exp) 
          (display exp))
    ((number? exp) 
          (display exp))
    ((eq? (car exp) 'fun) 
          (display "fun(")
          (display (cadr exp))(display ",")
          (scmToPro (caddr exp))
          (display ")") )
    ((eq? (car exp) '+) 
          (display "plus(")
          (scmToPro (cadr exp))
          (display ",")
          (scmToPro (caddr exp))
          (display ")") )
    ((eq? (car exp) '*) 
          (display "times(")
          (scmToPro (cadr exp))
          (display ",")
          (scmToPro (caddr exp))
          (display ")") )
    ((eq? (car exp) '=) 
          (display "equals(")
          (scmToPro (cadr exp))
          (display ",")
          (scmToPro (caddr exp) )
          (display ")") )

    (#t (display exp)) ;default 
  ))

(define (test4)
  (let ((idenr  '(fun foo4 (= (* A 1) A) ) )
        (idenq  '(fun foo4 (= (* (+ p q) 1) R)) ))
    (scmToSemanticMathML ;see if new expression converts to RDF as in test1-3
      idenr 
    )
    (scmToProlog
      idenq  "query"
    )
    (scmToProlog 
      idenr  "kb"
    )))

(test4)

Using PLT Scheme, (might work also in the online scheme above, but I did not try this) the conversion is:


<define rdf:ID="foo4" rdf:type="function">
  <function rdf:resource="equals">
    <function rdf:resource="times">
      <variable rdf:resource="A" />
      <number>1</number>
    </function>
    <variable rdf:resource="A" />
  </function>
</define>

%query
fun(foo4,equals(times(plus(p,q),1),R))
%kb
fun(foo4,equals(times(A,1),A)).
> 

The xml is just for fun to see if (scmToSemanticMathML) still works on the new expression. The query and kb output in prolog syntax then must be cut and paste into the [Online Prolog Interpreter in the Query and Editing textboxes respectively, then click the submit button. The result should be:

R=plus(p,q). 

If we change the query to fun(foo4,equals(R,plus(p,q)))) and re-submit, we get R=times(plus(p,q),1) from the same rule. In prolog there are usually normal infix operators too but the online versions typically are less functional. But we can get an idea of what it looks like for the system to actively interpret the semantic definition, which we defined again as simple s-expressions (idenr, idenq). So we are not just evaluating arithmetic to numbers, but doing pattern matching, by using opensource interpreters, without embedding a large computer algebra system. All the rules in the main article could be handled the same way. Easily called from PHP, see here for an example, even generates in plain english ;-)

Example[edit]

Can you give an example of how <ask>Force*</ask> (F = d(p)/d(t)) would look? I think Semantic MathML is still a good idea but again should be compatibible with SWiM since it already has many definitions, can leverage work already done. I will try to extend the Scheme converter to produce the OMDoc from my simple s-expression from Force (2) that I can copy and paste to make a page there. But I would like to also generate the Semantic MathML as well for completeness. If you put the example I can follow this. Initially though I will try something simpler, "a+b=b+a" (commutivity). Specifically:

(define (test5)
  (let ((expr5  '(fun commutivity_add (all (a b) (= (+ a b) (+ b a)) ))  ))
    (scmToSemanticMathML 
      expr5 
    )  
    (scmToOmD.css
      expr5
    )
  )
)
(test5)

Already this generates the following for Semantic MathML. It's not complete as I also need guidance with the construct for quantifiers:

<define rdf:ID="commutivity_add" rdf:type="function">
  <parameters>
    <variable rdf:ID="(a b)"/>
  </parameters>
  <to>
    <function rdf:resource="equals">
      <function rdf:resource="add">
        <variable rdf:resource="a" />
        <variable rdf:resource="b" />
      </function>
      <function rdf:resource="add">
        <variable rdf:resource="b" />
        <variable rdf:resource="a" />
      </function>
    </function>
  </to>
</define>

For OMD.css we the aim is to create:

<OMOBJ>
  <OMBIND>
    <OMS cd="quant1" name="forall"/>
      <OMBVAR>
        <OMATTR>
          <OMATP>
            <OMS cd="sts" name="type"/>
            <OMS cd="setname1" name="R"/>
          </OMATP>
          <OMV name="a"/>
        </OMATTR>
        <OMATTR>
        <OMATP>
          <OMS cd="sts" name="type"/>
          <OMS cd="setname1" name="R"/>
         </OMATP>
       <OMV name="b"/>
       </OMATTR>
     </OMBVAR>
     <OMA>
       <OMS cd="relation" name="eq"/>
       <OMA>
         <OMS cd="arith1" name="plus"/>
         <OMV name="a"/>
         <OMV name="b"/>
       </OMA>
       <OMA>
         <OMS cd="arith1" name="plus"/>
         <OMV name="b"/>
         <OMV name="a"/>
       </OMA>
     </OMA>
  </OMBIND>
</OMOBJ>

from (scmToOmD.css).

NB: That's not OMDoc, but OpenMath. OMDoc is OpenMath (or Content MathML, or Semantic MathML, or whatever) wrapped into statements (definition, theorem, proof, example, ...) and theories. --Langec 11:40, 28 June 2006 (CEST)
Yes, and to write a test translator for OMDoc wouldn't you have to first start off with what it contains, i.e. OpenMath? ;-) Anyway I don't intend to write a full translator by any means, just some test code. Thanks for the clarification -- USoy
Yeah, of course you'd write a translator for OpenMath. But OpenMath only supports formulae, not definitions or other statements. OpenMath's content dictionaries are "not semantic enough" for taking them into consideration. See Talk:SWiM. --Langec 16:30, 28 June 2006 (CEST)

There is also free software to generate OMD.css from simpler formats - i.e. QMaths. Still I want to see what happens if we use a similar algorithim to above. Also s-expressions can be for not only maths, can be used temporarily in any domain where there is not yet consensus on syntax or the developers don't have time to implement. For instance chemical formulae: C6H12O6 could be ((C 6) (H 12) (O 6)). See 2


Well, I'm not familar with RuleML or OMDoc, I'm just scratching some Ideas here and hope to get some ideas how tho make it better. The target is to find a semantic way to express (all kind of) mathemat.css. So the scheme will likely change completely if somebody finds a better way to do so.
Expressing the formula F = d(p)/d(t) is by rewriting it into the more proper version F = Δp(t)/Δt, else p would be constant over time and therefore F would be 0. Then we start to make some definitions:
(Force, rdf:type, phys:Force) // create an instance of Force
(Force, rdfs:Label, F) // name the Force "F"

(Time, rdf:type, phys:Time) // create an instance of Time
(Time, rdfs:Label, t) // name the Time "t"

(Pulse, rdf:type, phys:Pulse) // create an instance of Pulse
(Pulse, rdfs:Label, p) // name the Pulse "p"
(Pulse, smath:isFunctionOf, Time) // p(t)
If this is done we can create a formulasystem:
// Δp(t)
(DiffPulse, rdf:type, smath:Diff)
(DiffPulse, smath:hasParameter, Pulse)

// Δt
(DiffTime, rdf:type, smath:Diff)
(DiffTime, smath:hasParameter, Time)

// (Δt)<sup>-1</sup>
(MinusOne, rdf:type, xsd:Integer^^-1)
(InverseDiffTime, rdf:type, smath:Super)
(InverseDiffTime, smath:hasBase, DiffTime)
(InverseDiffTime, smath:hasExponent, MinusOne)

// (Δp(t)) * (Δt)<sup>-1</sup>
(Diff1, rdf:type, smath:Multiplication)
(Diff1, smath:hasParameter, DiffPulse)
(Diff1, smath:hasParameter, InverseDiffTime)

// F = (Δp(t)) * (Δt)<sup>-1</sup>
(Force, smath:eqaulTo, Diff1) // remember that eqaulTo is symmetric
I hope that answeres your Question. The Problem I see here is not how to represent the Formula System, but how we can provide Rules for Transformations like
F=Δp(t)/Δt <-> Δp(t)=FΔt
In Case of the C6H12O6-Glucosesugar-Molecule Structure there is [www.xml-cml.org/ CML]. What you are doing is epressing a Molecule with the Sumformula by counting the parts and representing the result as polynom. But chemical Molecules are more than that, so different chemicals can be have the same count. Instead it might be better do develop also a kind of Semantic CML, where the Molecules are expressed as Nodes and the Bindings as Relation. As Example I take the D(+)Glucose:
     H1-C1-O1
        |
     H2-C2-Ö2-H3
        |
  H4-Ö3-C3-H5
        |
     H6-C4-Ö4-H7
        |
     H8-C5-Ö5-H9
        |
H10+H11-C6-O6-H12

Where Oxygen written as Ö has 4 free Valence-Electrons. Written in an Semantic CML this might look like:

// Define Atoms
(C1, rdf:type, scml:Carbon)
(C2, rdf:type, scml:Carbon)
(C3, rdf:type, scml:Carbon)
(C4, rdf:type, scml:Carbon)
(C5, rdf:type, scml:Carbon)
(C6, rdf:type, scml:Carbon)
(C1, rdfs:label, C)
(C2, rdfs:label, C)
(C3, rdfs:label, C)
(C4, rdfs:label, C)
(C5, rdfs:label, C)
(C6, rdfs:label, C)

(H1, rdf:type, scml:Hydrogen)
(H2, rdf:type, scml:Hydrogen)
(H3, rdf:type, scml:Hydrogen)
(H4, rdf:type, scml:Hydrogen)
(H5, rdf:type, scml:Hydrogen)
(H6, rdf:type, scml:Hydrogen)
(H7, rdf:type, scml:Hydrogen)
(H8, rdf:type, scml:Hydrogen)
(H9, rdf:type, scml:Hydrogen)
(H10, rdf:type, scml:Hydrogen)
(H11, rdf:type, scml:Hydrogen)
(H12, rdf:type, scml:Hydrogen)
(H1, rdfs:label, H)
(H2, rdfs:label, H)
(H3, rdfs:label, H)
(H4, rdfs:label, H)
(H5, rdfs:label, H)
(H6, rdfs:label, H)
(H7, rdfs:label, H)
(H8, rdfs:label, H)
(H9, rdfs:label, H)
(H10, rdfs:label, H)
(H11, rdfs:label, H)
(H12, rdfs:label, H)

(O1, rdf:type, scml:Oxygen)
(O2, rdf:type, scml:Oxygen)
(O3, rdf:type, scml:Oxygen)
(O4, rdf:type, scml:Oxygen)
(O5, rdf:type, scml:Oxygen)
(O6, rdf:type, scml:Oxygen)
(O1, rdfs:label, O)
(O2, rdfs:label, O)
(O3, rdfs:label, O)
(O4, rdfs:label, O)
(O5, rdfs:label, O)
(O6, rdfs:label, O)

// Connect the Molecules

//HCO
(H1, scml:covalentBond, C1)
(C1, scml:covalentBond, O1)

//HCOH
(H2, scml:covalentBond, C2)
(C2, scml:covalentBond, O2)
(O2, scml:covalentBond, H3)

//HCOH
(H4, scml:covalentBond, O3)
(O3, scml:covalentBond, C3)
(C3, scml:covalentBond, H5)

//HCOH
(H6, scml:covalentBond, C4)
(C4, scml:covalentBond, O4)
(O4, scml:covalentBond, H7)

//HCOH
(H8, scml:covalentBond, C5)
(C5, scml:covalentBond, O5)
(O5, scml:covalentBond, H9)

//H2COH
(H10, scml:covalentBond, C6)
(H11, scml:covalentBond, C6)
(C6, scml:covalentBond, O6)
(O6, scml:covalentBond, H12)

// connect Carbones
(C1, scml:covalentBond, C2)
(C2, scml:covalentBond, C3)
(C3, scml:covalentBond, C4)
(C4, scml:covalentBond, C5)
(C5, scml:covalentBond, C6)
Also you need to represent different states and transformation of this molecule, because giving this Molecule into Water it will build a Carbon-Ring. The resulting Molecule is named the β-D-Clucose (see Wikipedia for details).
-- MovGP0 20:56, 27 June 2006 (CEST)


Thanks. I guess there are a couple distinctions. You are right, defining force might be better using delta but as a notation we do need to represent both difference and differential equations so I still have a question how you would represent d(p)/d(t) (differential of impulse with respect to time). Also it seems the triple representation you are using is N3, is this correct?
That brings us to the other distinction that is even though this is more compact than pure RDF, it is still too long to enter as an attribute within a Semantic Wiki. You till need several lines to express one equation. So yes we can come up with short forms to create things like rules I guess my point is first everyone has to agree what the micro-synax should be, then the developers need time to create parsers and integrate it with the wiki. My suggestion is we can start right away using s-expressions (as a plain string attribute for each equation) in the wiki to focus on the semant.css, without getting stuck with what the micro-syntax should be as these already fit in one line. Then we can define a mapping to N3, RDF and/or domain-specific XML like MathML, CML, RuleML etc which already have well defined syntax. My other question then is, could we not write XSLT to transform the XSD schema definition which already exists for domain specific XML to the RDF form (what is that called - RDF Schema?) For instance MathML XSD and CML XSD.
Yes CML is good for us to use for Chemistry, BSML for biology etc but there we also need a micro-syntax shorter than N3 for entering formulas and be able to use them in queries in the wiki. Anyway continuing my test mapping to OMDoc for Swim which I think is good as it is a unique wiki that obviously a lot of work has gone into and this is the format it uses. We could also use XSLT to transform it's XML export to Semantic RDF automatically. My scheme code just shows a one way to represent some of the mappings. For this code see Talk:SWiM -- USoy

Jupp - N3 - thats correct. Even I've not checked for standards compatibility.
I think what you want to use are different kind of deltas for "Difference" Δ, "Differenzial" δ, and the "partial Differenzial" ∂. Right? They might get represented by different kind of Relations. For simplicity in the Semantic MathML Lite Version there might be only support for Difference, while the others can get defined within more complex schemes.
I would express the above example using a Syntax like
[[ {C1}{C2}{C3}{C4}{C5}{C6} :: rdf:type :: scml:Carbon ]]
and
[[{H1}{O1} :: scml:covalentBond :: C1]]
or equally
[[H1 :: scml:covalentBond :: C1 :: scml:covalentBond :: O1]]
which is quite complex to write too. I think such complex semant.css should get defined externally using a easy-to-use tool like protégé or SWOOP and a plugin/program which exports (and imports) Wikisyntax-triples.
Anyway, I don't think that such Triples will make there Way into Semantic MediaWiki, because the users would be able to make statements about an article anywhere they want, which might be hard to manage. Maybe we might to see the C1-Atom as Part of the Article Sugar, so a Statement like
[[C1::rdf:type :: scml:Carbon ]]
within the Article Sugar will map to
[[Sugar#C1::rdf:type::scml:Carbon]]
so that it keeps to be a local definition.
-- MovGP0 01:44, 29 June 2006 (CEST)
Thanks, I think you some have very good ideas. For some examples of work already done going from XSD to RDF using XSLT you can look at 1 maybe it can help us speed up the process. -- USoy

MathML in RDF made simpler[edit]

You don't seem to take into account "Strict Content MathML 3" at all in your conversion algorithm. I would recommend something like this instead. Andrew Robbins 173.79.52.2 04:07, 9 June 2009 (UTC)

Note that the proposal on this page is much older than Strict Content MathML 3. Looking at the page history, this proposal for "Semantic MathML" can be considered dead. --Christoph Lange 10:02, 9 June 2009 (UTC)