Pass an optional option record to jsonld
activitystreams/ontology.scm
395 | 395 | #f)))) | |
396 | 396 | document))))))) | |
397 | 397 | ||
398 | - | (define (uri->as-document ontology uri) | |
399 | - | (json->as-document ontology (expand uri))) | |
398 | + | (define* (uri->as-document ontology uri #:key (options #f)) | |
399 | + | (if options | |
400 | + | (json->as-document ontology (expand uri #:options options)) | |
401 | + | (json->as-document ontology (expand uri)))) | |
400 | 402 | ||
401 | - | (define (as-document->json ontology doc) | |
403 | + | (define* (as-document->json ontology doc #:key (options #f)) | |
402 | 404 | (define (as-document->proper-json doc) | |
403 | 405 | (append | |
404 | 406 | `(("@type" . ,(list->array 1 (map as-type-uri (as-document-types doc))))) | |
… | |||
429 | 431 | '()))) | |
430 | 432 | (else doc))) | |
431 | 433 | ||
432 | - | (compact (as-value->proper-json doc) | |
433 | - | `(("@context" . ,(list->array 1 (ontology-context ontology)))))) | |
434 | + | (let ((proper-json (as-value->proper-json doc)) | |
435 | + | (context `(("@context" . ,(list->array 1 (ontology-context ontology)))))) | |
436 | + | (if options | |
437 | + | (compact proper-json context) | |
438 | + | (compact proper-json context #:options options)))) | |
434 | 439 | ||
435 | 440 | (define* (as-document->graphviz doc #:key (label "n")) | |
436 | 441 | (cond |