XML observations: Using XML to describe open source project 4

Source: Internet
Author: User
Tags resource xmlns xslt

In the previous three articles in this series, I discussed the development of the XML/RDF glossary DOAP, DOAP used to describe the development of source code projects and some of the related resources. By using DOAP, software maintainers no longer need to register their programs on multiple Web sites. Instead, they can simply give the URL of the DOAP description. As more applications become DOAP-aware applications, participating in and managing open source projects opens up new possibilities.

To achieve these goals, it is important to do more than just create a glossary. In this concluding article, I look at some of the things I need to adopt DOAP from a few aspects of documentation, tools, and communities.

View DOAP

To evoke your memory, here's a simple DOAP file--Listing 1 shows a very small DOAP file for the DOAP project itself.

Listing 1. A simple DOAP description of the DOAP project itself

<project xmlns= "http://usefulinc.com/ns/doap#"
xmlns:rdf= "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:foaf= "HTTP://XMLNS.COM/FOAF/0.1/" >
<name>DOAP</name>
<created>2004-05-04</created>
<shortdesc xml:lang= "en" >
Tools and vocabulary for describing community-based
Software projects.
</shortdesc>
<description xml:lang= "en" >
DOAP (Description of a Project) is an RDF vocabulary and
Associated set of tools for describing community-based software
Projects. It is intended to be a interchange vocabulary for
Software directory Sites, and to allow the decentralized
Expression of involvement in a project.
</description>
<maintainer>
<foaf:Person>
<foaf:name>edd dumbill</foaf:name>
<foaf:homepage rdf:resource= "Http://usefulinc.com/edd"/>
</foaf:Person>
</maintainer>
</Project>

The first and most basic requirement for DOAP users is to obtain a user-friendly view of the data. If there are no other editing mechanisms, you can edit a file manually, and then use the viewer to check the file--many WEB sites are created with this age-old and admittedly problematic method. The quickest way to create a viewer might be to write an XSLT style sheet that converts incoming rdf/xml to HTML.

However, DOAP is more than just an XML glossary, which means that using XSLT is not a simple decision. The viewer can be used for more than one purpose: it not only provides a view of DOAP data, but is also the first example of a DOAP processing application. As a result, many of the first encounters with DOAP are taken as an example. Therefore, it is helpful if the DOAP Viewer is an RDF-aware application.

To create a viewer, I use the Redland RDF application Library to read the DOAP file into an in-memory RDF store, extract the data from the store into the XML, and then format the XML with XSLT. This intermediate XML representation can be converted to HTML on a server-side application or a graphical user interface that can be used to drive the client DOAP Viewer. Figure 1 shows the converted HTML output from the viewer.

Figure 1. DOAP Output after conversion

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.