Skip to content

AtomGraph/RDF-POST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

RDF/POST

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 <form> 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 namespace 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 for the full EBNF grammar.)

Minimal example

<form action="/post" method="post">
  <!-- start -->
  <input type="hidden" name="rdf" value="">
  <!-- namespaces -->
  <input type="hidden" name="v" value="http://xmlns.com/foaf/0.1/">
  <input type="hidden" name="n" value="dc">
  <input type="hidden" name="v" value="http://purl.org/dc/elements/1.1/">
  <!-- triples -->
  <input type="hidden" name="sb" value="o">
  <input type="hidden" name="pv" value="givenName">
  <input type="text"   name="ol" value="Ora"></form>

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:

_: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 – streaming parser for Apache Jena (AtomGraph Core)

Credits

Specification by Sergei Egorov, maintained by AtomGraph.

About

RDF/POST is a compact syntax for serialising an RDF graph inside a classic HTML forms

Topics

Resources

Stars

Watchers

Forks