hide unused fields in rdf

This commit is contained in:
Devin Howard 2017-01-21 14:32:24 -05:00
parent f1cf05ce75
commit 8c24b7e717
3 changed files with 6 additions and 6 deletions

View file

@ -57,7 +57,7 @@ class Synapse < ApplicationRecord
output += %( mm:topic1 d:topic_#{topic1_id} ;\n) output += %( mm:topic1 d:topic_#{topic1_id} ;\n)
output += %( mm:topic2 d:topic_#{topic2_id} ;\n) output += %( mm:topic2 d:topic_#{topic2_id} ;\n)
output += %( mm:direction "#{category}" ;\n) output += %( mm:direction "#{category}" ;\n)
output += %( rdfs:comment "#{desc}" ;\n) output += %( rdfs:comment "#{desc}" ;\n) if desc.present?
output[-2] = '.' output[-2] = '.'
output += %(\n) output += %(\n)
output output

View file

@ -85,9 +85,9 @@ class Topic < ApplicationRecord
def as_rdf def as_rdf
output = '' output = ''
output += %(d:topic_#{id} a mm:topic ;\n) output += %(d:topic_#{id} a mm:topic ;\n)
output += %( rdfs:label "#{name}";\n) output += %( rdfs:label "#{name}" ;\n)
output += %( rdfs:comment "#{desc}";\n) output += %( rdfs:comment "#{desc}" ;\n) if desc.present?
output += %( foaf:homepage <#{link}>;\n) if link.present? output += %( foaf:homepage <#{link}> ;\n) if link.present?
output += %( mm:mapper d:mapper_#{user_id} ;\n) output += %( mm:mapper d:mapper_#{user_id} ;\n)
output += %( mm:metacode "#{metacode.name}" ;\n) output += %( mm:metacode "#{metacode.name}" ;\n)
output[-2] = '.' # change last ; to a . output[-2] = '.' # change last ; to a .

View file

@ -71,8 +71,8 @@ class User < ApplicationRecord
base_url = opts[:base_url] || 'https://metamaps.cc' base_url = opts[:base_url] || 'https://metamaps.cc'
output = '' output = ''
output += %(d:mapper_#{id} a foaf:OnlineAccount ;\n) output += %(d:mapper_#{id} a foaf:OnlineAccount ;\n)
output += %( foaf:accountName "#{name}";\n) output += %( foaf:accountName "#{name}" ;\n)
output += %( foaf:accountServiceHomepage "#{base_url}/mapper/#{id}";\n) output += %( foaf:accountServiceHomepage "#{base_url}/mapper/#{id}" ;\n)
output[-2] = '.' # change last ; to a . output[-2] = '.' # change last ; to a .
output += %(\n) output += %(\n)
output output