Skip to content

Commit a33ee5f

Browse files
committed
webanno: added skip_context parameter to WebAnnoConfig
1 parent 15f16e1 commit a33ee5f

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/annotation.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ impl PyAnnotation {
498498
if let Ok(Some(v)) = kwargs.get_item("extra_context") {
499499
config.extra_context = v.extract()?;
500500
}
501+
if let Ok(Some(v)) = kwargs.get_item("skip_context") {
502+
config.skip_context = v.extract()?;
503+
}
501504
if let Ok(Some(v)) = kwargs.get_item("context_namespaces") {
502505
config.context_namespaces = {
503506
let mut namespaces = Vec::new();

stam.pyi

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,15 @@ class Annotation:
860860
IRI prefix for Text Resources. Will be prepended if the resource public ID is not an IRI yet.
861861
862862
'extra_context`: `[str]`
863-
Extra JSON-LD context to export, these must be URLs to JSONLD files.
864-
863+
Extra JSON-LD context to export, these must be URLs to JSONLD files.
864+
The contexts you provide also double as possible STAM dataset IDs.
865+
Any keys in these sets that are not full IRIs will
866+
be copied as-is to the output (as alias rather than joined with the set ID to form a
867+
full IRI ), leaving interpretation it up to the JSON-LD context.
868+
869+
'skip_context`: `bool`
870+
Do not output @context when outputting web annotations (useful if already done at an earlier stage)
871+
865872
`auto_generated`: `bool`
866873
Automatically add a 'generated' triple for each annotation, with the timestamp of serialisation
867874

0 commit comments

Comments
 (0)