|
From: HARUYAMA S. <har...@qu...> - 2002-12-04 10:44:25
|
RAA(http://www.ruby-lang.org/en/raa.html)の情報をCodeRidgeの内部表現に するテストプログラムを作成しました。 (微妙におかしい気がしますが) http://www.unixuser.org/%7Eharuyama/tmp/RAAInfo20021204.tar.bz2 *****README***** RAAの情報をCodeRidgeの内部表現に変換する ---------- 内容: RAAGetInfoFromName.java 指定した名前のソフトウェアの情報を その名前のファイル('/'は'_'に変更)に書き出す RAAのWSDL(下記)をAxisのWSDL2Javaしたクラス群と Axisのjarに依存 (% java RAAGetInfoFromName goRua) RAAInfoToUriAndTripleArray.java ファイルからRAA.Info形式のソフトウェアを 読みorg.fanal.coderidge.UriAndTripleArray に変換する。 上の加えて、FANAL,coderidge-soap,coderidge-rdf のjarに依存 (% java RAAInfoToUriAndTripleArray goRua) data/ RAAGetInfoFromName で得たいくつかのRAA.Infoなインスタンス ---------- CodeRidgeでは、ソフトウェア開発者にソフトウェアの情報を集めたRDFファイルを 用意してもらいこれを読みこんで検索に使用する。(内部での表現は N-Tripleである。) (参照: http://coderidge.org/doc/coderidge-rdf.pdf) 従来型のソフトウェアマップとの連携をする場合、そのソフトウェアマップでの 情報の表現をCodeRidgeの表現に変換する必要がある。 ソフトウェアの情報を加工しやすい形で提供しているソフトウェアマップには ・ RAA ・ Freshmeat があった。(他はまだ調査していない) * RAA Ruby Application Archive(RAA)はSOAPのインタフェイスやXML表現を提供している。 SOAPインタフェイスのWSDLが http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.1/ で得られる。 これをAxis(http://xml.apache.org/axis/)のWSDL2Javaで変換してJavaで利用することができる。 現在定義されているメソッドは ########## getAllListings() # => Array of String(product name) getProductTree() # => Hash(major category) of Hash(minor category) of Array of String(product name) getInfoFromCategory( Category|Struct::Category category ) # => Array of Info getModifiedInfoSince( Date|Time time ) # => Array of Info getInfoFromName( String name ) # => Info ########## で、動的にCodeRidgeの検索に組みこむのは難しい。適当なキャッシュをすることになるだろう。 ---------- org.ruby_lang.www.Infoの例 Owner: id: (int)249 name: HARUYAMA Seigo email: mailto:har...@un... Category: major: Application minor: WWW Product: id: (int)383 name: goRua version: 0.15 status: beta homepage: http://www.unixuser.org/%7Eharuyama/software/goRua/ download: http://www.unixuser.org/%7Eharuyama/software/goRua/ license:GPL description: goRua (Gtk+ on Ruby User Agent for 2ch) is the browser of the huge bbs, 2ch (http://www.2ch.net), and 2ch-like systems.? update: (java.util.Calendar) ---------- idや名前(の一部)の一意性はRAAが保ってくれると期待してよいだろうとして RAAInfoToUriAndTripleArray は次のような変換をしてみた。 (実際の変換結果は N-Triple.) * RAA.Owner -> http://coderidge.org/schemas/author/1.0# <rdf:Description about="urn:raa:owner(author?):(raa_id)"> ... * RAA.Category -> http://coderidge.org/schemas/category/1.0# <rdf:Description about="urn:category:internal:raa:Application/WWW"> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> <!-- リソースにしたほうがよいか? --> <rdf:li parseType="Literal">Application</rdf:li> <rdf:li parseType="Literal">WWW</rdf:li> </http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag> </http://www.w3.org/1999/02/22-rdf-syntax-ns#type> </rdf:Description> * RAA.Info、Product -> http://coderidge.org/schemas/core/1.0# <rdf:Description about="http://coderidge.org/registry/raa/(product_id)"> ... ---------- 変換結果 Tripleの配列 [http://coderidge.org/registry/raa/383,http://coderidge.org/schemas/core/1.0#Author,urn:raa:owner:249] [urn:raa:owner:249,http://coderidge.org/schemas/author/1.0#Name,"HARUYAMA Seigo"] [urn:raa:owner:249,http://coderidge.org/schemas/author/1.0#Email,"mailto:har...@un..."] [http://coderidge.org/registry/raa/383,http://coderidge.org/schemas/core/1.0#Category,urn:category:internal:raa:Application/WWW] [urn:category:internal:raa:Application/WWW,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag] [urn:category:internal:raa:Application/WWW,http://www.w3.org/1999/02/22-rdf-syntax-ns#_1,"Application"] [urn:category:internal:raa:Application/WWW,http://www.w3.org/1999/02/22-rdf-syntax-ns#_2,"WWW"] [http://coderidge.org/registry/raa/383,http://coderidge.org/schemas/core/1.0#Name,"goRua"] [http://coderidge.org/registry/raa/383,http://coderidge.org/schemas/core/1.0#Version,"0.15"] [http://coderidge.org/registry/raa/383,http://coderidge.org/schemas/core/1.0#Status,"beta"] [http://coderidge.org/registry/raa/383,http://coderidge.org/schemas/core/1.0#Homepage,"http://www.unixuser.org/%7Eharuyama/software/goRua/"] [http://coderidge.org/registry/raa/383,http://coderidge.org/schemas/core/1.0#Download,"http://www.unixuser.org/%7Eharuyama/software/goRua/"] [http://coderidge.org/registry/raa/383,http://coderidge.org/schemas/core/1.0#License,"GPL"] [http://coderidge.org/registry/raa/383,http://coderidge.org/schemas/core/1.0#Description,"goRua (Gtk+ on Ruby User Agent for 2ch) is the browser of the huge bbs, 2ch (http://www.2ch.net), and 2ch-like systems. "] [http://coderidge.org/registry/raa/383,http://coderidge.org/schemas/core/1.0#UpdatedTime,"Wed Sep 11 01:33:13 JST 2002"] 見やすくしたもの: http://coderidge.org/schemas/core/1.0#Name: goRua http://coderidge.org/schemas/core/1.0#Author: urn:raa:owner:249 http://coderidge.org/schemas/core/1.0#Download: http://www.unixuser.org/%7Eharuyama/software/goRua/ http://coderidge.org/schemas/core/1.0#Status: beta http://coderidge.org/schemas/core/1.0#License: GPL http://coderidge.org/schemas/core/1.0#Homepage: http://www.unixuser.org/%7Eharuyama/software/goRua/ http://coderidge.org/schemas/core/1.0#Category: urn:category:internal:raa:Application/WWW http://coderidge.org/schemas/core/1.0#Description: goRua (Gtk+ on Ruby User Agent for 2ch) is the browser of the huge bbs, 2ch (http://www.2ch.net), and 2ch-like systems. http://coderidge.org/schemas/core/1.0#Version: 0.15 http://coderidge.org/schemas/core/1.0#UpdatedTime: Wed Sep 11 01:33:13 JST 2002 |
|
From: HARUYAMA S. <har...@qu...> - 2002-12-05 06:05:04
|
Message-ID:<m3z...@ho...> Subject:[Coderidge-devel-ja] RAAの情報をCodeRidgeの内部表現に にて HARUYAMA Seigo <har...@qu...> さんは書きました。 春山> ソフトウェアの情報を加工しやすい形で提供しているソフトウェアマップには 春山> ・ RAA 春山> ・ Freshmeat 春山> があった。(他はまだ調査していない) Freahmeatは http://freshmeat.net/projects-xml/{projectname_short}/{projectname_short}.xml (例: http://freshmeat.net/projects-xml/nut/nut.xml http://freshmeat.net/projects-xml/fw/fw.xml ) にてプロジェクト情報を配っています。 -- 春山 征吾 / HARUYAMA Seigo har...@un... har...@qu... |
|
From: HARUYAMA S. <har...@qu...> - 2002-12-09 07:05:20
|
Message-ID:<m3z...@ho...> Subject:[Coderidge-devel-ja] RAAの情報をCodeRidgeの内部表現に にて HARUYAMA Seigo <har...@qu...> さんは書きました。 春山> org.ruby_lang.www.Infoの例 春山> Owner: 春山> id: (int)249 春山> name: HARUYAMA Seigo 春山> email: mailto:har...@un... 春山> Category: 春山> major: Application 春山> minor: WWW 春山> Product: 春山> id: (int)383 春山> name: goRua 春山> version: 0.15 春山> status: beta 春山> homepage: http://www.unixuser.org/%7Eharuyama/software/goRua/ 春山> download: http://www.unixuser.org/%7Eharuyama/software/goRua/ 春山> license:GPL 春山> description: goRua (Gtk+ on Ruby User Agent for 2ch) is the browser of the huge bbs, 2ch (http://www.2ch.net), and 2ch-like systems.? 最近 short_description が追加された模様です。 Productクラスを更新しないとExceptionがでます。 http://www.ruby-lang.org/xmlns/soap/interface/RAA/0.0.1/ で <complexType name="Product"> <all> <element name="id" type="int"/> ... <element name="description" type="string"/> + <element name="short_description" type="string"/> </all> </complexType> したもので使えています。 春山> update: (java.util.Calendar) -- 春山 征吾 / HARUYAMA Seigo har...@un... har...@qu... |
|
From: HARUYAMA S. <har...@qu...> - 2002-12-09 07:17:49
|
Message-ID:<m3k...@ho...> Subject:Re: [Coderidge-devel-ja] RAAの情報をCodeRidgeの内部表現に にて HARUYAMA Seigo <har...@qu...> は書きました。 春山> 最近 short_description が追加された模様です。 春山> Productクラスを更新しないとExceptionがでます。 対応させたTriple作成ツールを http://www.unixuser.org/%7Eharuyama/tmp/RAAInfo20021209.tar.bz2 に置きました。 -- 春山 征吾 / HARUYAMA Seigo har...@un... har...@qu... |
|
From: HARUYAMA S. <har...@qu...> - 2002-12-11 11:03:33
|
Message-ID:<m3o...@ho...> Subject:[Coderidge-devel-ja] Freshmeat にて HARUYAMA Seigo <har...@qu...> は書きました。 春山> Freahmeatは 春山> http://freshmeat.net/projects-xml/{projectname_short}/{projectname_short}.xml 春山> (例: 春山> http://freshmeat.net/projects-xml/nut/nut.xml 春山> http://freshmeat.net/projects-xml/fw/fw.xml 春山> ) CodeRidge RDFもどきにする XSLTを書いてみました。 XSLTは使ったことがなかったので、汚ないかもしれません。 (xalan-j 2.4.1 を利用しましたが、elementの動的な名前付けが うまくいきませんでした) ---------- <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:core="http://coderidge.org/schemas/core/1.0#" version="1.0"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" encoding="UTF-8"/> <xsl:template match="project-listing"> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:core='http://coderidge.org/schemas/core/1.0#'> <xsl:apply-templates select="project"/> </rdf:RDF> </xsl:template> <xsl:template match="project"> <rdf:Description> <xsl:attribute name="about">http://freshmeat.net/projects-xml/<xsl:value-of select="projectname_short"/>/<xsl:value-of select="projectname_short"/>.xml</xsl:attribute> <xsl:apply-templates select="*"/> </rdf:Description> </xsl:template> <xsl:template match="*"> <xsl:choose> <xsl:when test="name(.)='project_id'"></xsl:when> <xsl:when test="name(.)='projectname_full'"> <xsl:element name="core:Name"> <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="name(.)='license'"> <xsl:element name="core:License"> <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="name(.)='url_homepage'"> <xsl:element name="core:Homepage"> <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test="name(.)='desc_full'"> <xsl:element name="core:Description"> <xsl:value-of select="."/> </xsl:element> </xsl:when> <xsl:when test=".=''"></xsl:when> <xsl:otherwise> <!-- <xsl:element name="name(.)"/> --> <xsl:text disable-output-escaping="yes"> <core:</xsl:text><xsl:value-of select="name(.)"/><xsl:text disable-output-escaping="yes">></xsl:text><xsl:value-of select="."/> <xsl:text disable-output-escaping="yes"></core:</xsl:text><xsl:value-of select="name(.)"/><xsl:text disable-output-escaping="yes">></xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet> ---------- これで たとえば http://freshmeat.net/projects-xml/fmnews/fmnews.xml を変換すると ---------- <rdf:RDF xmlns:core="http://coderidge.org/schemas/core/1.0#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description about="http://freshmeat.net/projects-xml/fmnews/fmnews.xml"> <core:date_added>2002-12-10 20:46:31</core:date_added> <core:date_updated>2002-12-10 21:47:08</core:date_updated> <core:projectname_short>fmnews</core:projectname_short><core:Name>fmnews</core:Name> <core:desc_short>Grabs news from freshmeat's backend storage.</core:desc_short><core:Description>fmnews grabs news from freshmeat's backend storage and displays it with ANSI colors.</core:Description> <core:vitality_score>0.00</core:vitality_score> <core:vitality_percent>0.00</core:vitality_percent> <core:popularity_score>0.00</core:popularity_score> <core:popularity_percent>0.00</core:popularity_percent> <core:rating>0.00</core:rating> <core:rating_count>0</core:rating_count> <core:subscriptions>0</core:subscriptions> <core:branch_name>Default</core:branch_name><core:Homepage>http://freshmeat.net/redir/fmnews/35404/url_homepage/</core:Homepage> <core:url_tgz>http://freshmeat.net/redir/fmnews/35404/url_tgz/</core:url_tgz><core:License>Free for non-commercial use</core:License> <core:latest_version>1.0</core:latest_version></rdf:Description> </rdf:RDF> ---------- となります。 -- 春山 征吾 / HARUYAMA Seigo har...@un... har...@qu... |
|
From: HARUYAMA S. <har...@qu...> - 2002-12-25 11:18:55
|
Message-ID:<m3d...@ho...>
Subject:Re: [Coderidge-devel-ja] Freshmeat
にて
HARUYAMA Seigo <har...@qu...> さんは書きました。
Fleshmeatのxmlを CodeRidge 検索用RDFと 表示用XHTMLにする
xsltを書きました。RDFについてはまだ変更する必要があると思います。
春山> CodeRidge RDFもどきにする XSLTを書いてみました。
春山> XSLTは使ったことがなかったので、汚ないかもしれません。
春山> (xalan-j 2.4.1 を利用しましたが、elementの動的な名前付けが
春山> うまくいきませんでした)
これは {}でかこむことで解決しました。> Thanks to 上野さん
http://www.unixuser.org/%7Eharuyama/P2P/snapshot/GetAndTransformFMInfo/
にあります。
まとめたものは
http://www.unixuser.org/%7Eharuyama/P2P/snapshot/GetAndTransformFMInfo20021225.tar.bz2
です。
fmToRDF.xsl fmToXHTML.xsl: それぞれに変換するための xsl ファイルです。
GetAndTransformFMInfo.java:
HTTPで FreahMeatの xmlを得て
Xalan-j (http://xml.apache.org/xalan-j/) を利用して
RDFとXHTMLに変換します。
$ java GetAndTransformFMInfo mplayer fmToRDF.xsl fmToXHTML.xsl
第一引数が Freahmeatの projectname_short,
第二引数が RDF用 xsl
第三引数が XHTML用 xsl
です。
--
春山 征吾 / HARUYAMA Seigo har...@un... har...@qu...
|
|
From: HARUYAMA S. <har...@qu...> - 2002-12-26 07:31:36
|
RAAの情報を変換するテストを行ないました。
----------
RAAToRDF.xsl
RAAToXHTML.xsl : それぞれ 後述のXML表現から CodeRidge RDF,XHTMLに変換する
XSLファイル
http://www.unixuser.org/~haruyama/P2P/snapshot/RAAInfo/
RAAGetInfoFromName: SOAPでRAAの情報を入手し、java.beans.XMLEncoderで
XMLにします。
$ java RAAGetInfoFromName gurgle
RAADecodeXMLTest: XMLから java.beans.XMLDecoderでオブジェクトに変換する
テストクラス
$ java RAADecodeXMLTest gurgle.xml
TransformRAAInfo: RAAのXMLファイルから RDF,XHTMLを作る
$ java TransformRAAInfo gurgle.xml RAAToRDF.xsl RAAToXHTML.xsl
--
春山 征吾 / HARUYAMA Seigo har...@un... har...@qu...
|
|
From: HARUYAMA S. <har...@qu...> - 2002-12-27 07:06:59
|
http://www-6.ibm.com/jp/developerworks/xml/020628/j_x-callbk.html を参考にして XSLTの拡張機能をつかって javaのクラスのメソッドからの返り値も使えるようにしました。 XSLUtil は long->Date Format変換と Location情報をします。 これを利用して RDFやXHTMLに情報を追加するようにしました。 http://www.unixuser.org/%7Eharuyama/P2P/snapshot/FMInfo/ http://www.unixuser.org/%7Eharuyama/P2P/snapshot/RAAInfo/ Xalan-j以外でうまくうごかない可能性があります。 -- 春山 征吾 / HARUYAMA Seigo har...@un... har...@qu... |