Skip to content

Edit resources with RDFauthor using RDF JSON

cannelony edited this page Nov 27, 2012 · 7 revisions
  1. Set RDFAUTHOR_BASE

RDFAUTHOR_BASE is a variable that refers to the root directory of RDFauthor and have to be declared before adding RDFauthor to DOM. The setup code requires RDFAUTHOR_BASE.

<script type="text/javascript">
RDFAUTHOR_BASE='http://localhost/rdfauthor';
</script>

  1. Download

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

  1. Include to DOM

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

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

  1. Configure and run

<script type="text/javascript">
RDFauthor.edit({
view: 'popover',
useSPARQL11: true|false, /* default false */
onSubmitSuccess: function() { alert('onSubmitSuccess'); },
title: 'Edit Property Title for ' + 'http://example.org/about',
saveButtonTitle: 'Custom Save',
cancelButtonTitle: 'Custom Cancel',
loadOwStylesheet: true|false, /* default true */
targetSparqlEndpoint: 'http://localhost/ontowiki/sparql',
targetUpdateEndpoint: 'http://localhost/ontowiki/update',
targetGraph: 'http://mygraph.org/',
targetResource: 'http://example.org/about',
targetResourceData: rdfjson
});
</script>

Required:

  • targetSparqlEndpoint (endpoint, which will be used to query a resource)
  • targetUpdateEndpoint (endpoint, which will be used to update a resource)
  • targetGraph (resource graph)
  • targetResource (resource uri)

Optional:

  • view (popover [, inline, mobile])
  • useSPARQL11 (true: sparql11, false: json response)
  • onSubmitSuccess (callback will be fired after success)
  • title (title of popover window)
  • saveButtonTitle
  • cancelButtonTitle
  • loadOwStylesheet
  • targetResourceData (RDF/JSON result - can be contain more resources)

If no targetResourceData is defined, RDFauthor will query the defined targetSPARQLEndpoint.

Clone this wiki locally