--- a/fig-alt-update-list.svg Fri Nov 21 12:58:43 2014 +0100
+++ b/fig-alt-update-list.svg Fri Nov 21 18:05:00 2014 +0100
@@ -11,8 +11,8 @@
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="744.09448"
- height="318.89764"
- viewBox="0 0 595.1271 255.11809"
+ height="212.59842"
+ viewBox="0 0 595.1271 170.07872"
id="svg2"
inkscape:version="0.48.5 r10040"
sodipodi:docname="fig-alt-update-list.svg">
@@ -29,13 +29,13 @@
inkscape:window-height="1014"
id="namedview4507"
showgrid="true"
- inkscape:zoom="1.2809932"
- inkscape:cx="586.98866"
- inkscape:cy="158.315"
+ inkscape:zoom="2.5619864"
+ inkscape:cx="246.35543"
+ inkscape:cy="150.18899"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
- inkscape:current-layer="node19"
+ inkscape:current-layer="svg2"
units="cm">
<inkscape:grid
type="xygrid"
@@ -106,16 +106,16 @@
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.80000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7);display:inline"
id="path3287-6"
- d="m 255.04387,85.039391 28.30571,-10e-5" />
+ d="m 255.08461,85.03946 28.30571,-1e-4" />
<g
id="node3"
- transform="translate(-135.09096,258.34629)">
+ transform="translate(-135.05022,258.34636)">
<title
id="title24">dolor</title>
<polygon
style="fill:#ffffff;stroke:#000000;stroke-width:1"
id="polygon26"
- points="475.287,-212 475.287,-248 475.287,-248 418.287,-248 418.287,-212 " />
+ points="475.287,-248 475.287,-248 418.287,-248 418.287,-212 475.287,-212 " />
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text28"
@@ -124,13 +124,13 @@
</g>
<g
id="node4"
- transform="translate(-185.2466,247.34629)">
+ transform="translate(-185.20586,247.34636)">
<title
id="title31">sit</title>
<polygon
style="fill:#ffffff;stroke:#000000;stroke-width:1"
id="polygon33"
- points="608.982,-201 608.982,-237 608.982,-237 554.982,-237 554.982,-201 " />
+ points="608.982,-237 608.982,-237 554.982,-237 554.982,-201 608.982,-201 " />
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text35"
@@ -139,7 +139,7 @@
</g>
<g
id="node9"
- transform="matrix(0.92651521,0,0,1,25.227731,292.03929)">
+ transform="matrix(0.92651521,0,0,1,25.268474,292.03936)">
<title
id="title93">ln2</title>
<ellipse
@@ -157,7 +157,7 @@
</g>
<g
id="node10"
- transform="matrix(0.98784308,0,0,1,-44.620034,261.03929)">
+ transform="matrix(0.98784308,0,0,1,-44.579291,261.03936)">
<title
id="title118">ln3</title>
<ellipse
@@ -175,13 +175,13 @@
</g>
<g
id="node1"
- transform="translate(-28.024684,320.34629)">
+ transform="translate(-27.983941,320.34636)">
<title
id="title10">lorem</title>
<polygon
style="fill:#ffffff;stroke:#000000;stroke-width:1"
id="polygon12"
- points="200.142,-310 139.142,-310 139.142,-274 200.142,-274 200.142,-310 " />
+ points="139.142,-310 139.142,-274 200.142,-274 200.142,-310 200.142,-310 " />
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text14"
@@ -190,13 +190,13 @@
</g>
<g
id="node2"
- transform="translate(-82.532324,289.34629)">
+ transform="translate(-82.491581,289.34636)">
<title
id="title17">ipsum</title>
<polygon
style="fill:#ffffff;stroke:#000000;stroke-width:1"
id="polygon19"
- points="340.189,-243 340.189,-279 340.189,-279 278.189,-279 278.189,-243 " />
+ points="340.189,-279 340.189,-279 278.189,-279 278.189,-243 340.189,-243 " />
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text21"
@@ -205,13 +205,13 @@
</g>
<g
id="node5"
- transform="translate(-235.40123,212.34629)">
+ transform="translate(-235.36049,212.34636)">
<title
id="title38">amet</title>
<polygon
style="fill:#ffffff;stroke:#000000;stroke-width:1"
id="polygon40"
- points="745.176,-166 745.176,-202 745.176,-202 689.176,-202 689.176,-166 " />
+ points="745.176,-202 745.176,-202 689.176,-202 689.176,-166 745.176,-166 " />
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text42"
@@ -220,7 +220,7 @@
</g>
<g
id="node7"
- transform="matrix(0.92651518,0,0,1,113.31478,354.03929)">
+ transform="matrix(0.92651518,0,0,1,113.35552,354.03936)">
<title
id="title52">ln0</title>
<ellipse
@@ -238,7 +238,7 @@
</g>
<g
id="node8"
- transform="matrix(0.92651519,0,0,1,69.480788,323.03929)">
+ transform="matrix(0.92651519,0,0,1,69.521531,323.03936)">
<title
id="title68">ln1</title>
<ellipse
@@ -256,7 +256,7 @@
</g>
<g
id="node11"
- transform="matrix(0.99392154,0,0,1,-96.49525,250.03929)">
+ transform="matrix(0.99392154,0,0,1,-96.454507,250.03936)">
<title
id="title143">ln4</title>
<ellipse
@@ -274,7 +274,7 @@
</g>
<g
id="node13"
- transform="translate(-330.30631,216.73219)">
+ transform="translate(-330.26557,216.73226)">
<title
id="title193">nil</title>
<ellipse
@@ -295,188 +295,54 @@
y="-71.300003"
x="868.77399">rdf:nil</text>
</g>
- <g
- id="node14"
- transform="translate(-312.80564,323.59829)">
- <title
- id="title209">foo</title>
- <polygon
- style="fill:#ffffff;stroke:#000000;stroke-width:1"
- id="polygon211"
- points="608.982,-129 554.982,-129 554.982,-93 608.982,-93 608.982,-129 " />
- <text
- style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
- id="text213"
- y="-107.3"
- x="581.98199">"foo"</text>
- </g>
- <g
- id="node15"
- transform="translate(-362.96028,285.59829)">
- <title
- id="title216">bar</title>
- <polygon
- style="fill:#ffffff;stroke:#000000;stroke-width:1"
- id="polygon218"
- points="744.176,-91 690.176,-91 690.176,-55 744.176,-55 744.176,-91 " />
- <text
- style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
- id="text220"
- y="-69.300003"
- x="717.17603">"bar"</text>
- </g>
- <g
- id="node16"
- transform="translate(-429.51892,230.59829)">
- <title
- id="title223">baz</title>
- <polygon
- style="fill:#ffffff;stroke:#000000;stroke-width:1"
- id="polygon225"
- points="895.774,-36 841.774,-36 841.774,0 895.774,0 895.774,-36 " />
- <text
- style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
- id="text227"
- y="-14.3"
- x="868.77399">"baz"</text>
- </g>
- <g
- id="node17"
- transform="translate(-177.61063,254.90539)">
- <title
- id="title230">un0</title>
- <ellipse
- sodipodi:ry="18"
- sodipodi:rx="27"
- sodipodi:cy="-99"
- sodipodi:cx="446.78699"
- d="m 473.78699,-99 c 0,9.941125 -12.08831,18 -27,18 -14.91169,0 -27,-8.058875 -27,-18 0,-9.94113 12.08831,-18 27,-18 14.91169,0 27,8.05887 27,18 z"
- style="fill:#ffffff;stroke:#000000;stroke-width:1"
- id="ellipse232"
- ry="18"
- rx="27"
- cy="-99"
- cx="446.78699" />
- </g>
- <g
- id="node18"
- transform="translate(-227.76627,212.90539)">
- <title
- id="title246">un1</title>
- <ellipse
- sodipodi:ry="18"
- sodipodi:rx="27"
- sodipodi:cy="-57"
- sodipodi:cx="581.98199"
- d="m 608.98199,-57 c 0,9.941125 -12.08831,18 -27,18 -14.91168,0 -27,-8.058875 -27,-18 0,-9.941125 12.08832,-18 27,-18 14.91169,0 27,8.058875 27,18 z"
- style="fill:#ffffff;stroke:#000000;stroke-width:1"
- id="ellipse248"
- ry="18"
- rx="27"
- cy="-57"
- cx="581.98199" />
- </g>
- <g
- id="node19"
- transform="translate(-277.92094,174.90539)">
- <title
- id="title271">un2</title>
- <ellipse
- sodipodi:ry="18"
- sodipodi:rx="27"
- sodipodi:cy="-19"
- sodipodi:cx="717.17603"
- d="m 744.17603,-19 c 0,9.9411255 -12.08832,18 -27,18 -14.91169,0 -27,-8.0588745 -27,-18 0,-9.941125 12.08831,-18 27,-18 14.91168,0 27,8.058875 27,18 z"
- style="fill:#ffffff;stroke:#000000;stroke-width:1"
- id="ellipse273"
- ry="18"
- rx="27"
- cy="-19"
- cx="717.17603" />
- </g>
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
id="path5081"
- d="m 169.96377,85.039291 28.34645,0" />
+ d="m 170.00451,85.03936 28.34645,0" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
id="path5083"
- d="m 340.04249,85.039291 28.34646,0" />
+ d="m 340.08323,85.03936 28.34646,0" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
id="path5085"
- d="m 425.08185,85.039291 28.3872,10e-5" />
+ d="m 425.12259,85.03936 28.3872,1e-4" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
id="path5089"
- d="m 497.13962,100.27659 25.61669,25.6957" />
- <path
- inkscape:connector-curvature="0"
- style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
- id="path5091"
- d="m 296.17636,155.90539 31.03936,0" />
- <path
- inkscape:connector-curvature="0"
- style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- id="path5093"
- d="m 354.21572,155.90539 0,0" />
- <path
- inkscape:connector-curvature="0"
- style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
- id="path5095"
- d="m 381.21572,155.90539 31.03937,0" />
- <path
- inkscape:connector-curvature="0"
- style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
- id="path5097"
- d="m 465.6612,152.13309 41.33415,-5.9049" />
- <path
- inkscape:connector-curvature="0"
- style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
- id="path5099"
- d="m 269.17636,173.90539 0,20.6929" />
- <path
- inkscape:connector-curvature="0"
- style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
- id="path5101"
- d="m 354.21572,173.90539 0,20.6929" />
- <path
- inkscape:connector-curvature="0"
- style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
- id="path5103"
- d="m 439.25508,173.90539 0,20.6929" />
+ d="m 497.18036,100.27666 25.61669,25.6957" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
id="path5105"
- d="m 141.61732,67.039291 0,-20.693" />
+ d="m 141.65806,67.03936 0,-20.693" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
id="path5107"
- d="m 226.65668,67.039291 0,-20.693" />
+ d="m 226.69742,67.03936 0,-20.693" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
id="path5109"
- d="m 311.69604,67.039291 0,-20.693" />
+ d="m 311.73678,67.03936 0,-20.693" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
id="path5111"
- d="m 396.7354,67.039291 0,-20.693" />
+ d="m 396.77614,67.03936 0,-20.693" />
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-mid:none;marker-end:url(#Arrow1Mend-7)"
id="path5113"
- d="m 481.89381,67.039291 -0.0637,-20.693" />
+ d="m 481.93455,67.03936 -0.0637,-20.693" />
<g
id="g5115"
- transform="translate(11.857427,354.03929)">
+ transform="translate(11.89817,354.03936)">
<title
id="title5117">ln0</title>
<ellipse
@@ -497,29 +363,27 @@
y="-265.29999"
x="30.5473">
<tspan
- style="font-style:italic"
- id="tspan5125">s</tspan>
+ id="tspan5125">:s</tspan>
</text>
</g>
<path
inkscape:connector-curvature="0"
style="fill:none;stroke:#000000;stroke-width:0.79999989px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)"
id="path5123"
- d="m 72.999427,85.039291 40.271433,0" />
+ d="m 73.04017,85.03936 40.27143,0" />
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text5121-3"
- y="77.952164"
- x="92.011009">
+ y="77.952225"
+ x="92.05175">
<tspan
- style="font-style:italic"
- id="tspan5125-6">p</tspan>
+ id="tspan5125-6">:p</tspan>
</text>
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text6305"
- y="63.779312"
- x="141.61732">
+ y="63.779369"
+ x="141.65807">
<tspan
style="font-size:10.39999866px"
id="tspan6325"> rdf:first</tspan>
@@ -527,8 +391,8 @@
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text6307"
- y="63.779312"
- x="226.65669">
+ y="63.779369"
+ x="226.69743">
<tspan
style="font-size:10.39999866px"
id="tspan6327"> rdf:first</tspan>
@@ -536,8 +400,8 @@
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text6309"
- y="63.779312"
- x="311.69608">
+ y="63.779369"
+ x="311.73682">
<tspan
style="font-size:10.39999866px"
id="tspan6329"> rdf:first</tspan>
@@ -545,8 +409,8 @@
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text6311"
- y="63.779312"
- x="396.73541">
+ y="63.779369"
+ x="396.77615">
<tspan
style="font-size:10.39999866px"
id="tspan6331"> rdf:first</tspan>
@@ -554,44 +418,17 @@
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text6313"
- y="63.779312"
- x="481.77478">
+ y="63.779369"
+ x="481.81552">
<tspan
style="font-size:10.39999866px"
id="tspan6333"> rdf:first</tspan>
</text>
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
- id="text6315"
- y="184.25197"
- x="269.17639">
- <tspan
- style="font-size:10.39999866px"
- id="tspan6335"> rdf:first</tspan>
- </text>
- <text
- style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
- id="text6317"
- y="184.25197"
- x="354.21576">
- <tspan
- style="font-size:10.39999866px"
- id="tspan6337"> rdf:first</tspan>
- </text>
- <text
- style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
- id="text6319"
- y="184.25197"
- x="439.2551">
- <tspan
- style="font-size:10.39999866px"
- id="tspan6339"> rdf:first</tspan>
- </text>
- <text
- style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text6321"
- y="77.952164"
- x="184.13701">
+ y="77.952225"
+ x="184.17775">
<tspan
style="font-size:10.39999866px"
id="tspan6323">rdf:rest</tspan>
@@ -599,8 +436,8 @@
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text6341"
- y="77.952164"
- x="269.17639">
+ y="77.952225"
+ x="269.21713">
<tspan
style="font-size:10.39999866px"
id="tspan6343">rdf:rest</tspan>
@@ -608,8 +445,8 @@
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text6345"
- y="77.952164"
- x="354.21573">
+ y="77.952225"
+ x="354.25647">
<tspan
style="font-size:10.39999866px"
id="tspan6347">rdf:rest</tspan>
@@ -617,8 +454,8 @@
<text
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text6349"
- y="77.952164"
- x="439.2551">
+ y="77.952225"
+ x="439.29584">
<tspan
style="font-size:10.39999866px"
id="tspan6351">rdf:rest</tspan>
@@ -627,38 +464,10 @@
style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
id="text6353"
transform="matrix(0.68019617,0.73303013,-0.73303013,0.68019617,0,0)"
- y="-301.97116"
- x="431.71564">
+ y="-302.00101"
+ x="431.74338">
<tspan
style="font-size:10.39999866px"
id="tspan6355">rdf:rest</tspan>
</text>
- <text
- style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
- id="text6357"
- y="148.81837"
- x="311.69608">
- <tspan
- style="font-size:10.39999866px"
- id="tspan6359">rdf:rest</tspan>
- </text>
- <text
- style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
- id="text6361"
- y="148.81837"
- x="396.73541">
- <tspan
- style="font-size:10.39999866px"
- id="tspan6363">rdf:rest</tspan>
- </text>
- <text
- style="font-size:14px;text-anchor:middle;font-family:'Times,serif'"
- id="text6365"
- transform="matrix(0.99085491,-0.13493167,0.13493167,0.99085491,0,0)"
- y="209.07535"
- x="460.87106">
- <tspan
- style="font-size:10.39999866px"
- id="tspan6367">rdf:rest</tspan>
- </text>
</svg>
--- a/ldpatch.html Fri Nov 21 12:58:43 2014 +0100
+++ b/ldpatch.html Fri Nov 21 18:05:00 2014 +0100
@@ -552,100 +552,106 @@
</pre>
</p>
</section>
-
+
<section id="update-list-statement">
<h2><dfn>UpdateList</dfn></h2>
<p>
-The UpdateList operation is used to update some members of an <a href="http://www.w3.org/TR/rdf-schema/#ch_collectionvocab">RDF collection</a>. This is done by replacing a (possibly empty) sublist of that collection, identified by a <a>Slice specification</a>, by another sublist. UpdateList works in a similar way to <a href="https://docs.python.org/3/reference/expressions.html#slicings">slicing in Python</a> or similar languages. In general, it replaces a part (“slice”) of a list by another list.
+The UpdateList operation is used to update some members of an <a href="http://www.w3.org/TR/rdf-schema/#ch_collectionvocab">RDF collection</a>. It works in a similar way to <a href="https://docs.python.org/3/reference/expressions.html#slicings">slicing in Python</a> or similar languages: it replaces a slice of a list by another list.
</p>
- <p>
-First, recall that a collection in RDF is either the empty collection <code>rdf:nil</code> or a node (usually blank) having an <code>rdf:first</code> arc pointing to its first element, and an <code>rdf:rest</code> pointing to another collection. For example, the collection <code>( "lorem" "ipsum" "dolor" "sit" "amet" )</code> is modeled as represented in the upper part of <a href="#fig-an-example-rdf-collection"></a> below.
-
- <figure>
- <img src="fig-alt-update-list.svg" alt="( "e;lorem"e; "e;ipsum"e; "e;dolor"e; "e;sit"e; "e;amet"e; ) ( "e;foo"e; "e;bar"e; "e;baz"e; )">
- <figcaption>Two example RDF collections</figcaption>
- </figure>
-
-A node in a collection failing to have exactly one <code>rdf:first</code> and one <code>rdf:rest</code> outgoing arcs is considered malformed, and the <a>UpdateList</a> operation MUST fail if it encounters such a node.
- </p>
-
- <p>
+ <p>
The <a>UpdateList</a> operation is defined by four components: a <a href="#grammar-production-varOrIRI">variable or IRI</a> <var>s</var>, an <a href="#grammar-production-predicate">predicate</a> <var>p</var>, a <a>slice specification</a> and an argument graph <var>g</var> containing an RDF collection. It MUST fail if the <a>target graph</a> contains no more more than one triple with subject <var>s</var> and object <var>p</var>, or if the object of that triple is not a collection.
- </p>
-
- <p>
-The <dfn>slice specification</dfn> is composed of two positive integers <var>imin</var> and <var>imax</var> separated by "<code>..</code>". An omitted value is interpreted as the length of the collection. The first value <var>imin</var> MUST be less than or equal to <var>imax</var>, which MUST be less than or equal to the lenth of the collection. The slice represents the sublist being preceded by <var>imin</var> elements in the collection, and stopping after the <var>imax</var><sup>th</sup> element. For example, in <a href="#fig-an-example-rdf-collection"></a>, the slice <code>2..4</code> is the sublist <code>("dolor" "sit")</code>, the slice <code>3..</code> is the sublist <code>("sit" "amet")</code>, the slice <code>2..2</code> is an empty sublist located between <code>"ipsum"</code> and <code>"dolor"</code>, and the slice <code>..</code> is an empty sublist located at the end of the list.
- </p>
+ </p>
- <p>
-Below is an algorithm explaining how <a>UpdateList</a> can processed. The result of this algorithm is illustrated in <a href="#fig-updatelist-result"></a>.
- </p>
- <ul>
- <li>
- Let <var>spre</var> be <var>s</var>, <var>ppre</var> be <var>p</var> and <var>opre</var> the object of the triple (<var>s</var>, <var>p</var>, ?) from the <a>target graph</a>.
- </li>
- <li>
- Repeat <var>imin</var> times:
- <ul>
- <li>
- Set <var>spre</var> to <var>opre</var>, <var>ppre</var> to <code>rdf:rest</code> and <var>opre</var> to the object of the triple (<var>opre</var>, <code>rdf:rest</code>, ?) from the <a>target graph</a>.
- </li>
- </ul>
- </li>
- <li>
- Let <var>spost</var> be <var>spre</var>, <var>ppost</var> be <var>ppre</var> and <var>opost</var> be <var>opre</var>.
- </li>
- <li>
- Repeat (<var>imax</var>-<var>imin</var>) times:
- <ul>
- <li>
- Remove from the <a>target graph</a> the arcs (<var>spost</var>, <var>ppost</var>, <var>opost</var>).
- </li>
- <li>
- Let <var>elt</var> be the object of the triple (<var>opost</var>, <code>rdf:first</code>, ?). Remove from the <a>target graph</a> the arc (<var>opost</var>, <code>rdf:first</code>, <var>elt</var>). If <var>elt</var> is a blank node, apply the <a>Cut</a> operation to <var>elt</var>.
- </li>
- <li>
- Set <var>spost</var> to <var>opost</var>, <var>ppost</var> to <code>rdf:rest</code> and <var>opost</var> to the object of the triple (<var>opost</var>, <code>rdf:rest</code>, ?) from the <a>target graph</a>.
- </li>
- </ul>
- </li>
- <li>
- Remove from the <a>target graph</a> the arcs (<var>spre</var>, <var>ppre</var>, <var>opre</var>) and (<var>spost</var>, <var>ppost</var>, <var>opost</var>). (NB: in some situations, they may be the same arc, or have already been removed by a previous step)
- </li>
- <li>
- If <var>col</var> is the empty collection
- <ul>
- <li>
- Then
- <ul>
- <li>
- Add in the <a>target graph</a> the arc (<var>spre</var>, <var>ppre</var>, <var>opost</var>).
- </li>
- </ul>
- </li>
- <li>
- Else
- <ul>
- <li>
- Add all the arcs resulting from the parsing of <var>col</var> to the target graph, let <var>fst</var> be the first node of the corresponding new collection, and <var>lst</var> the last node of that collection (excluding <code>rdf:nil</code>).
- </li>
- <li>
- Remove from the <a>target graph</a> the arc (<var>lst</var>, <code>rdf:rest</code>, <code>rdf:nil</code>).
- </li>
- <li>
- Add in the <a>target graph</a> the arcs (<var>spre</var>, <var>ppre</var>, <var>fst</var>) and (<var>lst</var>, <code>rdf:rest</code>, <var>opost</var>).
- </li>
- </ul>
- </li>
- </ul>
- </li>
+ <p>
+The <dfn>slice specification</dfn> is composed of two positive integers <var>imin</var> and <var>imax</var> separated by "<code>..</code>". An omitted value is interpreted as the length of the collection. The first value <var>imin</var> MUST be less than or equal to <var>imax</var>, which MUST be less than or equal to the lenth of the collection. The slice specification represents the slice of the list being preceded by <var>imin</var> elements and spanning over (<var>imax</var>-<var>imin</var>) elements.
+ </p>
+ <p>
+For example, in the list <code>( "lorem" "ipsum" "dolor" "sit" "amet" )</code>, the <a>slice specification</a> <code>2..4</code> denotes the slice <code>("dolor" "sit")</code>, <code>3..</code> denotes the slice <code>("sit" "amet")</code>, <code>2..2</code> denotes the empty slice located between <code>"ipsum"</code> and <code>"dolor"</code>, and <code>..</code> denotes the empty slice located at the end of the list.
+ </p>
- <figure id="fig-updatelist-result">
- <img src="fig-alt-update-list-2.svg" alt="( "e;lorem"e; "e;ipsum"e; "e;dolor"e; "e;sit"e; "e;amet"e; ) ( "e;foo"e; "e;bar"e; "e;baz"e; )">
- <figcaption>The result of UpdateList s p 2..4 ("foo" "bar" "baz")</figcaption>
- </figure>
+ <section>
+ <h3>Algorithm</h3>
+ <p>
+Below is an algorithm explaining how <a>UpdateList</a> can be processed. The result of this algorithm is illustrated in <a href="#fig-updatelist-result"></a>.
+ </p>
+ <ul>
+ <li>
+ <b class="algo">Let</b> <var>s<sub>pre</sub></var> be <var>s</var>, <var>p<sub>pre</sub></var> be <var>p</var> and <var>o<sub>pre</sub></var> the object of the triple (<var>s</var>, <var>p</var>, ?) from the <a>target graph</a>.
+ </li>
+ <li>
+ <b class="algo">Repeat</b> <var>imin</var> times:
+ <ul>
+ <li>
+ <b class="algo">Set</b> <var>s<sub>pre</sub></var> to <var>o<sub>pre</sub></var>, <var>p<sub>pre</sub></var> to <code>rdf:rest</code> and <var>o<sub>pre</sub></var> to the object of the triple (<var>o<sub>pre</sub></var>, <code>rdf:rest</code>, ?) from the <a>target graph</a>.
+ </li>
+ </ul>
+ </li>
+ <li>
+ <b class="algo">Let</b> <var>s<sub>post</sub></var> be <var>s<sub>pre</sub></var>, <var>p<sub>post</sub></var> be <var>p<sub>pre</sub></var> and <var>o<sub>post</sub></var> be <var>o<sub>pre</sub></var>.
+ </li>
+ <li>
+ <b class="algo">Repeat</b> (<var>imax</var>-<var>imin</var>) times:
+ <ul>
+ <li>
+ Remove from the <a>target graph</a> the arcs (<var>s<sub>post</sub></var>, <var>p<sub>post</sub></var>, <var>o<sub>post</sub></var>).
+ </li>
+ <li>
+ <b class="algo">Let</b> <var>elt</var> be the object of the triple (<var>o<sub>post</sub></var>, <code>rdf:first</code>, ?). Remove from the <a>target graph</a> the arc (<var>o<sub>post</sub></var>, <code>rdf:first</code>, <var>elt</var>). <b class="algo">If</b> <var>elt</var> is a blank node, <b class="algo">then</b> apply the <a>Cut</a> operation to <var>elt</var>.
+ </li>
+ <li>
+ <b class="algo">Set</b> <var>s<sub>post</sub></var> to <var>o<sub>post</sub></var>, <var>p<sub>post</sub></var> to <code>rdf:rest</code> and <var>o<sub>post</sub></var> to the object of the triple (<var>o<sub>post</sub></var>, <code>rdf:rest</code>, ?) from the <a>target graph</a>.
+ </li>
+ </ul>
+ </li>
+ <li>
+ Remove from the <a>target graph</a> the arcs (<var>s<sub>pre</sub></var>, <var>p<sub>pre</sub></var>, <var>o<sub>pre</sub></var>) and (<var>s<sub>post</sub></var>, <var>p<sub>post</sub></var>, <var>o<sub>post</sub></var>). (NB: in some situations, they may be the same arc, or have already been removed by a previous step)
+ </li>
+ <li>
+ <b class="algo">If</b> <var>col</var> is the empty collection
+ <ul>
+ <li>
+ <b class="algo">Then</b>
+ <ul>
+ <li>
+ Add in the <a>target graph</a> the arc (<var>s<sub>pre</sub></var>, <var>p<sub>pre</sub></var>, <var>o<sub>post</sub></var>).
+ </li>
+ </ul>
+ </li>
+ <li>
+ <b class="algo">Else</b>
+ <ul>
+ <li>
+ Add all the arcs resulting from the parsing of <var>col</var> to the target graph, let <var>fst</var> be the first node of the corresponding new collection, and <var>lst</var> the last node of that collection (excluding <code>rdf:nil</code>).
+ </li>
+ <li>
+ Remove from the <a>target graph</a> the arc (<var>lst</var>, <code>rdf:rest</code>, <code>rdf:nil</code>).
+ </li>
+ <li>
+ Add in the <a>target graph</a> the arcs (<var>s<sub>pre</sub></var>, <var>p<sub>pre</sub></var>, <var>fst</var>) and (<var>lst</var>, <code>rdf:rest</code>, <var>o<sub>post</sub></var>).
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+
+ </section>
+ <section>
+ <h3>Example</h3>
+
+Consider the graph represented in <a href="#fig-a-graph-containing-a-collection"></a>. <a href="#fig-updatelist-result"></a> shows the result of applying an <a>UpdateList</a> operation on that list.
+
+ <figure>
+ <img src="fig-alt-update-list.svg" alt="( "e;lorem"e; "e;ipsum"e; "e;dolor"e; "e;sit"e; "e;amet"e; ) ( "e;foo"e; "e;bar"e; "e;baz"e; )">
+ <figcaption>A graph containing a collection</figcaption>
+ </figure>
+
+ <figure id="fig-updatelist-result">
+ <img src="fig-alt-update-list-2.svg" alt="( "e;lorem"e; "e;ipsum"e; "e;dolor"e; "e;sit"e; "e;amet"e; ) ( "e;foo"e; "e;bar"e; "e;baz"e; )">
+ <figcaption>The result of applying <code>UpdateList :s :p 2..4 ("foo" "bar" "baz") .</code> to the graph above.</figcaption>
+ </figure>
+ </section>
</section>
</section>
@@ -668,7 +674,7 @@
<li id="cut-nothing">If a <a>Cut</a> operation fails to remove any triple, then a HTTP 422 (Unprocessable Entity) error status code MUST be returned.</li>
<li id="cut-non-bnode">If a <a>Cut</a> operation is called on a variable not bound to a blank node, then a HTTP 422 (Unprocessable Entity) error status code MUST be returned.</li>
<li id="delete-non-existing-triple">If a <a>Delete</a> attempts to remove a non-existing triple, then a HTTP 422 (Unprocessable Entity) error status code MUST be returned.</li>
- <li id="updatelist-non-list-argument">If the <a class="internalDFN" href="#grammar-production-subject">subject</a> and <a class="internalDFN" href="#grammar-production-predicate">predicate</a> provided to a <a>UpdateList</a> operation fail to match a collection, then a HTTP 422 (Unprocessable Entity) error status code MUST be returned.</li>
+ <li id="updatelist-non-list-argument">If the <a class="internalDFN" href="#grammar-production-subject">subject</a> and <a class="internalDFN" href="#grammar-production-predicate">predicate</a> provided to an <a>UpdateList</a> do not have a unique object or this object is not a well-formed collection then a HTTP 422 (Unprocessable Entity) error status code MUST be returned.</li>
<li id="wrong-order-for-indexes">If the indexes in a <a>slice specification</a> are in the wrong order (e.g. <code>2868..42</code>), then the parsing fails and a 400 (Bad Request) error status code MUST be returned.</li>
<li id="wrong-index">If an index in a <a>slice specification</a> is greated than the length of the <code>rdf:List</code>, then a 422 (Unprocessable Entity) error status code MUST be returned.</li>
<li id="unknown-prefix">If a prefix name (<a class="internalDFN" href="#grammar-production-PNAME_NS">PNAME_NS</a>) is used without being previously declared, then the parsing fails and a 400 (Bad Request) error status code MUST be returned.</li>