Monday, April 16, 2007

XML Schema validation for RDF

pencil icon, that"s clickable to start editing the post

In my last post Excuse me, where do I find the Semantic Web - did I miss a turn back there? I wondered whether it was possible to do XML Schema validation of RDF. Later a found and example of it by Dave Beckett on the page W3C XML Schemas for simple DC in RDF/XML. This most certainly shows that it's possible, but also that it'll either be very lax or has to be very context specific, in this example for Simple Dublic Core (look also at the referenced page Expressing Simple Dublin Core in RDF/XML).

Another funny thing I found through this is that there is a DTD for XML Schema at the W3C website. I'm not sure if this is for any practical use, but David uses it. As a side note the XML Schema for Simple Dublin Core Metadata Element Set 1.1 in RDF/XML (For Information Only) imports both the XML og XML Schema namespaces, and I dislike seeing that. I'm not sure about the validity, but it's weird because if your using XML the processor has to know about the inner workings of XML og else it'll just have to show it as plain text, and the same goes for XML Schema, what's this information worth for the XML Schema Processor (that should know something about XML Schema like for a start the namespace):

<import namespace="http://www.w3.org/XML/1998/namespace" 
        schemaLocation="http://www.w3.org/2001/xml.xsd">
  <annotation>

    <documentation xml:lang="en">
      Get access to the xml: attribute groups for xml:lang
      as declared on various elements below
    </documentation>
  </annotation>
</import>

<import namespace="http://www.w3.org/2000/10/XMLSchema" 
        schemaLocation="http://www.w3.org/2001/XMLSchema.xsd">

  <annotation>
    <documentation xml:lang="en">
      Get access to the XML Schema for 2001-05-02 W3C REC
    </documentation>
  </annotation>
</import>

Okay, after my blood cooled down, I had a look at the schemas and the one for XML is not be wrong at all. As summerized in the page about the "xml:" Namespace and here's a link to the usage of 'xml:lang' in the current XML spec, where it states:

A special attribute named xml:lang may be inserted in documents to specify the language used in the contents and attribute values of any element in an XML document. In valid documents, this attribute, like any other, MUST be declared if it is used.

It can also be read in the first <xs:documentation>: element of the XSD for XML:

   See http://www.w3.org/XML/1998/namespace.html and
   http://www.w3.org/TR/REC-xml for information about this namespace.

    This schema document describes the XML namespace, in a form
    suitable for import by other schema documents.  

    Note that local names in this namespace are intended to be defined
    only by the World Wide Web Consortium or its subgroups.  The
    following names are currently defined in this namespace and should
    not be used with conflicting semantics by any Working Group,
    specification, or document instance:

    base (as an attribute name): denotes an attribute whose value
         provides a URI to be used as the base for interpreting any
         relative URIs in the scope of the element on which it
         appears; its value is inherited.  This name is reserved
         by virtue of its definition in the XML Base specification.

    id   (as an attribute name): denotes an attribute whose value
         should be interpreted as if declared to be of type ID.
         The xml:id specification is not yet a W3C Recommendation,
         but this attribute is included here to facilitate experimentation
         with the mechanisms it proposes.  Note that it is _not_ included
         in the specialAttrs attribute group.

    lang (as an attribute name): denotes an attribute whose value
         is a language code for the natural language of the content of
         any element; its value is inherited.  This name is reserved
         by virtue of its definition in the XML specification.
  
    space (as an attribute name): denotes an attribute whose
         value is a keyword indicating what whitespace processing
         discipline is intended for the content of the element; its
         value is inherited.  This name is reserved by virtue of its
         definition in the XML specification.

    Father (in any context at all): denotes Jon Bosak, the chair of 
         the original XML Working Group.  This name is reserved by 
         the following decision of the W3C XML Plenary and 
         XML Coordination groups:

             In appreciation for his vision, leadership and dedication
             the W3C XML Plenary on this 10th day of February, 2000
             reserves for Jon Bosak in perpetuity the XML name
             xml:Father

And what of an easter egg that came last, the xml:Father for Jon Bosak - I'm curious whether any XML processor supports that :-).

Read more

Friday, April 13, 2007

Excuse me, where do I find the Semantic Web - did I miss a turn back there?

pencil icon, that"s clickable to start editing the post

Until now I've had an won't touch that attitude towards the soft semantic markup, but that might be about to change.

Sorry, I'm a data-head so almost per instinct I've been skeptic about all that talk about semantics. In the world of XML people can often find them self in either the data og the document camp, based on what kind of business they're doing. I haven't thought of it before, but what about those who work with the semantic stuff and feels comfortable with terms like taxonomies, thesauri, onthologies? I think I'll put them in the doc camp per default.

I haven't worked with semantics/knowledge management and neither followed the standards. The last time I looked was at RDF a couple of years ago and it frightened me, but I've decided to look at it again. As goes the semantic web it didn't work out quite they way that some originally presented it and the speed of adoption has been relative slow - that's in my un-knowlegdeable wisdom. Things take time and a parallel to the webservice hype is not that far of, it takes time and during that time it twists and turns, while we get wiser and the big players fight it out. On the other hand I'm sure that the semantic web is a reality for some people doing work on knowledge management and artificial intelligence and probably also other lines of work.

At the Semantic Web overview page at W3C, which does give both a quick and good overview, the introduction states:

The Semantic Web is about two things. It is about common formats for integration and combination of data drawn from diverse sources, where on the original Web mainly concentrated on the interchange of documents. It is also about language for recording how the data relates to real world objects. That allows a person, or a machine, to start off in one database, and then move through an unending set of databases which are connected not by wires but by being about the same thing.

Hey, hey man I do work on integration and combination of data drawn from diverse sources and I also tend to work with how the data relates to real world objects. Could this mean that it's all different than i thought? maybe, and in some ways I'm certainly wrong and in others in probably not that far off - time will tell.

As mentioned previously the last time I looked into this was some time ago, but I did keep a printed version of two great guides from Stefano Mazzocchi blog:

There is no way around RDF, and as Stefano has written in the presentation A no-nonsense introduction to "semantic web" technologies:

RDF
• Resource Description Framework
• W3C Recommendation since 1998 (as old as XML!)
• Misunderstood for years as a very complicated way of embedding metadata into XML documents

Why misunderstood?
• Original specification was extremely formal
• “what is this good for” was nowhere to be found (somewhat taken for granted by the people that designed it)
• The RDF/XML serialization obscured the value of the graph data model
• XML seemed to solve the same problems and was much easier to understand

The real problem is that RDF was conceived as a solution to a problem people didn’t have:
data interoperability at a world-wide scale

The SW page points to Dave Beckett's Resource Description Framework (RDF) Resource Guide (planetrdf) where there's a link to an attempt by TBL to explain the XML versus RDF from both sides, that's part of his Design Issues - Architectural and philosophical points:

I'll start with the RDF Primer and twist the example to concern me:

<?xml version="1.0"?>
<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:dcel="http://purl.org/dc/elements/1.1/">
  <rdf:Description rdf:about="http://blog.sweetxml.org/">
    <dcel:creator rdf:resource="http://www.linkedin.com/in/sweetxml" />
  </rdf:Description>
</rdf:RDF>

The definition of the Dublin Core element creator is in the Dublin Core Metadata Element Set, Version 1.1.

There is no XML schema for RDF (there is a strange version at the W3C website, in an old version of XML Schema) and I haven't figured out if it's even possible/practical since it will require many wildcards (xsd:any) to allow for al kinds of custom elements like the creator. But RDF files can be validated (and visualized) with the W3C RDF Validation Service.

That's all for now and it's all to clear for me how long and troublesome my journey into this will be.

Read more

WS-BPEL 2.0 and Oasis Standard

pencil icon, that"s clickable to start editing the post

Well it's standards time at Oasis, on 12 April 2007 Oasis annonced that it's members have approved the Web Services Business Process Execution Language (WS-BPEL) version 2.0 as an OASIS Standard. I new got into the former version but I expect this to be important since there is much focus at the process level of SOA and standards that support that are needed, and even bette all the big companies seem to support it, guanteering that it's actually be supported by products at some time.

At the homepage of OASIS Web Services Business Process Execution Language (WSBPEL) TC there is only links (not clickable) to the Committee Specification, but as I read it I hasn't changed to the final standard (do they ever?):

The specification may not have been changed between its approval as a Committee Specification and its submission to OASIS for consideration as an OASIS Standard, except for the changes on the title page and running footer noting the approval status and date.

Here they are and clickable:

Web Services Business Process Execution Language Version 2.0
http://docs.oasis-open.org/wsbpel/2.0/CS01/wsbpel-v2.0-CS01.doc
http://docs.oasis-open.org/wsbpel/2.0/CS01/wsbpel-v2.0-CS01.html
http://docs.oasis-open.org/wsbpel/2.0/CS01/wsbpel-v2.0-CS01.pdf

Schemas:
http://docs.oasis-open.org/wsbpel/2.0/CS01/plnktype/ws-bpel_plnktype.xsd
http://docs.oasis-open.org/wsbpel/2.0/CS01/process/abstract/ws-bpel_abstract_common_base.xsd
http://docs.oasis-open.org/wsbpel/2.0/CS01/process/executable/ws-bpel_executable.xsd
http://docs.oasis-open.org/wsbpel/2.0/CS01/serviceref/ws-bpel_serviceref.xsd
http://docs.oasis-open.org/wsbpel/2.0/CS01/varprop/ws-bpel_varprop.xsd

There's also a promising intro under the headline Want to learn more about WS BPEL 2.0? that I'll hopefully get some time to look into later.

Read more

Wednesday, April 11, 2007

Going Skype on Fedora Core Level 6

pencil icon, that"s clickable to start editing the post
I've finally created an account for Skype and did a quick accept of the license and conditions: I sure hope that there's nothing nasty in them and expect that the wisdom of the crowd would have made a storm over it otherwise. Getting it running on my Linux box (Fedora Core Level 6) was very easy, except for enabling capturing. There's a guide called Skype for Linux Repositories that shows how to add a Skype repository, so that it can be installed and maintained with yum. Eventhough it installs skype-1.3.0.53-fc5 it works without a glitch (so far) on level 6. My only problem was getting the mic to work or more precisely to capture from the mic. I use a Logitech USB 350 headset, primarily for listening to music but I've also tried it for VOIP with SJLabs softphone,SJphone. The Skype Test Call went though and I heard the intro, I could here myself speaking but it was not echoed. I did some googling and found a related post about it: mic recording alsa arecord. The answer was right, but in a more tricky way because of a UI buf in alsamixer. Here's what is shown with view set to all

where it's not clear whether capturing is enabled (can be enabled/disable with space), but if I switch to only capturing

it's clear.

The output with the amixer commandline tool was before:
Simple mixer control 'Mic',0
  Capabilities: pvolume pvolume-joined cvolume pswitch pswitch-joined cswitch cswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: Playback 0 - 464 Capture 0 - 13
  Mono: Playback 464 [100%] [-13.16dB] [on] Capture 13 [100%] [29.00dB] [off]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 44
  Mono:
  Front Left: Playback 18 [41%] [-23.00dB] [on]
  Front Right: Playback 17 [39%] [-24.00dB] [on]
and afterwards (I've highlighted the difference):
Simple mixer control 'Mic',0
  Capabilities: pvolume pvolume-joined cvolume pswitch pswitch-joined cswitch cswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: Playback 0 - 464 Capture 0 - 13
  Mono: Playback 464 [100%] [-13.16dB] [on] Capture 13 [100%] [29.00dB] [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 44
  Mono:
  Front Left: Playback 17 [39%] [-24.00dB] [on]
  Front Right: Playback 17 [39%] [-24.00dB] [on]

Read more

Tuesday, April 10, 2007

Completely valid XHTML with Minima Stretch - changing to a simpler layout for Blog Archive

pencil icon, that"s clickable to start editing the post

A couple of days ago i gave the Minima Stretch my best go for producing valid XHTML (see Almost valid XHTML with Minima Stretch). I was able to reduce the number of errors to 24, but the Blog Archive Widget had to be rewritten heavily and I'm not even sure that it can be done. Today I got another thought - what about a diffent style for my Blog Archive since it might help with a more simple widget. The result was great, where Hierarchy gave me 24 errors both Flat List and Dropdown Menu didn't give any errors resulting in -> valid XHTML!

Completely

Read more