Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 17 in printed book and digital formats -- plus a one-year subscription (beginning with 18.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now

Issue 3.2


Database XML

Storing RDF/XML in a relational database

Issue: 3.2 (November/December 2004)
Author: Mark Choate
Author Bio: Mark Choate is an author and consultant residing in Raleigh, North Carolina.
Article Description: No description available.
Article Length (in bytes): 37,280
Starting Page Number: 20
Article Number: 3211
Resource File(s):

Download Icon 3211.zip Updated: 2013-03-10 14:34:12

Related Web Link(s):


Excerpt of article text...

I recently developed an RDF schema editor written in REALbasic with the Valentina database, which is available as a plugin for REALbasic. If you are not familiar with RDF, it is an XML specification adopted by the Semantic Web activity group of the W3 Consortium which I will explain in more detail a little later on. Since RDF is XML, and storing XML in a relational database creates some interesting challenges, particularly in the area of validation, this article will review a database table wrapper class I developed to overcome the problems I encountered. While the class was originally developed to store XML data in a Valentina database, it can be useful for other projects as well, especially those with difficult data validation requirements. For the purposes of this article, I modified the code so that it can be used with both Valentina and REALdatabase and use examples intended for use with REALdatabase throughout the article.

Before examining the class in detail, I need to provide some background information on the kind of validation that was required by RDF. With the release of REALbasic 5.5, REALbasic's REALdatabase is available to everyone, not just owners of the professional edition. Since databases with REALbasic may be new to many of you, I'll step through the process of creating one of the tables using REALdatabase and RB's powerful control-binding abilities. I'll also show how to create the table in Valentina, while discussing the relative strengths of both tools.

With that out of the way, I'll review the mwDataObject class I developed to handle validation and changes to the table, and show a basic example of how it can be used in generic situations.

This article is the first of two. In next month's issue, the second article will focus on using REALbasic's new XML classes for parsing RDF files, validating those files using RDF schema, and both inserting XML data into the database, and exporting XML from the database.

Resource Description Framework

I assume that most of you are familiar with XML, since it's everywhere, so I won't belabor the topic. I will, however, spend some time with RDF, which is used most commonly for keeping track of document metadata in order to make collections of documents easier to sort and search through. It uses a somewhat unique approach that some people find confusing, but in my experience, it turns out to be one of those things that is much simpler than it seems at first glance.

...End of Excerpt. Please purchase the magazine to read the full article.