Fix encoding to json
activitystreams/ontology.scm
| 413 | 413 | ((as-document? doc) | |
| 414 | 414 | (as-document->proper-json doc)) | |
| 415 | 415 | ((list? doc) | |
| 416 | - | (map | |
| 417 | - | (match-lambda | |
| 418 | - | ((key . value) | |
| 419 | - | (cons | |
| 420 | - | (if (string? key) | |
| 421 | - | key | |
| 422 | - | (as-property-uri key)) | |
| 423 | - | (as-value->proper-json value)))) | |
| 424 | - | doc)) | |
| 416 | + | (list->array 1 (map as-value->proper-json doc))) | |
| 425 | 417 | ((string? doc) | |
| 426 | 418 | doc) | |
| 427 | - | ((array? doc) | |
| 428 | - | (list->array 1 (map as-value->proper-json (array->list doc)))) | |
| 429 | 419 | ((as-typed-value? doc) | |
| 430 | 420 | `(("@value" . ,(as-typed-value-value doc)) | |
| 431 | 421 | ("@type" . ,(as-type-uri (as-typed-value-type doc))))) |
activitystreams/predicates.scm
| 20 | 20 | #:use-module (jsonld json) | |
| 21 | 21 | #:use-module (web uri) | |
| 22 | 22 | #:export (uri? float? mime-type? date? string-or-lang-string? duration? | |
| 23 | - | langtag? link-relation? non-negative-integer?)) | |
| 23 | + | langtag? link-relation? non-negative-integer? time? date-time?)) | |
| 24 | 24 | ||
| 25 | 25 | (define (uri? s) | |
| 26 | 26 | (and (string? s) (string->uri s))) | |
… | |||
| 49 | 49 | ||
| 50 | 50 | (define (non-negative-integer? s) | |
| 51 | 51 | (and (number? s) (>= s 0))) | |
| 52 | + | ||
| 53 | + | (define (time? s) | |
| 54 | + | (string? s)) | |
| 55 | + | ||
| 56 | + | (define (date-time? s) | |
| 57 | + | (string? s)) | |