Skip to content

Use multipart/mixed for notating a sequence of documents #19

@awwright

Description

@awwright

The document at https://w3c-cg.github.io/rsp/spec/messages and especially many of the issues within it seems to struggle with how to concatenate multiple documents together while still preserving the EOF (end of file) semantics of each of them. (Issue 9)

It also appears to struggle with how to refer to the resulting media type (Issue 10), unfortunately you cannot just mint new media type identifiers on a whim. In particular, the identifiers such as application/rdfm+xml and application/x-ld+ndjson are not legal. For experimental use, use the "personal" or perhaps "vendor" subtrees as described in RFC 3838.

For concatenating together multiple documents into a sequence, use the multipart/mixed media type. This is a very natural format for RDF+XML and JSON-LD because these documents cannot start with the -- delimiter that multipart encoding uses, so you can use an empty boundary name. It is even technically possible to mix together media types:

---
Content-type: application/ld+json

{"@context": "https://schema.org/", "@type": "Product", "name": "Hairdryer DRY 2000", "color": "red"}
---
Content-type: application/ld+json

{"@context": "https://schema.org/", "@type": "Product", "name": "27-inch 4K Monitor 2700P", "color": "black"}
---
Content-type: application/rdf+xml

<?xml version="1.0" encoding="utf-8"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:schema="http://schema.org/"><rdf:Description rdf:nodeID="b3"><rdf:type rdf:resource="http://schema.org/Product"/><schema:name>Hairdryer DRY 2000</schema:name><schema:color>red</schema:color></rdf:Description></rdf:RDF>
---
Content-type: application/rdf+xml

<?xml version="1.0" encoding="utf-8"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:schema="http://schema.org/"><rdf:Description rdf:nodeID="b3"><rdf:type rdf:resource="http://schema.org/Product"/><schema:name>27-inch 4K Monitor 2700P</schema:name><schema:color>black</schema:color></rdf:Description></rdf:RDF>
-----

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions