开发者

Parsing rdf schema in ruby

I defined rdf schema like this, ]>

<rdfs:Class rdf:ID="User"/>

<rdf:Property rdf:ID="firstName">
    <rdfs:domain rdf:resource="#User"/>
</rdf:Property>
<rdf:Property rdf:ID="lastName">
    <rdfs:domain rdf:resource="#User"/>
</rdf:Property>
<rdf:Property rdf:ID="email">
    <rdfs:domain rdf:resource="#User"/>
</rdf:Property>
<rdf:Property rdf:ID="password">
    <rdfs:domain rdf:resource="#User"/>
</rdf:Property>

any RDF Schema Parser available in ruby so that I can parse this schema and take out class information as well as properties information?

Or Do I need to implement an XML parser that will iterate though classes and property elements defined in this schema?

I am sure that SPARQL is not used to query the schema instead it is used to query the rdf data and hence we should not use SPARQL to get the classes and properties data.

Please let me know hot to parse this rd开发者_如何学Gof schema?


The most active Ruby parser for RDF appears to be RDF.rb: https://github.com/bendiken/rdf

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜