Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

the semantic web a gide to the future of XML, Web Services and Knowledge Management - Daconta M,C.

Daconta M,C. the semantic web a gide to the future of XML, Web Services and Knowledge Management - Wiley publishing , 2003. - 304 p.
ISBN 0-471-43257-1
Download (direct link): thesemanticwebguideto2003.pdf
Previous << 1 .. 50 51 52 53 54 55 < 56 > 57 58 59 60 61 62 .. 116 >> Next

128
Chapter 6
specification is similar to hyperlinks in HTML, but XLink goes far beyond the linking capabilities in HTML in offering advanced behavior features that make hyperlinking more flexible. XLink allows you to link multiple targets, roles, resources, and responses to elements.
A link is defined by the XLink W3C recommendation as "an explicit relationship between resources or portions of resources."1 It is made explicit by an XLink-conforming XML element. With XLink, not only can XML authors link external documents, but also elements can be linked to other elements, and the relationships between them can be linked. XLink-compliant links can be simple and complex. Listing 6.3 shows a simple example of XLink in use. As you can see, the example is quite similar to the <A> linking element in HTML.
<?xml version="1.0" encoding="UTF-8"?>
<doc>
<name xlink:type=’simple’
xlink:href=’instructors/busdriver.xml’>Clay Richardson</name> is an employee at
<company xlink:type=’simple’ xlink:href=’#mcbrad’>
McDonald Bradley, Inc.
</company>, and teaches
<course xlink:type=’simple’ xlink:href=’#CS593’>
Computer Science 593 </course>.
<employers>
<company id=’mcbrad’>McDonald Bradley</company>
<company id=’btg’>BTG</company>
<company id=’grumman’>Northrup Grumman</company>
<company id=’orionsci’>Orion Scientific</company>
</employers>
<courselist>
<course id='CSl41'>CS 141 - Intro to Comp Sci</course>
<course id=’CS444’>CS 444 - Operating Systems</course>
<course id=’CS593’>CS 593 - Object-Oriented Design</course>
<course id=’CS669’>CS 669 - Keeping it Real</course>
</courselist>
</doc>
Listing 6.3 Simple XLink example.
In Listing 6.3, we have an example that discusses employers and courses in a document. Throughout the XML file, the xlink:type attribute of the element is set to 'simple', and the xlink:href attribute is set to link to external documents and to elements within the document. This is the simplest example of linking.
1 http://www.w3.org/TR/xlink/-"XML Linking Language (XLink) Version 1.0," W3C Recommendation, June 27, 2001.
Understanding the Rest of the Alphabet Soup
129
XLink can also connect relationships together. If, for example, we wanted to link descriptions with our courses and employers, we could use the XLink 'extended' link type to connect our descriptions with our elements. A bit more complicated than the simple links shown in Listing 6.3, extended links allow arcs to describe relationships between elements and remote resources. Listing 6.4 shows an example of our simple XLink example from Listing 6.3 modified to incorporate relationships between some of the elements.
<?xml version="1.0" encoding="UTF-8"?>
<doc>
<extendedlink xlink:type=,extended,>
<loc xlink:type=,locator, xlink:label=,mcbrad, xlink:href=,#mcbrad,> </loc>
<loc xlink:type=,locator, xlink:label=,cs593,xlink:href=,#CS593,> </loc>
<loc xlink:type=,locator, xlink:label=,cs593description, xlink:href=,courses/cs593.xml,>
</loc>
<loc xlink:type=,locator, xlink:label=,mcbraddescription, xlink:href=,employers/mcbrad.xml,>
</loc>
<arc xlink:type=,arc, xlink:from=,cs593, xlink:to=,cs593description,> </arc>
<arc xlink:type=,arc, xlink:from=,mcbrad, xlink:to=, Æ
mcbraddescription,>
</arc>
</extendedlink>
<name xlink:type=,simple,
xlink:href=,instructors/busdriver.xml,>Clay Richardson</name> is an employee at <company xlink:type=,simple, xlink:href=,#mcbrad,>
McDonald Bradley, Inc.
</company>, and teaches
<course xlink:type=,simple, xlink:href=,#CS593,>
Computer Science 593 </course>
<employers>
<company id=,mcbrad,>McDonald Bradley</company>
<company id=,btg,>BTG</company>
</employers>
<courselist>
<course id=,CS141,>CS 141 - Intro to Comp Sci</course>
<course id=,CS444,>CS 444 - Operating Systems</course>
<course id=,CS593,>CS 593 - Object-Oriented Design</course>
<course id=,CS669,>CS 669 - Keeping it Real</course>
</courselist>
</doc>
Listing 6.4 An XLink example with element relationships.
Chapter 6
As you can see from the code in Listing 6.4, adding the <extendedlink> element with the xlink:type attribute of 'extended' allows us to make relationships between the elements. In the example, an 'arc' xlink:type attributes allow us to connect a course with its description, an employer, and a description.
What is XLink's importance? It is the W3C's recommendation for generic linking, and it is intended for use in hypertext systems. Languages such as Scalable Vector Graphics (SVG) and MathML use XLink for hypertext references. At this point, the Resource Directory Description Language (RDDL) uses XLink syntax to specify the relationship between URLs and other resources. It is the intention of the W3C that XLink be used for generic linking mechanisms in XML languages.
The future of XLink is still debatable. Although the final W3C recommendation for XLink was released in 2001, product adoption has been slow, and attention has been focused elsewhere.2 Because specifications like RDF and XTM also provide the concept of mapping associations between resources, it seems that more focus has been placed on those technologies than on XLink for describing associations. Last September, the XHTML community seemingly rejected XLink in XHTML 2.0, by developing another linking Working Draft called HLink. HLink "extends XLink use to a wider class of languages than those restricted to the syntactic style allowed by XLink."3 After HLink was developed, the W3C Technical Architecture Group (TAG) released an opinion, saying that XLink, not HLink, should be used for hypertext references in XHTML 2.0.4 Debates such as these have arisen within the XML community about the future of XLink. Regardless, there are some notable products, such as the DocZilla and Mozilla browsers, that use partial functionality of XLink.
Previous << 1 .. 50 51 52 53 54 55 < 56 > 57 58 59 60 61 62 .. 116 >> Next