[
Lists Home |
Date Index |
Thread Index
]
Arjun Ray wrote:
>
> james anderson <james.anderson@setf.de> wrote:
>
> | 1. how to encode the mapping specification?
> |
> | what is the advantage of[:] resolver == URI -> local-name -> external-name
> |
> | over[:] resolver == local-name -> (URI x external-name)
> |
> | since the local name must be unique in any given context.
>
> Because multiple external names may map to the same local name! That's
> what sharing of data values is all about.
is the issue that "multiple external names may map to the same local name" _simultaneously_?
> How can xlink:href and html:src
> have the same value by *authorial intent*, as opposed to what *could* be
> just coincidence (e.g. string equivalence)?
>
> The Namespaces approach is implicitly one of "disjoint factoring", i.e.
> that a value is assigned (by name) to only *one* external category; but
> XMap isn't only about XML Namespaces, and disjoint factoring is manifestly
> *not* the general case. Thus, the correct general approach is outside-in
> ("where is my value?") rather than inside-out ("who gets this value?")
unless there are simultaneous many-to-one external-to-local correspondences, then "outside-in" is no different than "inside-out" with respect to the
program/document which specifies the process/transform of a given operand document.
>
> specific resolver/extractor == (URI x external-name) -> local-name
i can imaging accessors which are intended to serve as the basis for "in-line-mapped" transforms which would use functions of this form, but their effect would
be to transform the external names in the xslt (or the like) into the local name set on the fly. in which case, a process/transform which is to be applied
repeatedly to documents based on a differing ontology/taxonomy/name-set should itself be tranformed inside-out before being applied to the target documents.
>
> The difficulties in using XMap to reproduce Namespaces are precisely in
> this "inversion" (the natural interpretation of XMap is AFs). Indeed,
> disjoint factoring (to allow if not enforce inside-out mappings) is a
> fundamental *flaw* of colonification syntax.
>
> | 2. ontology, taxonomy, or name set
>
> | why does "where the names came from" matter for a renaming transformation?
>
> See above. It's the same question. :-)
does an assertion of the sort, that {}xyz is to be associated, even simultaneously, with {http://www.w3.org/1999/xlink}href and
{http://www.w3.org/1999/xhtml}src have any semantic content during the transformation process? even should one introduce namespace-name-based dependancy
relations among correspondences, it does not matter where they came from. (in the example below, this would mean that the bindings would be partitioned by
namespace rather than merged.)
more complex simultaneous one-to-many transformations would no longer be nominal; more likely ontological.
>
> | 3.
> |>| while performing the transformation which XMap describes, the pairs in
> |>| the control attributes are equivalent to variable bindings and the
> |>| transformation itself is equivalent to beta-conversion.
> |>
> |> I don't see how. I'd say XMap is an analog of alpha renaming.
> |
> | it is alpha-conversion only if one posits an implicit binding for each name.
> | an implementation looks a lot more like beta-conversion.
>
> An implementation would be "undoing" the alpha-renaming, which may *look*
> like beta-conversion. :-)
>
is xmap is intended to act more like the following?
(whereby the difference is not the acons, but the sublis.)
?(defGeneric XMap* (form &optional bindings)
(:method ((form list) &optional bindings)
(labels ((read-names (string)
(when string
(let ((names nil) (name nil))
(with-input-from-string (stream string)
(loop (unless (setf name (read stream nil nil)) (return (nreverse names)))
(push name names))))))
(transform-attribute (attr &aux (name (first attr)) (value (rest attr)) (names (assoc name bindings)))
(if names
(mapcar #'(lambda (name) (xmla:make-attribute name value)) names)
(list (xmla:make-attribute name value))))
(transform-element (name attributes content &aux (names (assoc name bindings)))
(if names
(mapcar #'(lambda (name) (apply #'xmla:make-element name attributes content)) names)
(list (xmla:make-element name attributes content)))))
(xmla:with-abstract-element ((gi &rest attributes) &rest content) form
(xmla:with-abstract-attributes ((xmlmap-attr {}xmlmap)) attributes
;; augment the local -> external* bindings
(mapcar #'(lambda (attr-name)
(map-plist #'(lambda (external local)
(setf bindings
(acons local (cons external (rest (assoc local bindings))) bindings)))
(read-names (xmla:get-abstract-property-value attributes attr-name))))
(read-names xmlmap-attr))
;; transform the element
(transform-element gi
(apply #'nconc (mapcar #'transform-attribute attributes))
(apply #'nconc (mapcar #'(lambda (e) (xmap* e bindings)) content)))))))
(:method ((form t) &optional bindings)
(declare (ignore bindings))
(list form)))
#<STANDARD-GENERIC-FUNCTION XMAP* #x6437466>
? (defParameter *form2* '(({}image ({}src . "some.gif")
({}xmlmap . "{}yy {}zz")
({}yy . "{http://www.w3.org/1999/xlink}href {}src
{http://www.w3.org/1999/xlink}type {}foo
{http://www.w3.org/1999/xlink}role {}bar
{http://www.w3.org/1999/xlink}title {}quux")
({}zz . "{http://www.w3.org/1999/xhtml}href {}src
{http://www.w3.org/1999/xhtml}type {}foo
{http://www.w3.org/1999/xhtml}role {}bar
{http://www.w3.org/1999/xhtml}title {}quux
{http://www.w3.org/1999/xhtml}img {}image")
({}foo . "simple")
({}bar . "http://example.org/some/role")
({}quux . "Sleeping Kitty"))
"some content or other"))
*FORM2*
? (pprint (xmap* *form2*))
((({}image
({}src . "some.gif")
({http://www.w3.org/1999/xhtml}href . "some.gif")
({http://www.w3.org/1999/xlink}href . "some.gif")
({}xmlmap . "{}yy {}zz")
({}yy . "{http://www.w3.org/1999/xlink}href {}src
{http://www.w3.org/1999/xlink}type {}foo
{http://www.w3.org/1999/xlink}role {}bar
{http://www.w3.org/1999/xlink}title {}quux")
({}zz . "{http://www.w3.org/1999/xhtml}href {}src
{http://www.w3.org/1999/xhtml}type {}foo
{http://www.w3.org/1999/xhtml}role {}bar
{http://www.w3.org/1999/xhtml}title {}quux
{http://www.w3.org/1999/xhtml}img {}image")
({}foo . "simple")
({http://www.w3.org/1999/xhtml}type . "simple")
({http://www.w3.org/1999/xlink}type . "simple")
({}bar . "http://example.org/some/role")
({http://www.w3.org/1999/xhtml}role . "http://example.org/some/role")
({http://www.w3.org/1999/xlink}role . "http://example.org/some/role")
({}quux . "Sleeping Kitty")
({http://www.w3.org/1999/xhtml}title . "Sleeping Kitty")
({http://www.w3.org/1999/xlink}title . "Sleeping Kitty"))
"some content or other")
(({http://www.w3.org/1999/xhtml}img
({}src . "some.gif")
({http://www.w3.org/1999/xhtml}href . "some.gif")
({http://www.w3.org/1999/xlink}href . "some.gif")
({}xmlmap . "{}yy {}zz")
({}yy . "{http://www.w3.org/1999/xlink}href {}src
{http://www.w3.org/1999/xlink}type {}foo
{http://www.w3.org/1999/xlink}role {}bar
{http://www.w3.org/1999/xlink}title {}quux")
({}zz . "{http://www.w3.org/1999/xhtml}href {}src
{http://www.w3.org/1999/xhtml}type {}foo
{http://www.w3.org/1999/xhtml}role {}bar
{http://www.w3.org/1999/xhtml}title {}quux
{http://www.w3.org/1999/xhtml}img {}image")
({}foo . "simple")
({http://www.w3.org/1999/xhtml}type . "simple")
({http://www.w3.org/1999/xlink}type . "simple")
({}bar . "http://example.org/some/role")
({http://www.w3.org/1999/xhtml}role . "http://example.org/some/role")
({http://www.w3.org/1999/xlink}role . "http://example.org/some/role")
({}quux . "Sleeping Kitty")
({http://www.w3.org/1999/xhtml}title . "Sleeping Kitty")
({http://www.w3.org/1999/xlink}title . "Sleeping Kitty"))
"some content or other"))
?
|