Xlink: Van Lepthien Csci 7818 Fall 2000

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 37

XLink

Van Lepthien
CSCI 7818
Fall 2000
Overview
• What is XLink?
• W3C Stuff
• XLink Elements
• Linkbases
• Traversals
• Implementations
• Comments
• References
What is XLink?
• XLink “allows elements to be inserted into XML
documents in order to create and describe links
between resources.”
What is XLink?
• Define link relationships among more than two
resources.
• Associate metadata with a link
• Define links to associate resources not in the
document containing the link
What is XLink?

Enables hyperwebs

(this slide for Ken’s benefit)


W3C Stuff
• XML XLink Requirements Version 1.0
W3C Note 24-Feb-1999
(http://www.w3.org/TR/NOTE-xlink-req/ )
• Candidate Recommendation: 3 July 2000:
XML Linking Language (XLink) Version 1.0 - (
http://www.w3.org/TR/xlink/)
• Namespace:
xmlns:xlink=“http://www.w3.org/1999/xlink”
XLink Scope
• Element Conformance

• Application Conformance
Element Conformance
• An element contains a type attribute from the XLink
namespace with a value of “arc”, “extended”,
“locator”, “resource”, “simple”, “title”, or “none”.
• An element adheres to the specified constraints for
the type.

XLink does not define elements.

It defines attributes and how the


containing elements are to be used.
Application Conformance
• The recommendation describes processing that
an application must do to conform, and, if
optional features are implemented, what must
be done to make the optional features conform.
XLink Element Types
• Links:
– simple
– extended
• Resources (used in extended links)
– resource (local resource)
– locator (remote resource)
• arc (used in extended links)
• title (may be in a child element of an extended-, locator- or arc-type
element)
• none
Link - simple
Defines an outbound link from a local resource to a remote
resource.
• Similar to HTML references
<a href=“uri”> …</a> or <img href=“uri”>
• Attributes
– href – URI of a resource. Xpointer support is explicitly expected.
– role – URI of a resource that describes the role of the element
– arcrole – URI of a resource that describes the role of the link
– show – describes how the href resource is to be presented on
transversal
– actuate – describes when the transversal to href resource is to happen
– title – a human readable description of the element
simple - Link
Example
XML Document Role definition
<doc …
xmlns:xlink=“…/xlink”>

<mytag Linked resource
xlink:type=“simple”
xlink:role=“role_uri”
xlink:href=“ref_uri” Instruction to open the link in a new
xlink:show=“new” window when the link is traversed
xlink:actuate=“onLoad”>

</mytag> Instruction to traverse the link when
… loading the original document
</doc>
Link - extended
An extended link associates an arbitrary number
of resources.
• An extended link may be stored separately
from all resources that are being associated.
• Enables linking of objects that have no
provision of internal links.
Link - extended
A link element with XLink type=“extended”
contains a set of elements with XLink types of
resource, locator, arc, and title.
resource
An element with XLink type=“resource”
defines a local resource.
• Attributes
– role – URI of a resource that describes the role of
the element
– title – a human readable description of the element
– label – provides a label to which an arc type
element may refer
locator
An element with XLink type=“locator” defines
a remote resource.
• Attributes
– href – URI of a resource (required)
– role – URI of a resource that describes the role of
the element
– title – a human readable description of the element
– label – provides a label to which an arc type
element may refer
arc
• An element with XLink type=“arc” defines
links between (or among) resources. The links
can be:
– between a location in the document and a remote
resource (an “outbound” arc)
– between a remote resource and a location in the
document (an inbound arc)
– between remote resources (a remote arc)
arc
• Attributes
– from – specifies the label of starting resources for a
transversal
– to – specifies the label of ending resources for a transversal
– show – describes how the href resource is to be presented
on transversal
– actuate – describes when the transversal to href resource is
to happen
– arcrole – URI of a resource that describes the role of the
arc
– title – a human readable description of the element
title
• An element with XLink type=“title” permits
more information than a title attribute alone
would. A title element must be a child of the
element it supplies title information for.
• An element with XLink type=“title” only has
XLink specified meaning if it is the child of an
element with an XLink type of extended,
locator, or arc.
extended - Link
Example
XML Document
<doc xmlns:xlink=“…/xlink”>
<order xlink:type=“extended” >
<car xlink:type=“resource” xlink:label=c1>Porsche </car>
<car xlink:type=“resource” xlink:label=c1>Ferrari </car>
<account xlink:type=“locator” xlink:label=“a1”
xlink:href=“http://www.chargeme.com/cgi/citibank-12-3123” Bank
xlink:title=“Brian Temple”/>
<location xlink:type=“resource” xlink:label=d1> Account
<attn>Matthias Hauswirth</attn>
<street>…</street> …<zip>80303</zip>
</ location >
<charge_to xlink:type=“arc” xlink:from=“c1” xlink:to=“a1”
xlink:title=“Brian pays”/>
<deliver_to xlink:type=“arc” xlink:from=“c1” xlink:to=“d1”/>
</order>
</doc>
none
• An element with XLink type=“none” has no
XLink specified meaning.
• This can be used to enable one to turn XLink
on and off in individual elements in an element
type that is XLink aware.
none
Example
DTD

<!ELEMENT ref (stuff)>
<!ATTLIST ref
xlink:type (simple|none) “none”
xlink:href CDATA #IMPLIED >
Markup

<ref xlink:type=“simple” xlink:href=“http://x.com”>
“ref” element with link <stuff>stuff</stuff>
</ref>

<ref>
“ref” element without link <stuff>stuff</stuff>
</ref>
Behavioral Attributes
• The two behavior attributes, show and actuate,
give an XLink application instructions on how
and when, respectively, to display the ending
resources of links.
show attribute
• The show attribute on a simple link or an arc
describes how the application interpreting XLink
should present the ending resource of the link or arc.
• The value of the show attribute is one of “new”,
“replace”, “embed”, “other”, or “none”
• Linkbase arcs must be treated as if show=“none”,
regardless of the value specified.
show attribute values
“new” – the application should open the ending resource in a new
window, frame, or similar context.
“replace” – the application should load the ending resource in the
same window, frame, etc. as the starting resource.
“embed” – the application should load the the ending resource in
place of the starting resource.
“other” – the application should use other markup in the link to
determine how the ending resource should be handled.
“none” – the application is not constrained on how to load the ending
resource.
actuate attribute
• The actuate attribute on a simple link or an arc
describes when the application interpreting
XLink should make the traversal.
• The value of the actuate attribute is one of
“onLoad”, “onRequest”, “other”, or “none”
• Linkbase arcs must be treated as if
actuate=“onLoad”, regardless of the value
specified.
actuate attribute values
“onLoad” – the application should traverse to the ending
resource upon loading of the starting resource.
“onRequest” – the application should traverse to the
ending resource after loading of the starting resource,
but only when some explicit event (an mouse click, etc.)
initiates the traversal.
“other” – the application should use other markup in the
link to determine how the traversal occurs.
“none” – the application is not constrained on how it
handles the traversal.
Linkbases
• A linkbase is used to gather links in one place,
external to the items linked.
• A linkbase is specified in an external link with
an arc type element with
arcrole=“http://www.w3.org/1999/xlink/properties/linkbase”
• A linkbase must be XML.
Traversals
• In an simple link a traversal is specified by the
implicit local resource and the explicit remote
resource designated in the href attribute.
• In an extended link, a set of traversals are specified by
the pairs each made up of a from-node, consisting of
a locator type element whose label matches the value
of the from attribute in an arc, and a to-node,
consisting of a locator type element whose label
matches the value of the to attribute in the same arc.
Traversals
Example
XML Document
<doc xmlns:xlink=“…/xlink”>
<order xlink:type=“extended” >
<car xlink:type=“resource” xlink:label=c1>Porsche </car>
<car xlink:type=“resource” xlink:label=c1>Ferrari </car>
<account xlink:type=“locator” xlink:label=“a1”
xlink:href=“http://www.chargeme.com/cgi/citibank-12-3123” Traverals for the
xlink:title=“Brian Temple”/> “charge_to” arc
<location xlink:type=“resource” xlink:label=d1> car:Porsche account
<attn>Matthias Hauswirth</attn> car:Ferrari account
<street>…</street> …<zip>80303</zip>
</ location >
<charge_to xlink:type=“arc” xlink:from=“c1” xlink:to=“a1”
Traverals for the
xlink:title=“Brian pays”/>
“deliver_to” arc
<deliver_to xlink:type=“arc” xlink:from=“c1” xlink:to=“d1”/>
car:Porsche location
</order>
</doc>
car:Ferrari  location
Unclear areas
• simple link role
• Two arcs in an extended link cannot have the
same from and to values
• show attribute values “replace” and “embed”
• The choice of the terms “replace” and
“embed” for values of the show attribute are
not clear
Unclear areas
simple link role
• In a simple link, a role can be specified, but it not clear
whether the role is being defined for the local resource
or the remote resource.
(In the XLink Candidate Recommendation,
http://www.w3.org/TR/2000/CR-xlink-20000703/Overview.html,
the example of single link functionality implemented in
an extended link, the role appears as an attribute of the
locator type element, i.e., the remote resource. But an
example does not a specification make. And there is no
reason the local resource should not have a role
described.
Unclear areas
Two arcs in an extended link cannot
have the same from and to values
• In an extended link, only one arc can specify a pair of
xlink:from and xlink:to values. If there are multiple
relationships between a pair of objects, they cannot
be expressed as arcs from one object to the other
distinguished by different arcrole attribute values.
• This may be intended to prevent multiple traversals
where they might not be wanted, but also prevents
multiple traversals where they might be needed.
Unclear areas
show attribute values
“replace” and “embed”
• The choice of the terms “replace” and
“embed” for values of the show attribute are
not clear.
– The description of “replace” says the application
“should load the resource in the same window,
frame, pane, or other relevant presentation context
in which the starting resource was loaded.”
– The description for “embed” says the application
“should load it in place of the starting resource.”
Implementations
• 1998 - University of Southhampton (see [CARR]
in the references)
• 1998? - XLink in DSSSL Package. There is a
reference on xml.com to an implementation of
XLink, but the server does not respond.
• 1999 – XLinkFilter (see [ST LAURENT] in the
references)
• None of the major browsers have support.
Comments
• I have ignored XPointer.
• I would like to do a comparison of XLink and
Chimera functionality.
• The lack of implementations is disturbing – even
recognizing that XLink is still a Candidate
Recommendation.
• The “Unclear Areas” popped right out from reading
the recommendation. This is not a good sign.
• XML support for extended hyperlinks is a good thing.
References
[CARR] Leslie Carr, Initial Experiences of an XLink Implementation;
http://journals.ecs.soton.ac.uk/xml4j/xlinkexperience.html
[JIRAT] Jiri Jirat, XLink Reference;
http://zvon.org/xxl/xlink/Output/xlink_refs.html
[MALER] Eve Maler, XLink and Xpointer Overview; http://www.oasis-
open.org/cover/xlinkMaler980402.html
[ST LAURENT] Simon St.Laurent, XLinkFilter: An Open Source Java XLink
SAX Parser Filter; http://www.simonstl.com/projects/xlinkfilter/index.html
[vdVLIST] Eric van der Vlist, XML Linking Technologies;
http://www.xml.com/pub/2000/10/04/linking/index.html
[XMLCOM] XML Resource Guide: XLink;
http://www.xml.com/pub/Guide/XLink

You might also like