An open API service indexing awesome lists of open source software.

https://github.com/atomgraph/rdf-post

RDF/POST Encoding for RDF
https://github.com/atomgraph/rdf-post

format rdf semantic-web syntax

Last synced: 6 months ago
JSON representation

RDF/POST Encoding for RDF

Awesome Lists containing this project

README

          

# RDF/POST

**[RDF/POST](https://atomgraph.github.io/RDF-POST/)** is a compact syntax for serialising an RDF graph inside a classic HTML `application/x-www-form-urlencoded` payload, so it works with *any* browser’s GET or POST mechanisms—no JavaScript required.

## Why use it?

* **Plain‑HTML forms** – build RDF edit and create interfaces with ordinary `` elements—no JavaScript required.
* **Language‑agnostic** – piggybacks on the ubiquitous `application/x-www-form-urlencoded` encoding that every web framework already understands.
* **Streaming‑friendly** – triples arrive in a simple key/value stream, so parsers can handle very large graphs with constant memory.

## TL;DR syntax

| Part | Key(s) | Meaning |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| `rdf=` | (first pair) | marks the start of an RDF/POST body |
| `&v=` | default namespace IRI | |
| `&n=…&v=` | extra **n**amespace prefix + IRI | |
| **Subject** | `&sb=` blank ‖ `&su=` full IRI ‖ `&sv=` suffix ‖ `&sn=…&sv=` prefixed suffix | |
| **Predicate** | `&pv=` suffix ‖ `&pn=…&pv=` prefixed suffix ‖ `&pu=` full IRI | |
| **Object** | `&ob=` blank ‖ `&ou=` full IRI ‖ `&ov=` suffix ‖ `&on=…&ov=` prefixed suffix ‖ `&ol=` literal (plus optional `&lt=` datatype \| `&ll=` lang) | |

*(See the [specification](https://atomgraph.github.io/RDF-POST/) for the full EBNF grammar.)*

## Minimal example

```html











```

When submitted, the browser sends a single line such as

```
rdf=&v=http://xmlns.com/foaf/0.1/&n=dc&v=http://purl.org/dc/elements/1.1/&sb=o&pv=givenName&ol=Ora …
```

which is equivalent to the Turtle below:

```turtle
_:o foaf:givenName "Ora" ;
dc:creator _:b .
```

## Media type & file extension

* Default: `application/x-www-form-urlencoded`
* RDF‑specific (proposed): `application/rdf+x-www-form-urlencoded`
* Recommended extension: `.rpo`

## Implementations

* [**RDFPostReader**](https://github.com/AtomGraph/Core/blob/master/src/main/java/com/atomgraph/core/riot/lang/RDFPostReader.java) – streaming parser for Apache Jena (AtomGraph Core)

## Credits

Specification by **Sergei Egorov**, maintained by [**AtomGraph**](https://atomgraph.com/).