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
- Host: GitHub
- URL: https://github.com/atomgraph/rdf-post
- Owner: AtomGraph
- Created: 2020-06-26T07:54:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-06-12T19:29:44.000Z (6 months ago)
- Last Synced: 2025-06-12T20:54:57.897Z (6 months ago)
- Topics: format, rdf, semantic-web, syntax
- Homepage: https://atomgraph.github.io/RDF-POST/
- Size: 11.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 `<=` 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/).