Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pycap 34 docs curation bug #35

Merged
merged 2 commits into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions docs/api/curations.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,20 @@ You need to specify `content` which depends on the annotation format specified i

To curate a document outside of INCEpTION or to simply change the status of a document into a curator status, you could do the following:

```python
```python

from pycaprio.mappings import InceptionFormat
# Get the annotations or a specific document as e.g. binary CAS
file = client.api.annotation(1, 4, 'test-user', curation_format=InceptionFormat.BIN)
# The below function then uploads the file with the new status
client.api.create_curation(1, 4, curation_format = InceptionFormat.BIN, content = annotations, document_state = DocumentState.CURATION_IN_PROGRESS)

```

XMI format also works, but one has to unzip the file first and import only the plain XMI file
```python

```python

from pycaprio.mappings import InceptionFormat
annotation_content = client.api.annotation(1, 4, 'test-user', curation_format=InceptionFormat.XMI)
z = zipfile.ZipFile(io.BytesIO(annotations))
Expand All @@ -99,6 +103,7 @@ with open('/path/to/folder/file.xmi', 'rb') as f:
file = f.read()
# The below function then uploads the file with the new status
client.api.create_curation(1, 4, curation_format = InceptionFormat.XMI, content = file, document_state = DocumentState.CURATION_IN_PROGRESS)

```

### Delete curations
Expand All @@ -111,6 +116,8 @@ You can provide a `Document` instance instead of a `document_id` as well.
Example:

```python

client.api.delete_curation(1,4) # Deletes curated document #4 from project #1

```

1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ nav:
- Projects: 'api/projects.md'
- Documents: 'api/documents.md'
- Annotations: 'api/annotations.md'
- Curations: 'api/curations.md'
- Formats: 'api/formats.md'
- Tests: 'tests.md'
- License: 'license.md'
Expand Down