{"id":13557133,"url":"https://github.com/AKSW/owcli","last_synced_at":"2025-04-03T11:31:04.702Z","repository":{"id":140639320,"uuid":"2470559","full_name":"AKSW/owcli","owner":"AKSW","description":"The OntoWiki Command Line Interface","archived":false,"fork":false,"pushed_at":"2012-05-08T21:33:12.000Z","size":176,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-11-04T07:35:27.793Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AKSW.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-09-27T20:37:50.000Z","updated_at":"2013-10-27T08:22:25.000Z","dependencies_parsed_at":"2023-03-12T00:16:18.157Z","dependency_job_id":null,"html_url":"https://github.com/AKSW/owcli","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSW%2Fowcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSW%2Fowcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSW%2Fowcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AKSW%2Fowcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AKSW","download_url":"https://codeload.github.com/AKSW/owcli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246992906,"owners_count":20865901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T12:04:11.070Z","updated_at":"2025-04-03T11:30:59.689Z","avatar_url":"https://github.com/AKSW.png","language":"PHP","funding_links":[],"categories":["PHP","others"],"sub_categories":[],"readme":"# owcli - the OntoWiki Command Line Interface\n\nThe OntoWiki Command Line Client is a script-able and pipe-able PHP application for the Unix command line to help you to manage your OntoWiki knowledge bases.\n\n## Installation\n\nInstall a command line php5 and pear, on debian/ubuntu:\n\n    sudo apt-get install php5-cli php5-curl php-pear raptor-utils\n\nInstall required pear packages, on debian/ubuntu: \n\n    sudo pear install Console_Getargs Config Console_Table\n\nDownload the [owcli download package](https://github.com/AKSW/owcli/tarball/master).\n\nUnpack it and run \n\n    make -B install\n\nin the unpacked directory. After starting a new shell (to rehash the PATH variable), you can type \n\n    owcli\n\ninto you command line and there should be an output like this:\n\n    \u003e owcli\n    The OntoWiki CLI 0.3\n    Try \"owcli --help\" for more information\n\nand you can gather general help by typing\n\n    \u003e owcli --help\n    The OntoWiki CLI 0.5\n    Usage: owcli [options]\n\n    -e --execute (optional)values  Execute one or more commands\n    -w --wiki=\u003cvalue\u003e              Set the wiki which should be used (default)\n    -m --model=\u003cvalue\u003e             Set model which should be used\n                                   (http://localhost/OntoWiki/Config/)\n    -i --input (optional)values    Set input model file (- for STDIN)\n       --inputOptions=\u003cvalue\u003e      rapper cmd input options (-i rdfxml)\n    -c --config=\u003cvalue\u003e            Set config file (/home/seebi/.owcli)\n    -l --listModels                This is a shortcut for -e store:listModels\n    -p --listProcedures            This is a shortcut for -e meta:listAllProcedures\n    -d --debug                     Output some debug infos\n    -q --quiet                     Do not output info messages\n    -r --raw                       Outputs raw json results\n    -z --zsh=\u003cvalue\u003e               zsh friendly output (do not use manually)\n    -h --help                      Show this screen\n\n    Note: Some commands are limited to the php.ini value memory_limit ...\n\n\n## Configuration\n\nYou have to create a file `.owcli` in your unix-home directory which can be used by owcli.\nThis file configures your access parameters to your OntoWiki installations.\nHere is an example:\n\n    [default] \n    baseuri = \"http://localhost/ow/trunk/\"\n    user = \"Admin\"\n    password = \"mypass\"\n    defaultmodel = \"http://example.org/\"\n\nNote: This config setups on wiki instance which is on you local host and which will be access via the Admin user.\nThe default model is used every time you do not give an explicit model to the command line.\n\nYou can have more than one sections (like `[default]`) but they need a unique name.\nTo switch between the configured wiki installations, use the `-w ` parameter.\n\n## Usage\n\nowcli is an RPC client which follows the [JSON RPC protocol specification](http://json-rpc.org/wiki/specification).\nThis means, owcli runs a remote procedure on your OntoWiki instance which is an JSON/RPC server.\n\nIf you have enabled the `jsonrpc` component extension on your Ontowiki instance (which is enabled by default) you can access different jsonrpc servers on it.\nEvery server is used for a specific category of tasks and on every server there are multiple procedures which can be started and which sometimes need more parameter.\n\nThe standard form of executing a remote procedure (with `-e`) is\n\n    [server]:[procedure]:[p1],[p2],...\n\nNote: most of the command do not need parameters.\nIf you forget a parameter, owcli will inform you about that:\n\n    \u003e owcli -m http://example.org -e model:addPrefix   \n    The command 'model:addPrefix' needs a value for parameter 'prefix' but no more values given.\n    Something went wrong, response was not json encoded (turn debug on to see more)\n\nCurrently, these servers are enabled and you can verify it on your installation by typing:\n\n    \u003e owcli -e meta:listServer\n    +-------+--------------------------------------------------+\n    | name  | description                                      |\n    +-------+--------------------------------------------------+\n    | meta  | methods to query the json service itself         |\n    | store | methods to manipulate and query the store        |\n    | model | methods to manipulate and query a specific model |\n    +-------+--------------------------------------------------+\n\nNote: This command executes the procedure `listServer` on the `meta`-server which has `methods to query the json service itself`.\n\nTo list all methods in the `meta`-category, you can use the `listProcedure` command in the same category.\nSo if you wanna know, which procedure are available in the `model`-category you can type:\n\n    \u003e owcli -e meta:listProcedures:model\n    +--------------+--------------------------------------------+\n    | name         | description                                |\n    +--------------+--------------------------------------------+\n    | model:export | exports a model as rdf/xml                 |\n    | model:sparql | performs a sparql query on the model       |\n    | model:count  | counts the number of statements of a model |\n    | model:add    | add all input statements to the model      |\n    | model:create | create a new knowledge base                |\n    | model:drop   | drop an existing knowledge base            |\n    +--------------+--------------------------------------------+\n\nNote: This command executes the procedure `listProcedures` on the `meta`-server with one parameter which has the value `model` (which stands for the category to query).\n\nBTW: To list all procedures in all categories, you can run `meta:listAllProcedures` which has also a hard-wired shortcut `-p`.\n\n    \u003e owcli -p\n    +------------------------+-------------------------------------------------------------+\n    | name                   | description                                                 |\n    +------------------------+-------------------------------------------------------------+\n    | meta:listServer        | lists all jsonrpc server from the wiki instance             |\n    | meta:listProcedures    | lists all remote procedures from a specific jsonrpc server  |\n    | meta:listAllProcedures | lists all remote procedures from ALL jsonrpc server         |\n    | store:listModels       | list modelIris which are readable with the current identity |\n    | store:getBackendName   | return the name of the backend (e.g. Zend or Virtuoso)      |\n    | store:sparql           | performs a sparql query on the store                        |\n    | store:getIdentity      | returns the label of the current identity                   |\n    | model:export           | exports a model as rdf/xml                                  |\n    | model:sparql           | performs a sparql query on the model                        |\n    | model:count            | counts the number of statements of a model                  |\n    | model:add              | add all input statements to the model                       |\n    | model:create           | create a new knowledge base                                 |\n    | model:drop             | drop an existing knowledge base                             |\n    +------------------------+-------------------------------------------------------------+\n\nAnother hard-wired shortcut is `-l` which stands for `-e store:listModels` and output the URIs of all readable models (readable means readable for the configured account).\n\n    \u003e owcli -l\n    http://localhost/OntoWiki/Config/\n    http://ns.ontowiki.net/SysOnt/\n    http://ns.ontowiki.net/SysBase/\n\n## Examples\n\nCreate a new example Model and add tripels from a file after that:\n\n    \u003e owcli -m http://example.org -e model:create model:add -i model.rdf\n\nNote: The order of the procedures is important ...\n\nSince from now on, we would always type `-m http://example.org` to access the example model, we can configure it in the `.owcli` file as default model or we can modify the environment variable `OWMODEL` to set the default model for this session.\n\n    \u003e export OWMODEL=\"http://example.org\"\n\nNote: Other environment variables are `OWWIKI` (instead of `-w wikiname`) and `OWCONFIG` (instead of `-c configfile`)\n\nCatch the FOAF schema from the web and add it to the example model too:\n\n    wget -q -O - http://xmlns.com/foaf/spec/index.rdf | owcli -e model:add -i -\n\nNote: owcli can read content from the stdin too, so you can use it in a pipe ...\n\nCount the example model:\n\n    \u003e owcli -e model:count\n    14647\n\nExport the example model to a file:\n\n    \u003e owcli -e model:export \u003emyNewModel.rdf\n\nExport the example model, put it to [cwm](http://www.w3.org/2000/10/swap/doc/cwm) and add the inferred statements from the rule file:\n\n    \u003e owcli -e model:export | cwm --rdf --n3 --filter=Rules.n3 --rdf | owcli -e model:add -i -\n\nRemove the example model from the store:\n\n    \u003e owcli -e model:drop\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAKSW%2Fowcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAKSW%2Fowcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAKSW%2Fowcli/lists"}