tags:

views:

63

answers:

1

Is it possible to update an rdf file dynamically from user generated input through a webform? The exact scenario would beskos concept definitions being created and updated through user input to html forms.

I was considering xpath but is there a better / generally accepted / best practice way of doing this kind of thing?

+1  A: 

For this type of thing there are IMO two approaches:

1 - Using Named Graphs in a Triple Store

Rather than editing an actual fixed file you use a Graph which is stored as a named graph in a Triple Store that supports triple level updates (i.e. you can change individual Triples in a Graph). For example you could use a store like Virtuoso or a Jena based store (Jena SDB/TDB) to do this, basically any store that supports the SPARUL language or has it's own equivalent.

2 - Using a fixed RDF file and altering it

From your mention of XPath I assume that you are intending to store your file as RDF/XML. While XPath would potentially work for this it's going to be dependent on the exact serialization of your file and may get very complex. If your app is going to allow users to submit and edit their own files then they'll be no guarantees over how the RDF has been serialized into RDF/XML so your XPath expressions might not work. If you control all the serialization and processing of the RDF/XML then you can keep it in a format that your XPath will work on.

From my point of view the simplest way to do this approach is to load the file into memory using an appropriate RDF library, manipulate it in memory and then persist the whole thing back to disk when the user is done (or at regular intervals or whatever is appropriate to your application)

RobV
If PHP is your language (assuming that http://www.semanticoverflow.com/questions/432/dynamic-skos-concepts is your question) then you should look at the ARC framework http://arc.semsol.org/
RobV
Hi first thanks for the reply. Well I am a little confused now - this is all quite new to me so sorry if I dont make sense here. My understanding was that I would create uri's that would hold the skos concepts (yes in rdf/xml) format. Are you then saying that I dont need to do this and just use a template that I open with the tripe store - arc - and edit with sparql adding the nodes etc I need?
David