Skip to content

Edit resources with RDFauthor using RDFa

cannelony edited this page Nov 19, 2012 · 1 revision

Download

ZIP or git clone https://github.com/AKSW/RDFauthor.git

Include RDFauthor to DOM

Add the rdfauthor.js between the HEAD-TAG of your page.

<script type="text/javascript" src="rdfauthor/src/rdfauthor.js"></script>

Endpoints

After adding the JavaScript file to DOM, you have to set the query endpoint, update endpoint as well as the resource graph. This can be done using RDFa.

<link about="http://resource.graph/" rel="update:queryEndpoint" href="http://url.to/sparqlendpoint" /> <link about="http://resource.graph/" rel="update:updateEndpoint" href="http://url.to/sparqlendpoint" />

The namespace update is a RDF vocabulary for describing data sources. The default namespace is http://ns.aksw.org/update/.

  • update:sourceGraph - Specifies the SPARQL / Update endpoint to sent the changes.
  • update:queryEndpoint - Specifies an optional SPARQL endpoint for further queries.
  • update:sourceGraph - Specifies a named graph, the triples has contributed to the current page.
  • update:defaultGraph - Specifies the named graph into which new Statements should be saved.

RDFauthor specific stuff

RDFauthor offers a callback, which is executed before initialization of RDFauthor.

RDFAUTHOR_READY_CALLBACK = function() { RDFauthor.start(); }

Code sample

This code sample demonstrates RDFauthor embedded in a XHTML website using RDFa.