Skip to content

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

to-rdf

A small gem to serialize Ruby objects as RDF.

Example use

require 'to_rdf'
require 'uri'

class Actor

  include ToRdf

  attr_accessor :name, :id

  def uri
    URI("http://example.com/actors/#{id}")
  end

  def type_uri
    URI("http://example.com/schema/Actor")
  end

  def rdf_mapping
    {
      "foaf:name" => name
    }
  end
end

actor = Actor.new
actor.id = 1
actor.name = "John Doe"
actor.to_rdf

About

A small gem to serialize Ruby objects as RDF

Resources

Security policy

Stars

3 stars

Watchers

25 watching

Forks

Releases

Packages

Used by

Contributors

Languages