Changes between Version 39 and Version 40 of DASISH/XSD and XML


Ignore:
Timestamp:
04/29/13 11:34:48 (11 years ago)
Author:
olhsha
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DASISH/XSD and XML

    v39 v40  
    3030There is a number of auxiliary types as well. A commonly-used one is ResourceREF which contains the attribute "ref" of type {{{xs:anyURI}}}. It allows to have announce elements-references and avoid mixing-them-up with elements-resources, without adding REF to the name. For instance {{{<owner ref="http:/dasish.eu/users/UIDefef"  />}}}.
    3131
    32 === Handling new (not yet in the DB sources) ===
     32=== Handling new (not yet in the DB) sources ===
    3333
    3434Adding annotation with the target sources which are not yet in DB needs special treatment. It becomes clear when the POST body for a new annotation must be serialized. Two approaches seem to be plausible.
     
    4242See [source:DASISH/t5.6/docs/XMLandXSD/DASISH-schema-alternative.xsd DASISH-alternative-xsd].
    4343
    44 Olha: personally I'm pro first "strongly-typed" version, because the second schema allows to validate sence-less xmls.
     44Olha: personally I'm pro first "strongly-typed" version, because the second schema allows to validate senseless xmls. However, the serializations compliant with the weakly-typed schema look better because they have 1 level of elements less.
    4545
    4646
     
    101101== Responding GET api/annotations/AIDzzz (example of resolvable target sources) ==
    102102
     103The serialization compliant with the strongly-typed schema:
     104
    103105{{{#!xml
    104106?xml version="1.0" encoding="UTF-8"?>
     
    140142}}}
    141143
    142 
     144The serialization compliant with the weakly-typed schema:
     145
     146{{{#!xml
     147<?xml version="1.0" encoding="UTF-8"?>
     148<annotation xmlns="http://www.dasish.eu/ns/addit"
     149    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     150    xsi:schemaLocation="http://www.dasish.eu/ns/addit http://dasish.eu/DASISH-schema.xsd"
     151    URI="http://dasish/annotations/AIDzzz" timeStamp="2013-05-04T18:13:51.0Z">
     152    <owner ref="http://dasish.eu/users/UIde1fe1f"/>
     153    <headline>Nativity Facade</headline>
     154    <body type="relation">
     155        <relation>different</relation>
     156        <this ref="http://dasish.eu/sources/SIDaacc"/>
     157        <that ref="http://dasish.eu/sources/SIDaaaa"/>
     158    </body>
     159    <targetSources>
     160        <targetSource ref="http://dasish.eu/sources/SIDaacc">
     161                <link>http://en.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia#Nativity_Fa.C3.A7ade</link>
     162                <version>20.04.2013</version>
     163        </targetSource>
     164        <targetSource ref="http://dasish.eu/sources/SIDaaaa">
     165                <link>http://en.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia#Passion_Fa.C3.A7ade</link>
     166                <version>20.04.2013</version>
     167        </targetSource>
     168    </targetSources>
     169    <readers>
     170        <reader ref="http://dasish.eu/users/UIde1fe1f"/>
     171        <reader ref="http://dasish.eu/users/UIdefef"/>
     172        <reader ref="http://dasish.eu/users/UIdefff"/>
     173    </readers>
     174    <writers>
     175        <writer ref="http://dasish.eu/users/UIde1fe1f"/>
     176        <writer ref="http://dasish.eu/users/UIdefef"/>
     177    </writers>
     178</annotation>
     179}}}
    143180
    144181== Responding GET api/annotations/AIDzyy (example usage for unresolvable target sources) ==
    145182
    146183The respond for an annotation with unresolved target sources and the respond for an annotation with resolved target sources (see above) are both instances of the same schema element.  However, the annotation refers to an obsolete version of the page. Later, having the target source references, the client will ask for the cached representations of the obsolete web-page.
     184
     185The serialization compliant with the strongly-typed schema:
    147186
    148187{{{#!xml
     
    185224}}}
    186225
     226The serialization compliant with the weakly-typed schema:
     227
     228{{{#!xml
     229<?xml version="1.0" encoding="UTF-8"?>
     230<annotation xmlns="http://www.dasish.eu/ns/addit"
     231    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     232    xsi:schemaLocation="http://www.dasish.eu/ns/addit http://dasish.eu/DASISH-schema.xsd"
     233    URI="http://dasish/annotations/AIDzyy"
     234    timeStamp="2013-05-04T18:13:51.0Z">
     235    <owner ref="http://dasish.eu/users/UIde1fe1f"/>
     236    <headline>Nativity Facade (old page)</headline>
     237    <body type="relation">
     238        <relation>different</relation>
     239        <this ref="http://dasish.eu/sources/SIDbbbb"/>
     240        <that ref="http://dasish.eu/sources/SIDrrrr"/>
     241    </body>
     242    <targetSources>
     243        <targetSource ref="http://dasish.eu/sources/SIDbbb">
     244                <link>http://en.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia#Nativity_Fa.C3.A7ade</link>
     245                <version>29.01.2010</version>
     246        </targetSource>
     247        <targetSource ref="http://dasish.eu/sources/SIDrrrr">
     248                <link>http://en.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia#Passion_Fa.C3.A7ade</link>
     249                <version>29.01.2010</version>
     250        </targetSource>
     251    </targetSources>
     252    <readers>
     253        <reader ref="http://dasish.eu/users/UIde1fe1f"/>
     254        <reader ref="http://dasish.eu/users/UIdefef"/>
     255        <reader ref="http://dasish.eu/users/UIdefff"/>
     256    </readers>
     257    <writers>
     258        <writer ref="http://dasish.eu/users/UIde1fe1f"/>
     259        <writer ref="http://dasish.eu/users/UIdefef"/>
     260    </writers>
     261</annotation>
     262}}}
    187263
    188264== Responding GET api/sources/SIDbbb (example usage for unresolvable target sources) ==
     
    237313'''TODO''': Action element is removed, instead note that we have to think about a solution, probably using an envelope with annotation result and set of action requests
    238314
     315The serialization compliant with the strongly-typed schema:
     316
    239317{{{#!xml
    240318<?xml version="1.0" encoding="UTF-8"?>
     
    274352}}}
    275353
     354The serialization compliant with the weakly-typed schema:
     355
     356{{{#!xml
     357<?xml version="1.0" encoding="UTF-8"?>
     358<annotation xmlns="http://www.dasish.eu/ns/addit"
     359 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     360 xsi:schemaLocation="http://www.dasish.eu/ns/addit http://dasish.eu/DASISH-schema.xsd"
     361 URI="tempAIDgfgf"
     362 timeStamp="2013-05-29T18:13:51.0Z">
     363    <owner ref="http://dasish.eu/users/UIde1fe1f"/>
     364    <headline>Comapring English and Catalan Wiki</headline>
     365    <body type="relation">
     366        <relation>History</relation>
     367        <english ref="http://dasish.eu/sources/SIDaaabbb"/>
     368        <catalan ref="tmpSIDefef"/> 
     369    </body>
     370    <targetSources>
     371        <targetSource ref="http://dasish.eu/sources/SIDaaabbb">
     372            <link>http://en.wikipedia.org/wiki/Sagrada_Fam%C3%ADlia#History</link>
     373            <version>20.04.2012</version>
     374        </targetSource>   
     375        <targetSource xml:id="tmpSIDefef">
     376                <link>http://ca.wikipedia.org/wiki/Temple_Expiatori_de_la_Sagrada_Fam%C3%ADlia#Hist.C3.B2tia</link>
     377                <version>20.04.2013</version>
     378        </targetSource>
     379    </targetSources>
     380    <readers>
     381        <reader ref="http://dasish.eu/users/UIde1fe1f"/>
     382    </readers>
     383    <writers>
     384        <writer ref="http://dasish.eu/users/UIde1fe1f"/>
     385    </writers>
     386</annotation>
     387}}}
     388
    276389'''TODO''': POST response