solidcommunity.net icon indicating copy to clipboard operation
solidcommunity.net copied to clipboard

Wanted: App to move links from soli.community to solidcommunity.net

Open timbl opened this issue 5 years ago • 5 comments

Could be web app and/or command line app. Ideally web app first.

  • Takes a folder (or pod root) to start with
  • Iterated all data files within the folder
  • Optionally (but by default) , asks the user before each change
  • Reads any RDF file, converts any URIs on solid.community to solidcommunity.net and saves it back
  • Optionally, Iterates into sub-folders
  • Optionally, also does the same to any ACL files it finds

timbl avatar Oct 09 '20 10:10 timbl

I have published.

https://bourgeoa.github.io/solid-ide/ that can now recursively convert all solid.community links to solidcommunity.net on .ttl .acl and .meta (all contentType='text/turtle) It can be run on any pod and from root or on a folder basis. You can make a blank test. You must login in options and add https://bourgeoa.github.io as trusted app in your pod.

The app does not convert all RDF files but only 'text/turtle'. It does it parsing the content as text split on '<' then on '>'. The remaining link is checked to replace 'solid.community' by solidcommunity.net This way the formating is maintained.

It is not very quick but it shall not be used frequently.

Can this be used to other RDF file extension ? What are the link identifiers ?

bourgeoa avatar Oct 10 '20 14:10 bourgeoa

@timbl @justinwb @jackson I just made a command line app to rename links recursively from solid.community to solidcommunity.net recursively from a folder (full server, a pod or a folder pod). It can be run on acl, meta, ttl files including /profile/card#ttl

This is the only way to rename acl with full url webId's. These acl are actually blocking any access.

The app has been tested on my docker server running NSS 5.5.2 on multiuser mode.

Can anyone tell me where to publish ?

bourgeoa avatar Oct 14 '20 15:10 bourgeoa

@bourgeoa is this something you can put up on your personal github and make available so we can take a look?

justinwb avatar Oct 14 '20 18:10 justinwb

@justinwb here is the link https://github.com/bourgeoa/linkRename

bourgeoa avatar Oct 14 '20 21:10 bourgeoa

@timbl @justinwb @michielbdejong

All files with extension acl, meta and ttl, with contents including solid.community string (not all are links), have been backed up to /bak.solid.community

  • Here are some stats :
#find solid.community/ -maxdepth 1 -type d -print | wc -l
50652

#find /bak.* -type f | wc -l
157559

#./linkRename.js test --folder /mnt/v*/solid.community

Found 50975 "meta" with strings to rename      # mainly /.meta
Found 139 "acl" with strings to rename
Found 106445 "ttl" with strings to rename       # mainly /profile/card$.ttl and /settings/prefs.ttl
  • replacement proposal : using ./linkRename run --folder /mnt/v*/solid.community -- stop the server -- replace only pod name links https://xxx.solid.community/yyy to https://xxx.solidcommunity.net/yyy
// only replace server links and do not make relative to keep as original
function rename (content, source, target) {
   const newContent = content.replace(new RegExp(`<https://(.*?).${source}(.*?)>`, 'g'), `<https://$1.${target}$2>`)
return newContent
}

-- look at the remaining files and see if we want to change the remaining strings

Nota : I have tested the results on my own server and on my solidcommunity.net pod bourgeoa.solidcommunity.net

bourgeoa avatar Nov 01 '20 11:11 bourgeoa