From 8c24b7e717c64fcf7f74b8032b906fd52e28e532 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Sat, 21 Jan 2017 14:32:24 -0500 Subject: [PATCH] hide unused fields in rdf --- app/models/synapse.rb | 2 +- app/models/topic.rb | 6 +++--- app/models/user.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/synapse.rb b/app/models/synapse.rb index 1fa376e0..c42123c9 100644 --- a/app/models/synapse.rb +++ b/app/models/synapse.rb @@ -57,7 +57,7 @@ class Synapse < ApplicationRecord output += %( mm:topic1 d:topic_#{topic1_id} ;\n) output += %( mm:topic2 d:topic_#{topic2_id} ;\n) output += %( mm:direction "#{category}" ;\n) - output += %( rdfs:comment "#{desc}" ;\n) + output += %( rdfs:comment "#{desc}" ;\n) if desc.present? output[-2] = '.' output += %(\n) output diff --git a/app/models/topic.rb b/app/models/topic.rb index b741de46..fecad233 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -85,9 +85,9 @@ class Topic < ApplicationRecord def as_rdf output = '' output += %(d:topic_#{id} a mm:topic ;\n) - output += %( rdfs:label "#{name}";\n) - output += %( rdfs:comment "#{desc}";\n) - output += %( foaf:homepage <#{link}>;\n) if link.present? + output += %( rdfs:label "#{name}" ;\n) + output += %( rdfs:comment "#{desc}" ;\n) if desc.present? + output += %( foaf:homepage <#{link}> ;\n) if link.present? output += %( mm:mapper d:mapper_#{user_id} ;\n) output += %( mm:metacode "#{metacode.name}" ;\n) output[-2] = '.' # change last ; to a . diff --git a/app/models/user.rb b/app/models/user.rb index abb03553..17d9c8d4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -71,8 +71,8 @@ class User < ApplicationRecord base_url = opts[:base_url] || 'https://metamaps.cc' output = '' output += %(d:mapper_#{id} a foaf:OnlineAccount ;\n) - output += %( foaf:accountName "#{name}";\n) - output += %( foaf:accountServiceHomepage "#{base_url}/mapper/#{id}";\n) + output += %( foaf:accountName "#{name}" ;\n) + output += %( foaf:accountServiceHomepage "#{base_url}/mapper/#{id}" ;\n) output[-2] = '.' # change last ; to a . output += %(\n) output