-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add doc page for export-prefixes (#786)
* Add page for export-prefixes * fix json formatting
- Loading branch information
1 parent
2a92796
commit 9a779ed
Showing
3 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Export Prefixes | ||
|
||
You can print or save the current [prefixes](/global#prefixes) using the `export-prefixes` command: | ||
|
||
robot --prefixes foo.json \ | ||
--prefix "bar: http://bar#" \ | ||
--prefix "baz: http://baz#" \ | ||
export-prefixes | ||
|
||
This prints the [default prefixes](https://github.com/ontodev/robot/blob/master/robot-core/src/main/resources/obo_context.jsonld) *plus* the user-added prefixes in [JSON-LD format](https://json-ld.org/) The prefixes are contained within a `@context` that can be used to resolve [JSON-LD compact IRIs](https://www.w3.org/TR/json-ld/#compact-iris). For the above, command, the printed output would look something like: | ||
|
||
``` | ||
{ | ||
"@context": { | ||
"obo": "http://purl.obolibrary.org/obo/", | ||
"oboInOwl": "http://www.geneontology.org/formats/oboInOwl#", | ||
... | ||
"foo": "http://foo#", | ||
"bar": "http://bar#", | ||
"baz": "http://baz#" | ||
} | ||
} | ||
``` | ||
|
||
You can also include an output to write the prefixes to a file: | ||
|
||
robot --noprefixes --prefix "foo: http://foo#" \ | ||
export-prefixes --output results/foo.json | ||
|
||
The `--noprefixes` flag is used in this example, meaning the default prefixes are not included. For more details on adding prefixes, see [prefixes](/global#prefixes). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters