Atom Syndication Format 1.0で記述されたフィードを、XSLTによってRDFに変換する実験です。
This is an experiment to transfer an Atom Syndication Format 1.0 feed to an RDF graph by an XSLT style sheet.
テスト用XSLTスタイルシート atom2rdf.xsl は、主として次のような変換を試みます。
rdf:parseType="Resource"属性を追加します。atom:entryについては、子要素にrss:itemを追加して内容を包含し、明示的にノード要素をつくります。link要素は、rel属性の値などに応じて、feedやitem要素のrdf:aboutとしたり、rel属性値をプロパティ名として扱います。type属性を持つ要素は、その値に応じてXMLLiteralとして扱ったり、外部リソースへのリンクとして扱います。atom:generatorはプロパティとみなせる属性とテキスト内容の両方を持つため、内容をrdf:value属性の値として変換します。Atomの語彙は(atom:feedを除いて)基本的にプロパティとして扱い、ノードの型にはRSS1.0などの語彙を充てています。
The XSLT style sheet atom2rdf.xsl will perform the following transformation (See the style sheet for detailed comment).
rdf:parseType="Resource" to some atom elements. Especially, rss:item will be added as child node of atom:entry so as to construct a nice RDF triple.atom:link elements will be transformed to rdf:about of parent node, or to a property element with rel attribute value for its name, according to the context.type attribute will be treated as plain literal, XMLLiteral or external link accordingly.atom:generator has both text content and property attributes that violates RDF. Thus its text content will be transformed to rdf:value attribute. All Atom 1.0 terms (except atom:feed) are regarded as property, and some RSS 1.0 classes are used to give a type to nodes.
Atom WikiのKnownAtomFeedsに掲載されているいくつかのAtom1.0フィードを、W3CのXSLTサービスを利用してこのXSLTでRDFに変換し、RDF Validatorで確認してみます。ひととおり、うまく行っていると思われます。
Here some 30 Atom 1.0 feeds listed on KnownAtomFeeds will be transformed to RDF graphs with this XSLT, via W3C's service, and validated with RDF Validator.
All of above transformed RDF's are valid as of 2005-07-26T12:00+09:00.