Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This project has relocated to the Ruby-RDF organization:

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gemspec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .yardopts
Octocat-spinner-32 AUTHORS
Octocat-spinner-32 README Changed README format from RDoc to Markdown. December 20, 2009
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 UNLICENSE Unlicensed the project into the public domain. December 20, 2009
Octocat-spinner-32 VERSION
README.md

RDF.rb: RDF API for Ruby

This is a pure-Ruby library for working with Resource Description Framework (RDF) data.

About the Resource Description Framework (RDF)

Examples

require 'rdf'

Creating an RDF statement

s = RDF::URI.parse("http://gemcutter.org/gems/rdf")
p = RDF::DC.creator
o = RDF::URI.parse("http://ar.to/#self")

stmt = RDF::Statement.new(s, p, o)

Using pre-defined RDF vocabularies

include RDF

DC.title      #=> RDF::URI("http://purl.org/dc/terms/title")
FOAF.knows    #=> RDF::URI("http://xmlns.com/foaf/0.1/knows")
RDFS.seeAlso  #=> RDF::URI("http://www.w3.org/2000/01/rdf-schema#seeAlso")
RSS.title     #=> RDF::URI("http://purl.org/rss/1.0/title")
OWL.sameAs    #=> RDF::URI("http://www.w3.org/2002/07/owl#sameAs")
XSD.dateTime  #=> RDF::URI("http://www.w3.org/2001/XMLSchema#dateTime")

Using ad-hoc RDF vocabularies

foaf = RDF::Vocabulary.new("http://xmlns.com/foaf/0.1/")
foaf.knows    #=> RDF::URI("http://xmlns.com/foaf/0.1/knows")
foaf[:name]   #=> RDF::URI("http://xmlns.com/foaf/0.1/name")
foaf['mbox']  #=> RDF::URI("http://xmlns.com/foaf/0.1/mbox")

Documentation

Download

To get a local working copy of the development repository, do:

% git clone git://github.com/bendiken/rdf.git

Alternatively, you can download the latest development version as a tarball as follows:

% wget http://github.com/bendiken/rdf/tarball/master

Requirements

Installation

The recommended installation method is via RubyGems. To install the latest official release from Gemcutter, do:

% [sudo] gem install rdf

Resources

Author

License

RDF.rb is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.

Something went wrong with that request. Please try again.