diff --git a/decksToRDF.js b/decksToRDF.js index 20ae052..9cf5a06 100644 --- a/decksToRDF.js +++ b/decksToRDF.js @@ -41,23 +41,17 @@ function convertToRDF(obj) { //print turtle let id = obj[idField]; console.log('#######'+id+'#########'); - console.log(` -swR:${id} a swV:Deck . - `); + console.log(`swR:${id} a swV:Deck .`); for(let prop in obj){ if(selected.indexOf(prop) !== -1){ //custom properties if(prop === 'user'){ - console.log(` -swR:${id} prv:createdBy swUserR:${obj[prop]} . - `); + console.log(`swR:${id} prv:createdBy swUserR:${obj[prop]} .`); continue; } if(prop === 'contributors'){ obj[prop].forEach((item)=>{ - console.log(` -swR:${id} swV:hasContibutor swUserR:${item.user} . - `); + console.log(`swR:${id} swV:hasContibutor swUserR:${item.user} .`); }); continue; } @@ -73,13 +67,10 @@ swR:${id}-${item.id} a swV:DeckRevision ; swV:abstract """${item.abstract ? encodeURIComponent(item.abstract) : '-'}""" ; swV:theme """${item.theme}""" ; swV:allowMarkdown """${item.allowMarkdown}""" ; - prv:createdBy swUserR:${item.user} . - `); + prv:createdBy swUserR:${item.user} .`); if(item.tags.length){ item.tags.forEach((tag)=>{ - console.log(` -swR:${id}-${item.id} swV:hasTag swTagR:${tag.id} . - `); + console.log(`swR:${id}-${item.id} swV:hasTag swTagR:${tag.id} .`); }); } item.contentItems.forEach((content)=>{ @@ -89,16 +80,14 @@ swR:${id}-${item.id} swV:hasContentItem a swV:SlideRevisionUsedInDeck ; swV:isRevisedFrom swSlideR:${content.ref.id} ; swV:isEqualTo swSlideR:${content.ref.id}-${content.ref.revision} ; - swV:order """${content.order}""" . - `); + swV:order """${content.order}""" .`); }else{ console.log(` swR:${id}-${item.id} swV:hasContentItem . a swV:DeckRevisionUsedInDeck ; swV:isRevisedFrom swR:${content.ref.id} ; swV:isEqualTo swR:${content.ref.id}-${content.ref.revision} ; - swV:order """${content.order}""" . - `); + swV:order """${content.order}""" .`); } }); @@ -106,9 +95,7 @@ swR:${id}-${item.id} swV:hasContentItem { - console.log(` -swR:${id} swV:hasContibutor swUserR:${item.user} . - `); + console.log(`swR:${id} swV:hasContibutor swUserR:${item.user} .`); }); continue; } @@ -67,15 +63,12 @@ swR:${id}-${item.id} a swV:SlideRevision ; swV:timestamp """${item.timestamp}""" ; swV:content """${encodeURIComponent(item.content)}""" ; swV:speakernotes """${item.speakernotes ? item.speakernotes : '-'}""" ; - prv:createdBy swUserR:${item.user} . - `); + prv:createdBy swUserR:${item.user} .`); }); continue; } - console.log(` -swR:${id} swV:${prop} """${obj[prop] ? obj[prop] : '-'}""" . - `); + console.log(`swR:${id} swV:${prop} """${obj[prop] ? obj[prop] : '-'}""" .`); } } } diff --git a/tagsToRDF.js b/tagsToRDF.js index dc99203..156f8e1 100644 --- a/tagsToRDF.js +++ b/tagsToRDF.js @@ -34,21 +34,15 @@ function convertToRDF(obj) { //print turtle let id = obj[idField]; console.log('#######'+id+'#########'); - console.log(` -swR:${id} a swV:Tag . - `); + console.log(`swR:${id} a swV:Tag .`); for(let prop in obj){ if(selected.indexOf(prop) !== -1){ //custom properties if(prop === 'user'){ - console.log(` -swR:${id} prv:createdBy swUserR:${obj[prop]} . - `); + console.log(`swR:${id} prv:createdBy swUserR:${obj[prop]} .`); continue; } - console.log(` -swR:${id} swV:${prop} """${obj[prop] ? obj[prop] : '-'}""" . - `); + console.log(`swR:${id} swV:${prop} """${obj[prop] ? obj[prop] : '-'}""" .`); } } } diff --git a/usergroupsToRDF.js b/usergroupsToRDF.js index d5a094a..3c49dcd 100644 --- a/usergroupsToRDF.js +++ b/usergroupsToRDF.js @@ -35,29 +35,21 @@ const idField = '_id'; function convertToRDF(obj) { //print turtle let id = obj[idField]; - console.log(` -swR:${id} a swV:UserGroup . - `); + console.log(`swR:${id} a swV:UserGroup .`); for(let prop in obj){ if(selected.indexOf(prop) !== -1){ if(prop === 'creator'){ - console.log(` -swR:${id} prv:createdBy swUserR:${obj[prop].userid} . - `); + console.log(`swR:${id} prv:createdBy swUserR:${obj[prop].userid} .`); continue; } if(prop === 'members'){ obj[prop].forEach((item)=>{ - console.log(` -swR:${id} swV:hasMember swUserR:${item.userid} . - `); + console.log(`swR:${id} swV:hasMember swUserR:${item.userid} .`); }); continue; } - console.log(` -swR:${id} swV:${prop} """${obj[prop] ? obj[prop] : '-'}""" . - `); + console.log(`swR:${id} swV:${prop} """${obj[prop] ? obj[prop] : '-'}""" .`); } } console.log('################'); diff --git a/usersToRDF.js b/usersToRDF.js index 7fedee1..657f2fd 100644 --- a/usersToRDF.js +++ b/usersToRDF.js @@ -38,20 +38,10 @@ const mappings ={ function convertToRDF(obj) { //print turtle let id = obj[idField]; - console.log(` -swR:${id} a swV:User . - `); + console.log(`swR:${id} a swV:User .`); for(let prop in obj){ if(selected.indexOf(prop) !== -1){ - if(prop === 'picture'){ - console.log(` -swR:${id} swV:picture <${obj[prop]}> . - `); - continue; - } - console.log(` -swR:${id} swV:${prop} """${obj[prop] ? obj[prop] : '-'}""" . - `); + console.log(`swR:${id} swV:${prop} """${obj[prop] ? obj[prop] : '-'}""" .`); } } console.log('################');