| | |
| 1 |
PropAttr-1 |
| Match non-rdf attribute, and convert into propertyElt production. |
<$tag $prop=$val $attrs…>
$body…
</$tag>
|
<$tag $attrs…>
<$prop
>$val</$prop>
$body…
</$tag>
|
| When: |
$prop!~"rdfx:*"; $prop!~"rdf:*"; $prop!~"xml:*"; |
| 2 |
PropAttr-2 |
|
<$tag rdf:type=$val $attrs…>
$body…
</$tag>
|
<$tag $attrs…>
<rdf:type rdf:resource=$val/>
$body…
</$tag>
|
| Implicitly |
each $attrs≠"rdf:type"; |
| 3 |
PropAttr-3 |
| Match rdf attribute for which PropAttr-1 rule applies. |
<$tag $prop=$val $attrs…>
$body…
</$tag>
|
<$tag $attrs…>
<$prop
>$val</$prop>
$body…
</$tag>
|
| When: |
$prop~"rdf:*"; $prop≠"rdf:bagID"; $prop≠"rdf:ID"; $prop≠"rdf:about"; $prop≠"rdf:aboutEach"; $prop≠"rdf:type"; |
| 4 |
TypedNode |
| Match typedNode rule and convert into description with rdf:type propertyElt. |
<$tag $attrs…>
$body…
</$tag>
|
<rdf:Description $attrs…>
<rdf:type rdf:resource=$tag/>
$body…
</rdf:Description>
|
| When: |
$tag≠"rdf:Description"; |
| 5 |
about |
| Map an rdf:about into rdfx:subject. |
<$tag rdf:about=$about $attrs…>
$body…
</$tag>
|
<$tag rdfx:scope='URI'
rdfx:subject=$about
$attrs…>
$body…
</$tag>
|
| Implicitly |
each $attrs≠"rdfx:subject"; each $attrs≠"rdf:about"; each $attrs≠"rdfx:scope"; |
| 6 |
aboutEach |
| Map an rdf:aboutEach into rdfx:subject. |
<$tag rdf:aboutEach=$about
$attrs…>
$body…
</$tag>
|
<$tag rdfx:subject=$about
rdfx:scope='Collection'
$attrs…>
$body…
</$tag>
|
| Implicitly |
each $attrs≠"rdfx:subject"; each $attrs≠"rdfx:scope"; each $attrs≠"rdf:aboutEach"; |
| 7 |
bNode |
| On a description with no identifier, add an rdfx:subject |
<$tag $attrs…>
$body…
</$tag>
|
<$tag rdfx:scope='bNode'
rdfx:subject='_:{generate-id()}'
$attrs…>
$body…
</$tag>
|
| When: |
each $attrs≠"rdf:ID"; each $attrs≠"rdf:about"; each $attrs≠"rdfx:subject"; each $attrs≠"rdf:aboutEach"; |
| Implicitly |
each $attrs≠"rdfx:scope"; |
| 8 |
ID |
| Map an rdf:ID into rdfx:subject. |
<$tag rdf:ID=$id $attrs…>
$body…
</$tag>
|
<$tag rdfx:subject='#{$id}'
rdfx:scope='URI' $attrs…>
$body…
</$tag>
|
| Implicitly |
each $attrs≠"rdf:ID"; each $attrs≠"rdfx:subject"; each $attrs≠"rdfx:scope"; |
| 9 |
parseTypeResource |
| Match propertyElt with parseType=Resource and simplify. |
<$tag $attrs…>
<$propElt rdf:ID=?$ID
rdf:parseType='Resource'
rdfx:reifyScope=?$reifyScope
rdfx:reify=?$reify>
$propEltBody…
</$propElt>
$body…
</$tag>
|
<$tag $attrs…>
<$propElt rdf:ID=?$ID
rdfx:reify=?$reify
rdfx:reifyScope=?$reifyScope>
<rdf:Description>
$propEltBody…
</rdf:Description>
</$propElt>
$body…
</$tag>
|
| 10 |
propertyEltWithPropAttrs |
| Match propertyElt with propAttrs or bagID . |
<$tag $attrs…>
<$propElt rdfx:reify=?$reify
rdf:resource=?$about
rdfx:reifyScope=?$reifyScope
rdf:ID=?$ID
$attr=$value
$propEltAttrs…/>
$body…
</$tag>
|
<$tag $attrs…>
<$propElt rdfx:reify=?$reify
rdf:ID=?$ID
rdfx:reifyScope=?$reifyScope>
<rdf:Description
rdf:about=?$about
$attr=$value
$propEltAttrs…/>
</$propElt>
$body…
</$tag>
|
| When: |
$attr!~"rdfx:*"; each $propEltAttrs!~"rdfx:*"; |
| Implicitly |
$attr≠"rdf:ID"; $attr≠"rdf:about"; $attr≠"rdfx:reifyScope"; $attr≠"rdf:resource"; $attr≠"rdfx:reify"; each $propEltAttrs≠"rdf:ID"; each $propEltAttrs≠"rdf:about"; each $propEltAttrs≠"rdfx:reifyScope"; each $propEltAttrs≠"rdf:resource"; each $propEltAttrs≠"rdfx:reify"; |
| 11 |
propertyEltWithResource |
| Match propertyElt with rdf:resource . |
<$tag $attrs…>
<$propElt rdfx:reify=?$reify
rdfx:reifyScope=?$reifyScope
rdf:resource=$about
rdf:ID=?$ID
$propEltAttrs…/>
$body…
</$tag>
|
<$tag $attrs…>
<$propElt rdf:ID=?$ID
rdfx:reifyScope=?$reifyScope
rdfx:reify=?$reify>
<rdf:Description
rdf:about=$about
$propEltAttrs…/>
</$propElt>
$body…
</$tag>
|
| Implicitly |
each $propEltAttrs≠"rdf:ID"; each $propEltAttrs≠"rdf:about"; each $propEltAttrs≠"rdf:resource"; each $propEltAttrs≠"rdfx:reifyScope"; each $propEltAttrs≠"rdfx:reify"; |
| 12 |
Flattening |
| Remove nested description or typedNode from first propertyElt. |
<$tag $attrs…>
<$propElt rdfx:reify=?$reify
rdf:ID=?$ID
rdfx:reifyScope=?$reifyScope>
<$object rdfx:subject=$about
rdfx:scope=$scope
$objAttrs…>
$objBody…
</$object>
</$propElt>
$body…
</$tag>
|
<$object rdfx:subject=$about
rdfx:scope=$scope
$objAttrs…>
$objBody…
</$object>
<$tag $attrs…>
<$propElt rdfx:object=$about
rdfx:reify=?$reify
rdf:ID=?$ID
rdfx:reifyScope=?$reifyScope
rdfx:scope=$scope/>
$body…
</$tag>
|
| Implicitly |
each $objAttrs≠"rdfx:subject"; each $objAttrs≠"rdfx:scope"; |
| 13 |
PreFlatteningBNode |
| Add a bNode name to nested description or typedNode of first propertyElt. |
<$tag $attrs…>
<$propElt
rdfx:reifyScope=?$reifyScope
rdfx:reify=?$reify
rdf:ID=?$ID>
<$object $objAttrs…>
$objBody…
</$object>
</$propElt>
$body…
</$tag>
|
<$tag $attrs…>
<$propElt
rdfx:reifyScope=?$reifyScope
rdf:ID=?$ID
rdfx:reify=?$reify>
<$object rdfx:subject='_:{generate-id()}'
rdfx:scope='bNode'
$objAttrs…>
$objBody…
</$object>
</$propElt>
$body…
</$tag>
|
| When: |
each $objAttrs≠"rdf:ID"; each $objAttrs≠"rdf:about"; each $objAttrs≠"rdfx:subject"; each $objAttrs≠"rdf:aboutEach"; |
| Implicitly |
each $objAttrs≠"rdfx:scope"; |
| 14 |
PreFlatteningID |
| Change an rdf:ID to an rdfx:subject in a nested description or typedNode of first propertyElt. |
<$tag $attrs…>
<$propElt rdfx:reify=?$reify
rdf:ID=?$ID
rdfx:reifyScope=?$reifyScope>
<$object rdf:ID=$nestedID
$objAttrs…>
$objBody…
</$object>
</$propElt>
$body…
</$tag>
|
<$tag $attrs…>
<$propElt rdf:ID=?$ID
rdfx:reify=?$reify
rdfx:reifyScope=?$reifyScope>
<$object rdfx:scope='URI'
rdfx:subject='#{$nestedID}'
$objAttrs…>
$objBody…
</$object>
</$propElt>
$body…
</$tag>
|
| Implicitly |
each $objAttrs≠"rdf:ID"; each $objAttrs≠"rdfx:subject"; each $objAttrs≠"rdfx:scope"; |
| 15 |
PreFlatteningAbout |
| Change an rdf:about to an rdfx:subject in a nested description or typedNode of first propertyElt. |
<$tag $attrs…>
<$propElt rdfx:reify=?$reify
rdf:ID=?$ID
rdfx:reifyScope=?$reifyScope>
<$object rdf:about=$about
$objAttrs…>
$objBody…
</$object>
</$propElt>
$body…
</$tag>
|
<$tag $attrs…>
<$propElt
rdfx:reifyScope=?$reifyScope
rdf:ID=?$ID
rdfx:reify=?$reify>
<$object rdfx:scope='URI'
rdfx:subject=$about
$objAttrs…>
$objBody…
</$object>
</$propElt>
$body…
</$tag>
|
| Implicitly |
each $objAttrs≠"rdfx:subject"; each $objAttrs≠"rdf:about"; each $objAttrs≠"rdfx:scope"; |
| 16 |
BasicSeparation |
| Extract first propertyElt from a description, no bagID, not parseType='Literal'. |
<$tag rdfx:scope=$subjScope
rdfx:subject=$subject
$attrs…>
<$propElt
rdfx:scope=?$objScope
rdfx:reifyScope=?$reifyScope
rdfx:reify=?$reify
rdfx:object=?$object
rdf:ID=?$ID
>$objectString</$propElt>
<$more $moreAttrs…>
$moreBody…
</$more>
$body…
</$tag>
|
<rdf:Description
rdfx:scope=$subjScope
rdfx:subject=$subject>
<$propElt
rdfx:scope=?$objScope
rdfx:reifyScope=?$reifyScope
rdf:ID=?$ID
rdfx:object=?$object
rdfx:reify=?$reify
>$objectString</$propElt>
</rdf:Description>
<$tag rdfx:subject=$subject
rdfx:scope=$subjScope
$attrs…>
<$more $moreAttrs…>
$moreBody…
</$more>
$body…
</$tag>
|
| When: |
$propElt≠"rdf:li"; each $attrs≠"rdf:bagID"; |
| Implicitly |
each $attrs≠"rdfx:subject"; each $attrs≠"rdfx:scope"; |
| 17 |
ReificationID2rdfxReify |
| Convert an rdf:ID to rdfx:reify. |
<$tag $attrs…>
<$propElt rdf:ID=$ID
$moreAttrs…>
$moreBody…
</$propElt>
$body…
</$tag>
|
<$tag $attrs…>
<$propElt
rdfx:reifyScope='URI'
rdfx:reify='#{$ID}'
$moreAttrs…>
$moreBody…
</$propElt>
$body…
</$tag>
|
| When: |
each $attrs≠"rdf:bagID"; $propElt≠"rdf:li"; |
| Implicitly |
each $moreAttrs≠"rdf:ID"; each $moreAttrs≠"rdfx:reifyScope"; each $moreAttrs≠"rdfx:reify"; |
| 18 |
ReificationResource |
| Construct quad when reifying with resource object. |
<$tag rdfx:scope=$subjScope
rdfx:subject=$subject
$attrs…>
<$propElt
rdfx:object=$object
rdfx:scope=$objScope
rdfx:reify=$reify
rdfx:reifyScope=$reifyScope/>
$body…
</$tag>
|
<rdf:Statement
rdfx:subject=$reify
rdfx:scope=$reifyScope>
<rdf:subject
rdfx:object=$subject
rdfx:scope=$subjScope/>
<rdf:predicate
rdf:resource=$propElt/>
<rdf:object
rdfx:object=$object
rdfx:scope=$objScope/>
</rdf:Statement>
<$tag rdfx:subject=$subject
rdfx:scope=$subjScope
$attrs…>
<$propElt
rdfx:object=$object
rdfx:scope=$objScope/>
$body…
</$tag>
|
| When: |
$propElt≠"rdf:li"; each $attrs≠"rdf:bagID"; |
| Implicitly |
each $attrs≠"rdfx:subject"; each $attrs≠"rdfx:scope"; |
| 19 |
ReificationString |
| Construct quad when reifying with string object. |
<$tag rdfx:scope=$subjScope
rdfx:subject=$subject
$attrs…>
<$propElt rdfx:reify=$reify
rdfx:reifyScope=$reifyScope
>$object</$propElt>
$body…
</$tag>
|
<rdf:Statement
rdfx:scope=$reifyScope
rdfx:subject=$reify>
<rdf:subject
rdfx:scope=$subjScope
rdfx:object=$subject/>
<rdf:predicate
rdf:resource=$propElt/>
<rdf:object
>$object</rdf:object>
</rdf:Statement>
<$tag rdfx:scope=$subjScope
rdfx:subject=$subject
$attrs…>
<$propElt
>$object</$propElt>
$body…
</$tag>
|
| When: |
$propElt≠"rdf:li"; each $attrs≠"rdf:bagID"; |
| Implicitly |
each $attrs≠"rdfx:subject"; each $attrs≠"rdfx:scope"; |
| 20 |
liStart |
| Initialize liCounter |
<$tag $attrs…>
<rdf:li $moreAttrs…>
$moreBody…
</rdf:li>
$body…
</$tag>
|
<$tag rdfx:liCounter='1'
$attrs…>
<rdf:li $moreAttrs…>
$moreBody…
</rdf:li>
$body…
</$tag>
|
| Implicitly |
each $attrs≠"rdfx:liCounter"; |
| 21 |
liCount |
| Use liCounter |
<$tag rdfx:liCounter=$N
$attrs…>
<rdf:li $moreAttrs…>
$moreBody…
</rdf:li>
$body…
</$tag>
|
<$tag rdfx:liCounter='{$N+1}'
$attrs…>
<$N $moreAttrs…>
$moreBody…
</$N>
$body…
</$tag>
|
| Implicitly |
each $attrs≠"rdfx:liCounter"; |
| 22 |
liEnd |
| Remove liCounter |
<$tag rdfx:liCounter=$N
$attrs…>
<$prop $moreAttrs…>
$moreBody…
</$prop>
</$tag>
|
<$tag $attrs…>
<$prop $moreAttrs…>
$moreBody…
</$prop>
</$tag>
|
| When: |
$prop≠"rdf:li"; |
| Implicitly |
each $attrs≠"rdfx:liCounter"; |
| 23 |
bagLiStart |
| Initialize counter for bagId, declare bag. |
<$tag rdf:bagID=$bagID $attrs…>
$body…
</$tag>
|
<rdf:Bag rdf:ID=$bagID/>
<$tag rdfx:bagLiCounter='1'
rdf:bagID=$bagID $attrs…>
$body…
</$tag>
|
| When: |
each $attrs≠"rdfx:bagLiCounter"; |
| Implicitly |
each $attrs≠"rdf:bagID"; |
| 24 |
bagLiEnd |
| Drop completed bagId. |
<rdf:Description
rdfx:bagLiCounter=$N
rdfx:subject=$subject
rdfx:scope=$subjScope
rdfx:liCounter=?$M
rdf:bagID=$bagID/>
|
|
| 25 |
bagIDwithReification |
| In a description with bagID, the first propElt is explicitly reified. |
<$tag rdf:bagID=$bagID
rdfx:bagLiCounter=$N
rdfx:scope=$subjScope
rdfx:subject=$subject
$attrs…>
<$propElt rdfx:reify=$reify
rdfx:reifyScope=$reifyScope
$moreAttrs…>
$moreBody…
</$propElt>
$body…
</$tag>
|
<rdf:Description
rdfx:scope=$subjScope
rdfx:subject=$subject>
<$propElt
rdfx:reifyScope=$reifyScope
rdfx:reify=$reify
$moreAttrs…>
$moreBody…
</$propElt>
</rdf:Description>
<rdf:Description
rdfx:scope='URI'
rdfx:subject='#{$bagID}'>
<$N rdfx:scope=$reifyScope
rdfx:object=$reify/>
</rdf:Description>
<$tag rdf:bagID=$bagID
rdfx:bagLiCounter='{$N+1}'
rdfx:scope=$subjScope
rdfx:subject=$subject
$attrs…>
$body…
</$tag>
|
| When: |
$propElt≠"rdf:li"; |
| Implicitly |
each $moreAttrs≠"rdfx:reifyScope"; each $moreAttrs≠"rdfx:reify"; each $attrs≠"rdf:bagID"; each $attrs≠"rdfx:subject"; each $attrs≠"rdfx:scope"; each $attrs≠"rdfx:bagLiCounter"; |
| 26 |
bagIDwithoutReification |
| In a description with bagID, the first propElt is implicitly reified. |
<$tag rdf:bagID=$bagID $attrs…>
<$more $moreAttrs…>
$moreBody…
</$more>
$body…
</$tag>
|
<$tag rdf:bagID=$bagID $attrs…>
<$more rdfx:reify='_:{generate-id()}'
rdfx:reifyScope='bNode'
$moreAttrs…>
$moreBody…
</$more>
$body…
</$tag>
|
| When: |
each $moreAttrs≠"rdf:ID"; each $moreAttrs≠"rdfx:reify"; |
| Implicitly |
each $attrs≠"rdf:bagID"; each $moreAttrs≠"rdfx:reifyScope"; |
| 27 |
tidyingUp |
| Remove superfluous rdf:Description's. |
<rdf:Description
rdfx:scope=$subjScope
rdfx:subject=$subj/>
|
|