UCDavisLibrary / fin-cli

CLI interface for a Linked Data Platform (Like fin-server)
MIT License
0 stars 0 forks source link

Directory (Container) Commands #3

Open qjhart opened 7 years ago

qjhart commented 7 years ago

Directory commands

Although ldp uses a

rm [dirname]

The rm commands removes either a directory or a file.

This is interesting, I don't know what happens to the tombstones of the other files in a recursive deletion.

>cd /fcrepo/rest/user/quinn
>mkdir foo/bar/baz
>rm -rf foo

pwd

Echos the current working directory for the cli.

cd dir

This will change the CLIs tool notion of the CWD. Whether this succeeds depends on the --template we are operating under. If template=ldp, then this will

--force Do no checking of the acl:type on the container.

cd $HOME
mkdir foo
cp file://./bar.jpg foo/bar
cd foo/bar  # Fails ./foo/bar is not an ldp:Container
cd -f foo/bar # This is OK.  Good luck! 

mkdir

The mkdir command allows one to create and ldp:Container. By default, these are created as ldp:BasicContainer, but can also be used to create ldp:DirectContainer and 'ldp:IndirectContainer`

vorpal.command('mkdir <fpath>')
      .option('-h --hasMemberRelation <has_member>','Specify the predicate to cd into.')
      .option('-i --isMember <is_member>','Specify the type of object to cd into.')
      .option('
      .option('-p --put <triples>,'Specify additional triples')
      .option(-r --rdf <filename>,'Specity addtional triples as file (- = stdin)'

Basic Container

For basic Containers mkdir is equivalent to a put command. If the

>mkdir foo/bar/baz
# Equivalent to 
>put -t='<> a ldp:BasicContainer' foo/bar/baz

rm -rf foo

mkdir -p foo/bar/baz la bar

qjhart commented 7 years ago

This is not yet complete So don't comment.