Class: EasyData::RDF::WOT

Inherits:
Namespaces show all
Defined in:
lib/data_models/namespaces/wot.rb

Constant Summary collapse

@@uri =
"http://www.xmlns.com/wot/0.1/"
@@properties =
{"assurance" => "",
"encryptedTo" => "",
"encrypter" => "",
"fingerprint" => "",
"hasKey" => "",
"hex_id" => "",
"identity" => "",
"length" => "",
"pubkeyAddress" => "",
"sigdate" => "",
"signed" => "",
"signer" => "",
"sigtime" => ""   
}
@@classes =
{"EncryptedDocument" => "",
             "Endorsement" => "",
             "PubKey" => "",
             "SigEvent" => "",
             "User" => ""
}

Class Method Summary collapse

Methods inherited from Namespaces

list, list_form

Class Method Details

.classesObject

Return a list of Namespace’s classes



51
52
53
# File 'lib/data_models/namespaces/wot.rb', line 51

def self.classes
   @@classes.keys
end

.classes_formObject



55
56
57
58
59
60
61
# File 'lib/data_models/namespaces/wot.rb', line 55

def self.classes_form 
  list = {}
  @@classes.keys.each do |c|
    list[c] = c
  end
  list
end

.get_uriObject

Return Namespace URI



28
29
30
# File 'lib/data_models/namespaces/wot.rb', line 28

def self.get_uri
  @@uri
end

.propertiesObject

Return a list of Namespace’s properties



38
39
40
# File 'lib/data_models/namespaces/wot.rb', line 38

def self.properties
   @@properties.keys
end

.properties_formObject



42
43
44
45
46
47
48
# File 'lib/data_models/namespaces/wot.rb', line 42

def self.properties_form 
  list = {}
  @@properties.keys.each do |property|
    list[property] = property
  end
  list
end

.to_s(property, uri, value) ⇒ Object

Return tag to rdf doc



33
34
35
# File 'lib/data_models/namespaces/wot.rb', line 33

def self.to_s(property,uri,value)
   @@properties[property].gsub("%uri%",uri).gsub('%value%',value)
end